This repo is the backend for a social network type application. It utilises MongoDB as the database and has function routes to create, update, delete, and get users, and their thoughts, and add and remove reactions to thoughts and friendships.
This project uses JavaScript, NodeJS, ExpressJS and Mongoose as the ODM.
Clone this repo on your local machine using
git clone https://github.com/kbario/mongoose-social-network-api.git
Seed the database with randomly generated data using Chance.js and start the server on your local machine using:
node seed/seed.js
node server.js
Open your favourite api route testing software (i am using Insomnia) and utilise the routes
- /api/users (GET and POST) to get and create users
- /api/users/:userId (GET, PUT, DELETE) to get, update and delete individual users
- /api/users/userId/friends/friendId (POST and DELETE) to add and remove friends
- /api/thoughts (GET and POST) to read all thoughts and create new ones
- /api/thoughts/:thoughtId/ (GET, PUT and DELETE) to get, update and delete thoughts
- /api/thoughts/:thoughtId/reactions (POST) to create a reaction to a thought, and
- /api/thoughts/:thoughtId/reaction/:reactionId (DELETE) to delete reactions
Watch me use the routes here
All contributions to mongoose-social-network-api are greatly appreciated and contributing is one of the many amazing things about open-source software.
To contribute to mongoose-social-network-api, all we ask is that you're empathic and supportive towards other developers and follow the standard contribution guidelines. Click the banner below for more information.
If you have any questions, feel free to contact me through my GitHub or Email me.
Below is a list of links to third-party assets that were used to create this project.
- https://mongoosejs.com/
- https://www.mongodb.com/
- https://expressjs.com/
- https://nodejs.dev/
- https://chancejs.com/
Licensed under the MIT license.
This README was created with Gener8aREADME.