Giter Club home page Giter Club logo

social-network-api-1's Introduction

Social-Network-API


Table of Contents:

1. Description
2. Acceptance Criteria
3. Walkthrough Videos
4. Installation
5. Tests
6. License Details
7. Submission
8. Questions

Description:

This is a set of API for a social network that uses a MongoDB database so that the website can handle large amounts of unstructured data, Express.js for routing, Mongoose ODM, and the moment package to format time stamps.

Acceptance Criteria:

  • When you enter the command to invoke the application then the server is started and the Mongoose models are synced to the MongoDB database.

  • Testing API GET routes in Insomnia Core for users and thoughts return the data for each of these routes in a formatted JSON

  • Testing API POST, PUT, and DELETE routes in Insomnia Core are able to successfully create, update, and delete users and thoughts

  • Testing API POST and DELETE routes in Insomnia Core are able to successfully create and delete reactions to thoughts and add and remove friends to a user’s friend list.

Walkthrough Videos

User Routes
Friend Routes
Thought Routes
Reaction Routes

Installation:

This repo is not to be deployed, if you wanted to, you could by doing the following:

  1. Download the repo files from the link below
  2. You must have mongoDB installed
  3. Run the following at the command line
    - npm init -y
    - npm install express
    - npm install mongoose
    - npm install moment
  1. Start the server
    $ npm start
  1. Open Insomnia Core to test API routes

Tests:

Testing restful API calls with Insomnia Core


/api/users

  • GET all users
  • POST a new user:
    // example data
    {
        "username": "lernantino",
        "email": "[email protected]"
    }

/api/users/:userid

  • GET a single user by its _id
  • PUT to update a user by its _id
  • DELETE to remove user by its _id

/api/users/:userId/friends/:friendId

  • POST to add a new friend to a user's friend list
  • DELETE to remove a friend from a user's friend list

/api/thoughts

  • GET to get all thoughts
  • POST to create a new thought
    // example data
    {
    "thoughtText": "Here's a cool thought...",
    "username": "lernantino",
    "userId": "5edff358a0fcb779aa7b118b"
    }

/api/thoughts/:thoughtId

  • GET to get a single thought by its _id
  • PUT to update a thought by its _id
  • DELETE to remove a thought by its _id

/api/thoughts/:thoughtId/reactions

  • POST to create a reaction
    // example data
    {
    "reactionBody":"Hell Yeah!!",
    "username":"lernantino"
    }

/api/thoughts/:thoughtId/reactions/:reactionId

  • DELETE remove a reaction by the reactionId

License Details:

This project is under no license.

Submission:

Github repository

Questions:

Here is a link to my github:
https://github.com/civ187
Email me at:
[email protected]
for additional questions

social-network-api-1's People

Contributors

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