Skip to content

Gera1313/social-network

Repository files navigation

Social Network API

My Project

The project is to build an API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. I will use Express.js for routing, a MongoDB database, and the Mongoose ODM. In addition to using the Express.js and Mongoose packages, I use the Moment package to format timestamps.

I will create my own data using Insomnia after I have created my API.

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

Notes

April 25, 2024: Revisiting this project to finish it and fix all of the issues associated with it.

May 10, 2024: Finished code and it works.

Installations

To install this application you need to clone the code, open the code in your IDE. To run this application, enter the following in the terminal: npm install & npm start.

Usage

The following animations show examples of the application's API routes being tested in Insomnia.

The following animation shows GET routes to return all users and all thoughts being tested in Insomnia:

Demo of GET routes to return all users and all thoughts being tested in Insomnia.

The following animation shows GET routes to return a single user and a single thought being tested in Insomnia:

Demo that shows GET routes to return a single user and a single thought being tested in Insomnia.

The following animation shows the POST, PUT, and DELETE routes for users being tested in Insomnia:

Demo that shows the POST, PUT, and DELETE routes for users being tested in Insomnia.

The following animation shows the POST and DELETE routes for a user’s friend list being tested in Insomnia:

Demo that shows the POST and DELETE routes for a user’s friend list being tested in Insomnia.

Links

Repository

MongoDB installation guide on The Full-Stack Blog

Licenses

License: MIT