Social-Networking-API

Social Networking API 💬

Badge image

Description


RESTful API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. This project was built using Express, MongoDB, and Mongoose. Also tested using Mocha and seeded using Postman. The API is designed to be scalable and flexible, allowing for easy integration with other applications.

Table of Contents


Installation


To install Social-Networking-API, follow these guidelines.

  1. Clone the repository into your local machine using git.
git clone https://github.com/Ccooper9893/Social-Networking-API.git
  1. Install the required dependencies by navigating to the project directory and running the following command:
npm install

Features


All endpoints adhere to the principles of RESTful architecture and use standard HTTP methods (POST, GET, PUT, DELETE) to perform the respective actions. The API returns responses in JSON format, making it easy to parse and integrate into different applications.

User Management

  • Create, update, and delete new or exisiting users.

Friend Management

  • Add or remove friends from an exisiting user’s friend’s list.

Thought Management

  • Create, update, and delete thoughts for individual users.

Reaction Management

  • Create and delete reactions to individual user thoughts.

Usage


To use this RESTful API, you must have MongoDB and Node.js installed on your local machine. You will also need an API testing tool such as Insomnia or Postman. Be sure to follow the installation guidelines before proceeding. Once installation is complete, follow these steps to access the features.

  1. Create a .env file to store your local MongoDB database credentials. Make sure your URL looks like the following:
DB_URL = 'mongodb://127.0.0.1:27017/socialnetworkDB'
  1. Start the server by running the following command:
npm start
  1. For testing using Mocha, run the following command in your terminal.
npm run test

Example of API response

Postman collection of HTTP requestsScreenshot of passing tests.

Software


This project was built using the following software:

  • Node.js – a JavaScript runtime built on Chrome’s V8 JavaScript engine
  • Visual Studio Code – a lightweight code editor with robust features for web development
  • Postman – a popular API development tool that allows you to test, document, and share your APIs
  • Express.js – a fast, minimalist web framework for Node.js
  • Mocha – a feature-rich JavaScript test framework running on Node.js
  • dotenv – a zero-dependency module that loads environment variables from a .env file
  • moment.js – a JavaScript library that helps you parse, validate, manipulate, and display dates and times
  • validator – a library of string validators and sanitizers for Node.js
  • MongoDB – a popular NoSQL database program that stores data in JSON-like documents

License


This application is covered under the MIT license.

For more information about this license please visit https://opensource.org/licenses/MIT

Questions


For comments/concerns please contact me at https://github.com/Ccooper9893

Github Repo: https://github.com/Ccooper9893/Social-Networking-API

Visit original content creator repository https://github.com/Ccooper9893/Social-Networking-API

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *