Git Product home page Git Product logo

social-network-api's Introduction

๐Ÿ‘จ๐Ÿฟโ€๐Ÿ’ป Social Network API ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿ’ป

License: MIT

Description

This social network API is a backend application using Node.js, Express, and MongoDB. It creates a database of users who can share thoughts, add friends, and react to other user's thoughts.

Table of Contents

Installation

  • To use this API you would need to clone the repository, and use it locally.

Using the API

  • Once you have the code locally, type "npm run start" to create a connection to the server. Use an API client to use the one of the following routes:

User Routes

โœ… GET - http://localhost:3001/api/users - Retrieves all users.

โ˜‘๏ธ POST - http://localhost:3001/api/users - Allows you to add a new user, using the following format for the request:

sna-post-user-cropped

NOTE: Usernames will be converted to lowercase and all spaces will be removed.

โœ… GET - http://localhost:3001/api/users/:id - Retrieves a single user, using the _id property from the database.

โ˜‘๏ธ PUT - http://localhost:3001/api/users/:id - Updates a current user, using the following format for the request:

sna-update-user-cropped

โŒ DELETE - http://localhost:3001/api/users/:id - Removes a user from the database.

NOTE: Removing a user will also remove any thoughts by that user.

Friends

โ˜‘๏ธ POST - http://localhost:3001/api/users/:id/friends/:friendId - Adds a friend to the selected user. No JSON is needed for this request. The user's id and the friend's id will be pulled from the url.

โŒ DELETE - http://localhost:3001/api/users/:id/friends/:friendId - Removes a friend from the user's list.

NOTE: Adding a friend to a user's list will NOT automatically add the user to the friend's list. Likewise, removing a friend from a user's list will NOT automatically remove the user from the friend's list.

Thought Routes

โœ… GET - http://localhost:3001/api/thoughts - Retrieves all thoughts.

โ˜‘๏ธ POST - http://localhost:3001/api/thoughts - Adds a new thought to the database, using the following format for the request:

sna-post-thought-cropped

NOTE: All thoughts and reactions are restricted to a 280 character maximum.

โœ… GET - http://localhost:3001/api/thoughts/:thoughtId - Retrieves a single thought.

โ˜‘๏ธ PUT - http://localhost:3001/api/thoughts/:thoughtId - Updates a thought, using the following format for the request: sna-update-thought-cropped

โŒ DELETE - http://localhost:3001/api/thoughts/:thoughtId - Removes a thought from the database.

Reactions

โ˜‘๏ธ POST - http://localhost:3001/api/thoughts/:thoughtId/reactions - Adds a new reaction to the thought referenced in the url, using the following format:

sna-post-reaction-cropped

โŒ DELETE - http://localhost:3001/api/thoughts/thoughtId/reactions/:reactionId - Removes a reaction from the thought referenced in the url.

Video Walkthrough ๐ŸŽฅ

Here is a link to the walkthrough video of the application.

License

Contributing

  • Contributions are welcome. Please create an independent branch and go through the customary and polite channels to initiate collaboration.

Questions

social-network-api's People

Contributors

chadbowler avatar

Watchers

 avatar

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.