The purpose of this project was to utilize mongoDB, mongoose, and Express.js to create a social network where the user can add/remove friends, thoughts, and reactions. Using insomnia, you are able to fetch information from the mongo database. In addition, moment.js was used in order to format the date in a more human-friendly manner. Enjoy!
- Description.
- User Story.
- Acceptance Criteria.
- Installation.
- License.
- Contributing.
- Tests.
- Questions.
- Video.
- Screenshots.
- Links.
- Resources/Credit.
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
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
- Clone the repository using:
git clone https://github.com/laurelthorburn/Social-Network-API.git
- Ensure you are in the current working directory
- Install dependencies by opening the terminal (ctrl + j on windows) and running:
npm install || npm i
- Run the project by typing the following in the terminal:
npm run start || npm run dev (if nodemon is installed)
Copyright <2021>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Fork the repo!
- Create a feature branch:
git checkout -b yourname-branch
- Commit changes:
git commit -m 'Your changes here'
- Push to the branch:
git push origin yourname-branch
- Submit a pull request and wait for it to be approved or denied.
No tests at this time
Want to see more of my work? Click here!
Questions/comments/concerns? Please send an email to [email protected]
View video: https://drive.google.com/file/d/15jGrsoLFN71YA05zIln0W4iWwZNylVyL/view?usp=sharing
Github Site: https://github.com/laurelthorburn/Social-Network-API
- https://stackoverflow.com/questions/18022365/mongoose-validate-email-syntax
- https://stackoverflow.com/questions/24964914/can-a-mongo-model-self-reference
- https://stackoverflow.com/questions/24557580/how-to-return-the-objectid-or-id-of-an-document-in-mongodb-and-error-in-need
- https://stackoverflow.com/questions/50602037/difference-between-findoneanddelete-and-findoneandremove