Skip to content

An API for a social network web application where users can share thoughts, react and create a friend list. Express.js is used for routing. MongoDB is used for the database along with Mongoose ODM

License

victoriamcn/NoSQL-Social-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thought: NoSQL Social Network

Description

An API for a social network web application where users can share thoughts, react and create a friend list. Express.js is used for routing. MongoDB is used for the database along with Mongoose ODM

Table of Contents

User Story

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

Installation and Usage

  1. Clone this repository to your local computer.
  2. Open the repo in VS Code.
  3. Open the index.js file in the Integrated Terminal.
  4. Type the following in the command line: npm i
  5. Create your own .env file with the following content:
MONGODB_URI = '(mongodbconnection)/mydatabase'
  1. Replace the content between the single quotation marks ' ' in your MongoDB URL connection in the .env file.
  2. Type the following in the command line: node index.js
  3. Use Insomnia to test the application functionality. Below are all routes to test:
  • /api/users
    • GET all users
    • GET a single user by its _id
    • POST a new user (See example data for new user)
    • PUT to update a user by its _id
    • DELETE to remove a user by its _id
// example data for new user
{
  "username": "lernantino",
  "email": "[email protected]"
}
  • /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 (See example data for new thought)
    • PUT to update a thought by its _id
    • DELETE to remove a thought by its _id
// example data for new thought
{
  "thoughtText": "Here's a cool thought...",
  "username": "lernantino",
  "userId": "5edff358a0fcb779aa7b118b"
}
  • /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

Demo

Please see the demo on YouTube.

Contributing

License

MIT This project is licensed under MIT.

Credits

Georgia Tech Staff

My instructor, Saurav Khatiwada.

Example Code

Tutorials

Node Dependencies

Click links to read the documentation for each dependency:

Badges

Express.js GitHub Insomnia JavaScript MongoDB Mongoose NodeJS NPM Visual Studio Code

About

An API for a social network web application where users can share thoughts, react and create a friend list. Express.js is used for routing. MongoDB is used for the database along with Mongoose ODM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published