Social Network API
Social Network API using Express.js for routing, a MongoDB database, and the Mongoose ODM.
Table of Contents
Descriptions
This project is about Social Networking where user can share their thoughts, react to friends' thoughts, and create a friend list. It is important as a web developer to have a good understanding of the connection between the database and the API.
Installations
This project required the following installations.
MongoDB is a document-oriented NoSQL database used for high volume data storage.(https://www.guru99.com/what-is-mongodb.html)
To install MongoDB please follow this link https://www.mongodb.com/docs/manual/administration/install-community/.
For routing.
npm install express
To connect to a MongoDB database.
npm install mongoose --save
For time formatting in timestamp.
npm install moment --save
To invoke the application
npm i
To start the server
nodemon
Testing
After all the routes are created the Insomnia app is used for testing the REST APIs. The APIs are grouped into two which are Thoughts and Users.
In the Thought routes we can do the CRUD operations for thoughts as well as creating and deleting reaction which is part of the Thoughts database.
The User routes is similar to the Thought routes with the CRUD operation. Friend can be added and deleted via User routes.
Thoughts Routes
- GET: Get Thoughts
- GET: Get Thought By Id
- POST: Create Thought
- POST: Create Reaction
- PUT: Update Thought
- DELETE: Delete Thought
- DELETE: Delete Reaction
Users Routes
- GET: Get Users
- GET: Get User By Id
- POST: Create User
- POST: Add Friend
- PUT: Update User
- DELETE: Delete User
- DELETE: Delete Friend
Tech Use
- Node.js
- Express.js
- Nodemon
- JavaScript
- MongoDB
- Mongoose
- Moment.js
- Insomnia REST Client
Contributions
- Mr.Anthony Cooper
- Slack Support Team