Giter Site home page Giter Site logo

dymoy / nosql-social-network Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.29 MB

The goal of this 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.

Home Page: https://drive.google.com/file/d/1FRWig8H5I-Dkgp3k34m1gHoTL_cg_Xg5/view?pli=1

License: MIT License

JavaScript 100.00%
expressjs mongodb mongodb-atlas mongoosejs

nosql-social-network's Introduction

NoSql Social Network API

License

Description

MongoDB is a popular choice for many social networks due to its speed with large amounts of data and flexibility with unstructured data. The goal of this project is to build an API for a social network web application where users can share their thoughts, react to users' thoughts, and create a friend list.

This application utilizes Express.js for routing, a MongoDB database, and the Mongoose ODM.

Table of Contents

Walkthrough Video

Click on the following link to view a walkthrough video that highlights the usage of the application: NoSql Social Network API

Installation

Refer to the documentation in the MongoDB website for guidance on installing and setting up MongoDB.

Use the following steps to run the application locally:

  1. Clone this repository to your local machine. (For reference, visit the Cloning a Repository GitHub Docs article.)
  2. Run npm i in your CLI to download the npm package dependencies.
  3. Optional: Run npm run seed to seed the database with the provided seed data.
  4. Run npm run start to sync the Mongoose models to the MongoDB database and start the server.

Dependencies

This project requires the following npm package dependencies:

  1. dayjs
  2. express
  3. jest
  4. mongoose

Usage

User API Routes

The animation gif below shows the responses for the User API routes.
Animation Gif of User API Routes

Supported API:

  • getUsers: returns all the existing User documents in the collection
  • getUserById: returns a single User document by id
  • createUser: creates an instance of the User model using the data in req.body
  • updateUser: updates an existing User with the req.body
  • deleteUser: deletes an existing User from the collection and deletes their associated Thoughts
  • addFriend: add a new friend to a user's friend list
  • deleteFriend: remove a friend from a user's friend list

Thought API Routes

The animation gif below shows the responses for the Thought API routes.
Animation Gif of Thought API Routes

Supported API:

  • getThoughts: returns all existing Thought documents in the collection
  • getThoughtById: returns a single Thought document by id
  • createThought: creates an instance of the Thought model using the data in req.body
  • updateThought: updates an existing Thought with the req.body
  • deleteThought: deletes an existing Thought from the collection
  • addReaction: creates an instance of the Reaction schema to the associated Thought
  • deleteReaction: deletes an existing reaction subdocument from the associated Thought

Testing

A testing suite was written with jest for the helper function format_date. You may execute the test suite by running npm run test on the CLI.
The API routes were tested locally during development with the Insomnia development platform.
Please refer to the Installation section if you are interested in running and testing the application locally.

Contributing

To make contributions to this project:

  1. Fork the repository
  2. Make some commits to improve the application
  3. Open a Pull Request on GitHub
  4. From there, we can discuss your changes and merge the pull request once your contributions have been approved!

License

This GitHub repository is licensed under the MIT license. Please refer to the license documentation here.

Questions

This project was developed by dymoy.
For any related questions, please contact me via email at [email protected].

nosql-social-network's People

Contributors

dymoy avatar

Watchers

 avatar

nosql-social-network's Issues

Opening API GET routes displays the data in formatted JSON

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 open API GET routes in Insomnia for users and thoughts
THEN the data for each of these routes is displayed in a formatted JSON

API routes successfully Create, Update, and Delete users and thoughts in MongoDB

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 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.