Skip to content

This is an API for a social network application where users can share their thoughts/comments, add to a friends list, remove friend(s), and react to friends thoughts.

Notifications You must be signed in to change notification settings

xiaojing168jmg168/social-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network👋

Badges

badge

Description

🔍 This is an API for a social network application where users can share their thoughts/comments, add to a friends list, remove friend(s), and react to friends thoughts. It uses Express.js for routing, a MongoDB database, the Mongoose ODM, and moment.js to format timestamps. The seed data is created using Insomnia. To see how the API works using Insomnia, the below link is the walk-through demonstration videos: https://drive.google.com/file/d/1DhH9WTA51WXPyug_9IyxcF9DA6l_bER0/view?usp=share_link

social-1.mp4

On the left side below screenshot, you can see the GET POST PUT DELETE routes for Users, Thoughts, Friends, Reactions. screenshot

Table of Contents

Installation

  1. Clone the repository to use the application on a local machine
  2. Node.js and MongoDB is required to run the application.
  3. To install necessary dependencies, run the following command: npm i

usage

💻

  1. After following the installation instructions, run npm start to start the server.
  2. When the server is started, the MongoDb models are synched to the MongoDB database.
  3. Open MongoDB and connect to the MongoDB URI mongodb://localhost:27017. On the list of databases, click on socialDB to see user and thoughts data.
  4. Go to Insomnia through localhost to create seed data and test the API routes, also see the tests section below.

Technologies 🔧

Contributor

👥 Xiaojing Deng

License

badge

Permission to use this application is granted under the MIT license.

MIT

Tests

Insomnia is used to test API calls. Please see the walk-through demonstration video:
https://drive.google.com/file/d/1DhH9WTA51WXPyug_9IyxcF9DA6l_bER0/view?usp=share_link.

On Insomnia, the following API routes have been created:

USER

  • Create a new user: POST /api/users

  • Get all users: GET /api/users

  • Get a single user by id: GET /api/users/:userId

  • Update a user by id: PUT /api/users/:userId

  • Delete a user by id: DELETE /api/user/:userId

FRIEND

  • Add a new friend to a user's friend list: POST /api/users/:userid/friends/:friendId
  • Delete a friend from a user's friend list: DELETE /api/users/:userid/friends/:friendId

THOUGHT

  • Create a new thought: POST /api/thoughts/
  • Get all thoughts: GET /api/thoughts/
  • Get a single thought by id: GET /api/thoughts/:thoughtId
  • Update a thought by id: PUT /api/thoughts/:thoughtId
  • Delete a thought by id: DELETE /api/thoughts/:thoughtId

REACTION

  • Create a reaction: POST /api/thoughts/:thoughtId/reactions
  • Delete a reaction by the reactionId: DEL /api/thoughts/:thoughtId/reactions/:reactionId

Questions

✋Reach me here:
:octocat: Find me on GitHub: xiaojing168jmg168
📩 Email me with any questions: 8redfishcreative@gmail.com

About

This is an API for a social network application where users can share their thoughts/comments, add to a friends list, remove friend(s), and react to friends thoughts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published