Skip to content

An API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. Express.js, MongoDB, Mongoose ODM

Notifications You must be signed in to change notification settings

grace-anderson/social-network-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network API

License: MIT

Description

The Social Network API is a social network application where users can be created, and users can share their thoughts, react to friends' thought, and create a friend list.

The application uses Express.js for routing, a MongoDB database used with Mongoose ODM, and Moment for formatting timestamps. Go to GitHub for the Social Network API code. The app is not deployed, so must be downloaded and run locally.

Table of Contents

Technologies Used

This application uses the following technologies:

Dependencies

Dev dependencies

Local deployment (suggested)

Usage

  • Access the Social Network API app via its Github repo
  • See this video for instructions on installing and running the Social Network API app. The video also includes a detailed demonstration of the app's functionality.

Functionality

The Social Network API provides the following API routes to create, update and delete users, friends, and posts.

/api/users

  • GET all users
  • GET a single user by its _id and populated thought and friend data
  • POST a new user
  • 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
  • GET to get a single thought by its _id
  • POST to create a new thought
  • 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 stored in a single thought's reactions array field
  • DELETE to pull and remove a reaction by the reaction's reactionId value

Installation

To install and run the Social Network API locally,

  • Download or clone the code from the Social Network API github repo

  • Install MongoDB

  • Install MongoDB Compass (if you are using Windows)

  • Open in your preferred terminal (e.g. Visual Studio Code's integrated terminal)

  • Navigate to the specified folders in order and run the following commands:

    • To install dependencies, in the root directory run :

      npm install

    • After installation, in the root directory, start the server by running:

      node index.js

  • No seed data is provided with the app, so after installing use a POST request to create a user (createUser). For instructions, see this video

Contribution Guidelines

  • Contributions are welcome.
  • The code is located in this GitHub repo
  • To contribute, open a new issue describing your proposed enhancement or fix.
    • Before contributing, browse through open issues to see if your issue already exists or if there is an issue or enhancement you could to solve.
    • If you're a newbie dev, start contributing by looking for issues labelled "good first issue"
  • It is good practice to set up your project repository as an "upstream" remote and synchronize with the project repository
    • Don't update the main branch. Rather create your own branch using a brief descriptive name and make your changes there
  • You can create pull requests, but only admins can review and merge.
    • Be nice to your reviewer by adding adding a plain English explanation of your pull request and how your updates addresses the issue/s or enhancements
  • Also see the GitHub Community Guidelines

Demo

See this video a detailed demonstration of the app's functionality.

License

© 2022 Helen Anderson

This project is licensed under the MIT License.

About

An API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list. Express.js, MongoDB, Mongoose ODM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published