tindevour / backend Goto Github PK
View Code? Open in Web Editor NEWJava-Servlets based backend for tindev
Java-Servlets based backend for tindev
All the data will be posted from the client should be encoded as JSON.
For endpoints described here, this is the data format:
POST /auth/login
{
"username": "<username-here>",
"password": "<password-here>"
}
POST /auth/logout
{}
POST /auth/register
{
"name": "<name>",
"username": "<username-here>",
"password": "<password-here>",
"email": "<email-here>",
"skills": ["array", "of", "skill", "ids", "here"],
"areas": ["array", "of", "area", "ids", "here"]
}
POST /users/:user/forgot-password
{}
POST /users/:user/password
{
"password": "<new-password-here>"
}
POST /users/:user/spam
{}
POST /projects
{
"title": "<project-title-here>",
"description": "<project-description-here>",
"skills": ["array", "of", "skill", "ids", "here"],
"areas": ["array", "of", "area", "ids", "here"]
}
POST /projects/:project/spam
{
}
POST /projects/:project/liking
{
"like": true // or false
}
POST /requests/:request
{
"from": "<from-username-here>",
"pid": "<pid-of-the-project-where-request-was-made>",
"accept": true // or false
}
POST /chats/:chat/messages
{
"message": "<the-sent-message-goes-here>"
}
You'd see that many of these are empty, that's because the data needed is already provided from the url or the session. Using this the client(our app) and server will communicate, and appropriate actions will be taken.
Currently there is inconsistency, some are using tabs, some spaces. This was introduced by using eclipse and vim together. Eclipse used tabs, and vim, spaces.
All of our data in the database has to be exposed via a REST API.
Done | Endpoint | Description | Assignee |
---|---|---|---|
POST /auth/login |
Should login the given user | ||
POST /auth/logout |
Should logout the current user | ||
POST /auth/register |
Should register the new user | ||
POST /users/:user/forgot-password |
Should send user an email with a password reset link | ||
POST /users/:user/password |
Should change the password to new password | ||
GET /users/:user/feed |
Should get the current user's feed | ||
GET /users/:user/notifications |
Should get the current user's notifications | ||
GET /users/:user/chats |
Should return a list of groups user is part of | ||
GET /me |
Should return information of current user | ||
GET /users/:user |
Should return information of given user | ||
POST /users/:user/spam |
Report given user as spam | ||
GET /projects/:project |
Should return information of given project | ||
POST /projects |
Should create a new project for the currently authenticated user | ||
POST /projects/:project/spam |
Report given project as spam | ||
POST /projects/:project/liking |
Like/Dislike a project | ||
POST /projects/:project/request |
Create a request to be added to a project | ||
POST /requests/:request |
accept/reject a particular request | ||
GET /chats/:chat/messages |
return a list of messages | ||
POST /chats/:chat/messages |
send a message to a given chat room. | ||
GET /skills |
return a list of skills | ||
GET /areas |
return a list of areas |
For example, if I were to create the /me
endpoint, then here's how I'd go about implementing it:
{
"username": "meetmangukiya",
"resume": "https://myrhy.me/resume",
"additional_links": ["https://myrhy.me", "https://myrhy.me/blog", "https://github.com/meetmangukiya"],
"skills": ["HTML5", "CSS3", "Python3", "Java8", "NodeJS"],
"ideas": [...],
"part_of_projects": [...]
}
Currently the passwords are stored as-is which is a security flaw.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.