Motivation:
- We learned how to use a non sql database, like mongoDB.
Why this project was created:
-
This challenge was created to understand better hhow to interact with MongoDB and mongoose!
-
Details
USER STORY
AS A social media startup
I WANT an API for my social network that uses a NoSQL database
SO THAT my website can handle large amounts of unstructured data
ACCEPTANCE CRITERIA
GIVEN a social network API
WHEN I enter the command to invoke the application
THEN my server is started and the Mongoose models are synced to the MongoDB database
WHEN I open API GET routes in Insomnia for users and thoughts
THEN the data for each of these routes is displayed in a formatted JSON
WHEN I test API POST, PUT, and DELETE routes in Insomnia
THEN I am able to successfully create, update, and delete users and thoughts in my database
WHEN I test API POST and DELETE routes in Insomnia
THEN I am able to successfully create and delete reactions to thoughts and add and remove friends to a user’s friend list
What we learned / used:
DATABASE
dotenv
Connection
MongoDB
mongoose
MODELS
mongoose
NodeJS
ROUTES
Express
Express Routes
Sequalize
findAll
findOne
Create
Update
Destroy
To run the project in your local machine:
- Open visual studio in your computer or laptop
- Clone the git project: https://github.com/lilianpatinoortiz/Mongo-collection-documents
- Pull the latest from the 'main' branch
- Open a new terminal and type
npm install
to install the dependencies - Run the following commands in this order:
npm run seed
- Locate the server file and locate yourself there
- Open a new terminal and type
npm run start
Please use insomnia to test the apis! Here is the link to the recoording video: https://drive.google.com/file/d/10S_0lBoknqP6KDh55_I4BPE_CwlMyb4h/view?usp=share_link
This challenge does not contain specific test files, but below you can find a gif with the flow of the challenge functioning correctly.
If you want to contribute on this project please contact me directly via email lilly.0608@gmail.com. Happy coding!
The main resources used:
- Module 18 information provided in canva
- Screencastify for video recording
- Mongoose: https://mongoosejs.com/docs/
Please refer to the license badge, on top of this file.
Any question, please feel free to contact me directly via email lilly.0608@gmail.com or via https://github.com/lilianpatinoortiz