This repository creates an API and contains models created using mongoose and mongoDB and shows how CRUD operations can be performed using an ODM. The code simulates the backend of a social media web application that allows users to be created, viewed, and able to add eachother with thoughts and reactions to thoughts.
To install necessary dependencies, run the following commands (assuming you are on git bash and already have node.js/nodemon installed):
- Clone the repository where you want to save the code:
git clone [HTTPS/SSH/CLI link]
- Navigate over to files cloned in the terminal.
- Type in terminal to install necessary package dependencies:
npm i
- Run any the following commands on your terminal to get a server up and running at the root of the repository:
node index.js / nodemon index.js / npm start
- Run a popular REST client (such as insomnia) to interact with the API and test its API functionality.
This program can be used to observe how js can tie in with noSql through using an ODM framework such as Mongoose. Users can also learn and understand how it ties in with express framework as well as how everything connects in general backend coding with javascript. This program can be used to test and observe how ODM's connect with routes using a modular controller/route approach to the file structure.
node.js, NoSql, mongoDB Compass, Mongoose, Express, Insomnia
Here is a video recording of the program execution: