- NoSQL Challenge: Social Network API
The purpose is to build an API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. This API uses Express.js for routing, a MongoDB database, and the Mongoose ODM.
- Clone the repository from GitHub
- Install
node.js
- Install
MongoDB
- Run
npm install
to install dependencies. Dependencies include Express.js for routing, a MongoDB database, and the Mongoose ODM. - Run
npm start
to start the web server and connect
AS A social media startup
I WANT an API for my social network that uses a NoSQL database
SO THAT my website can handle large amounts of unstructured data
GIVEN a social network API
WHEN I enter the command to invoke the application
THEN my server is started and the Mongoose models are synced to the MongoDB database
WHEN I open API GET routes in Insomnia for users and thoughts
THEN the data for each of these routes is displayed in a formatted JSON
WHEN I test API POST, PUT, and DELETE routes in Insomnia
THEN I am able to successfully create, update, and delete users and thoughts in my database
WHEN I test API POST and DELETE routes in Insomnia
THEN I am able to successfully create and delete reactions to thoughts and add and remove friends to a user’s friend list
Video walk-through of User Routes:
GET
all usersGET
a single user by its_id
POST
a new userPUT
to update a user by its_id
DELETE
to remove user by its_id
User.routes.mov
Video walk-through of Thoughts Routes:
GET
to get all thoughtsGET
to get a single thought by its_id
POST
to create a new thoughtPUT
to update a thought by its_id
DELETE
to remove a thought by its_id
Thoughts-Routes.mov
Video walk-through of Friends Routes:
POST
to add a new friend to a user's friend listDELETE
to remove a friend from a user's friend list
Friends-Routes.mov
Video walk-through of Reactions Routes:
POST
to create a reactionDELETE
to pull and remove a reaction