API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. 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.
- Download or clone repository to use this application on local machine.
Node.js
andMongoDB
is required to run the application- To install necessary dependencies, navigate to the root directory and run the following command:
npm install
- After installation, run
npm start
. - When the server is started, the Mongoose models are synched to the MongoDB database.
- Open MongoDB and connect to the MongoDB URI
mongodb://localhost:27017
. On the list of databases, selectsocialnetDB
to seethoughts
andusers
data. - To create seed data and test the API routes, use Insomnia.
USER
GET
All Users route: http://localhost:3001/api/usersGET
User by Id: http://localhost:3001/api/users/:userIdPOST
Create User route: http://localhost:3001/api/usersPUT
Update User by Id route: http://localhost:3001/api/users/:userIdDELETE
Delete User by Id route: http://localhost:3001/api/users/:userId
FRIENDS
POST
Add friend to user's friend list: http://localhost:3001/api/users/:userId/friends/friendIdDELETE
Remove friend from a user's friend list: http://localhost:3001/api/users/:userId/friends/friendId
THOUGHTS
GET
All Thoughts: http://localhost:3001/api/thoughtsGET
Thought by Id: http://localhost:3001/api/thoughts/:thoughtIdPOST
Create Thought: http://localhost:3001/api/thoughtPUT
Update Thought by Id: http://localhost:3001/api/thoughts/:thoughtIdDELETE
Delete Thought by Id: http://localhost:3001/api/thoughts/:thoughtId
REACTIONS
POST
Create Reaction: http://localhost:3001/api/thoughts/:thoughtId/reactionsDELETE
Remove Reaction: http://localhost:3001/api/thoughts/:thoughtId/reactions/:reactionId
The application is covered under the following license: ISC
For the moment this project does not accept contributions from third parties. Thank you for your interest.
This application was built with:
Please feel free to contact me using the following links: