Giter Club home page Giter Club logo

mern's Introduction

MERN

A full stack application developed with backend Mongodb, node.js and frontend with React, Redux etc

TODO

@: Add logout correlate action/type to remove user and its token; @: Dynamically show login, signin, logout in the NavBar

Models

User(schema): https://github.com/qm994/MERN/blob/master/models/User.js#L3

Profile(schema): https://github.com/qm994/MERN/blob/master/models/Profile.js#L3

Post(schema): https://github.com/qm994/MERN/blob/master/models/Post.js#L5

Backend API

user

(1) api/user: POST(register a new user, return a new token) { "name", "email", "password" }

auth

(1) api/auth: POST(create a new token for the existing user, return a new token) { "eamil", "password" }

(2) api/auth: GET(get the user information, return all the fields in a user document except password)

header: { x-auth-token: }

profile

(1) api/profile/me: GET(get the auth user's profile, return all the profile fields)

header: { x-auth-token: }

(2) api/profile: POST(update/create a user's profile except education & experience fields)

header: { x-auth-token: }

(3) api/profile: GET(get all the users profile)

(4) api/profile/user?user_id=<user_id>: GET(get the profile for a user)

params: { user_id }

(5) api/profile: DELETE(delete the user and profile)

header: { x-auth-token: }

(6) api/profile/experience: PUT(create the auth user's experience in his profile)

header: { x-auth-token: }

(7) api/profile/experience/:exp_id: DELETE(delete a user's specific experience)

header: { x-auth-token: }

(8) api/profile/education: PUT(create the auth user's education in his profile)

header: { x-auth-token: }

(9) api/profile/education/:edu_id: DELETE(delete a user's specific education)

header: { x-auth-token: }

(10) api/profile/github/:username: GET(get a user's github repo information)

post

(1) api/posts: PUT(create a post)

header: { x-auth-token: }

body: { 'text': String }

(2) api/posts: GET(get all the posts)

header: { x-auth-token: }

(3) api/posts/:id: GET(get the post by ID)

header: { x-auth-token: }

(4) api/posts/:id: DELETE(delete the post by ID)

header: { x-auth-token: }

(5) api/posts/like/:id: PUT(like a post):

header: { x-auth-token: }

(6) api/posts/unlike/:id: PUT(unlike a post):

header: { x-auth-token: }

(7) api/posts/comment/:id: POST(add a comment to the post)

header: { x-auth-token: }

body: { 'text': String }

(8) api/posts/comment/:id: DELETE(delete a comment)

header: { x-auth-token: }

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.