Skip to content

This is a social network API with CRUD functionality, which allows users to add or delete friends, post thoughts, and react to posts.

License

Notifications You must be signed in to change notification settings

RuxinQu/social-network-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

social-network-api

Node Mongoose Luxon MIT license badge

Description

This project is an CRUD api. It uses MongoDB database and mongoose as the ODM(Object Document Mapping). Routes are built with Express. Luxon library is used to parse and format time. There're two models: Thought and User. The reaction documents are embedded in thought documents. Users documents connect with thought documents by references.

View the demo video of this project HERE.

Table of Contents

Installation

  1. Run git@github.com:RuxinQu/social-network-api.git on the terminal to git clone the repo.
  2. Then run npm install to download all the packages.

Usage

  1. Run npm start to start the server.
  2. Routes:

/api/users

  • GET all users
  • GET a single user by its _id and populated thought and friend data
  • POST a new user:
  • PUT to update a user by its _id
  • DELETE to remove user by its _id

/api/users/:userId/friends/:friendId

  • POST to add a new friend to a user's friend list
  • DELETE to remove a friend from a user's friend list

/api/thoughts

  • GET to get all thoughts
  • GET to get a single thought by its _id
  • POST to create a new thought (don't forget to push the created thought's _id to the associated user's thoughts array field)
  • PUT to update a thought by its _id
  • DELETE to remove a thought by its _id

/api/thoughts/:thoughtId/reactions

  • POST to create a reaction stored in a single thought's reactions array field
  • DELETE to pull and remove a reaction by the reaction's reactionId value

Here is a screenshot:

Screenshot 2022-12-21 at 6 42 40 PM

License

This project is under MIT license

https://opensource.org/licenses/MIT

Technologies Used

Question

Contact me via: ruxinqu@gmail.com if you have addition questions.

About

This is a social network API with CRUD functionality, which allows users to add or delete friends, post thoughts, and react to posts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published