Module 18 - NoSQL Challenge: Social Network API
A social network API built with Node.js, Express, MongoDB and Mongoose.Users can share their thoughts, react to friends’ thoughts, and create a friend list..
To see how the API works using Insomnia, see the walk-through demonstration video here: Link to video Demo ➡️
This API allows users to share thoughts, react to friends' thoughts, and create a friend list. It uses a non-relational MongoDB database and Mongoose ODM to model the data.
- 👥 Sign up and login to your user account (username, email, and password)
- 🤝 Add and remove friend relationships between users
- 💭 Create, update, get, and delete thoughts
- 👍 Create and delete reactions to thoughts
- 🛣 Uses Mongoose models and controllers for RESTful API structure
To use this API first, you'll need to have Node.js installed on your computer. Once you have Node.js set up, you can follow these steps to install and use the application:
- Clone this GitHub repository to your local machine.
git clone https://github.com/CypherNyx/social-mind-reader.git
- Open a terminal or command prompt and navigate to the cloned repository's directory.
- Run the install command in your terminal
npm install
- After installing all necessary dependencies, Start your server by running this command on your terminal:
npm start
- The server will start on port 3001. Routes can be tested in a Insomnia, Postman or the REST client of your choice.
The following API CRUD routes have been created to find, create, update, or delete users, friends, thoughts, and reactions in the user's database.
/api/users
- 👥 Find all users:
GET /api/users
- 🆕 Create new user:
POST /api/users
- 🔎 Find user by Id:
GET /api/users/:userId
- ✏️ Update user by Id:
PUT /api/users/:userId
- 🗑 Delete user by Id:
DELETE /api/users/:userId
- 🤝 Add a friend:
POST /api/users/:userId/friends/:friendId
- 👋 Delete a friend:
DELETE /api/users/:userId/friends/:friendId
/api/thoughts
- 💬 Find all thoughts:
GET /api/thoughts
- 🆕 Create new thought:
POST /api/thoughts
- 🔎 Find thought by Id:
GET /api/thoughts/:thoughtId
- ✏️ Update thought by Id:
PUT /api/thoughts/:thoughtId
- 🗑 Delete a thought by Id:
DELETE /api/thoughts/:thoughtId
/api/reactions
- 👍 Add a reaction:
POST /api/thoughts/:thoughtId/reactions
- 🗑 Delete a reaction:
DELETE /api/thoughts/:thoughtId/reactions/:reactionId
- JavaScript
- Node.js
- Express.js
- MongoDB
- Mongoose ODM
Pull requests are welcome. Please open an issue first to discuss any proposed changes or additions.
https://opensource.org/licenses/MIT
This project is open source and available under the MIT License.
GitHub CypherNyx
Email: dguido.dev@gmail.com