Code Monkey home page Code Monkey logo

backend's People

Contributors

meetmangukiya avatar

Watchers

 avatar

backend's Issues

Client payload/data structure

All the data will be posted from the client should be encoded as JSON.

For endpoints described here, this is the data format:

  1. POST /auth/login
{
  "username": "<username-here>",
  "password": "<password-here>"
}
  1. POST /auth/logout
{}
  1. 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"]
}
  1. POST /users/:user/forgot-password
{}
  1. POST /users/:user/password
{
  "password": "<new-password-here>"
}
  1. POST /users/:user/spam
{}
  1. POST /projects
{
  "title": "<project-title-here>",
  "description": "<project-description-here>",
  "skills": ["array", "of", "skill", "ids", "here"],
  "areas": ["array", "of", "area", "ids", "here"]
}
  1. POST /projects/:project/spam
{
}
  1. POST /projects/:project/liking
{
  "like": true // or false
}
  1. POST /requests/:request
{
  "from": "<from-username-here>",
  "pid": "<pid-of-the-project-where-request-was-made>",
  "accept": true // or false
}
  1. 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.

@tindevour

Normalize the tabs and spaces

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.

REST endpoints

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:

  1. Determine the current user from the session object. Use that username to get user information.
  2. The response should contain all the information that our UI needs to display. The response would look something like this.
{
  "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": [...] 
}

@tindevour

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.