Skip to content

This repository contains the implementation of a social network API built with MongoDB, Express.js, and Mongoose ODM. This API allows users to share their thoughts, react to friends' thoughts, and create a friend list, providing a backend foundation for a social network web application.

License

Notifications You must be signed in to change notification settings

andrewhamerly/social-network-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network API MongoDB

This repository contains the implementation of a social network API built with MongoDB, Express.js, and Mongoose ODM. This API allows users to share their thoughts, react to friends' thoughts, and create a friend list, providing a backend foundation for a social network web application.

Table of Contents

Features

  • User Management: Create, update, and delete users.
  • Thought Management: Create, update, and delete thoughts posted by users.
  • Reaction Management: Add and remove reactions to thoughts.
  • Friend Management: Add and remove friends from a user's friend list.
  • NoSQL Database: Uses MongoDB for handling large amounts of unstructured data efficiently.

Installation

  1. Clone the Repository:

    git clone https://github.com/andrewhamerly/social-network-api.git
  2. Navigate to the project directory:

    cd social-network-api
  3. Install dependencies:

    npm install

Usage

  1. Start the application:

    npm start
  2. Testing the API routes: Use Insomnia or a similar API client to test the following routes:

    Users

    • GET /api/users Get all users.
    • POST /api/users Create a new user.
    • PUT /api/users/:userId Update a user by ID.
    • DELETE /api/users/:userId Delete a user by ID.
    • POST /api/users/:userId/friends/:friendId Add a friend to a user's friend list.
    • DELETE /api/users/:userId/friends/:friendId Remove a friend from a user's friend list.

    Thoughts

    • GET /api/thoughts Get all thoughts.
    • POST /api/thoughts Create a new thought.
    • PUT /api/thoughts/:thoughtId Update a thought by ID.
    • DELETE /api/thoughts/:thoughtId Delete a thought by ID.

    Reactions

    • POST /api/thoughts/:thoughtId/reactions Add a reaction to a thought.
    • DELETE /api/thoughts/:thoughtId/reactions/:reactionId Remove a reaction from a thought.

Walkthrough Video

Click here to watch the walkthrough video

Technologies Used

  • Express.js: For building the API routes and handling requests.
  • MongoDB: A NoSQL database chosen for its flexibility and performance with large datasets.
  • Mongoose: An ODM (Object Data Modeling) library for MongoDB and Node.js, used to define schemas and interact with the database.
  • Insomnia: Used for testing the API endpoints.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.

Questions

If you have any questions about the project, please feel free to contact me via email at [email protected]. You can also find more of my work on GitHub.

About

This repository contains the implementation of a social network API built with MongoDB, Express.js, and Mongoose ODM. This API allows users to share their thoughts, react to friends' thoughts, and create a friend list, providing a backend foundation for a social network web application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published