Skip to content

a social media application that allows users to meet like minded people and share ideas

Notifications You must be signed in to change notification settings

pbnj1/Share-your-thoughts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Share your thoughts!

License: MIT

About This Application

This is a social networking application that allows users to come together and share their thoughts, generate reactions to each others thoughts and make friends. You can edit your friends connections, thoughts, and reactions at any time.

Technologies Needed

Express.js

Node.js

MongoDB

Mongoose

How To Use This Application

You can download or clone the code.

Once that is done you will need to indstall the dependencies with "npm" i in the command line.

You can proceed through the different routes listed in the example video and edit the users as needed.

API Routes

/api/users

  • GET all users

  • GET a single user by its _id and populated thought and friend data

  • POST a new user:

// example data
{
  "username": "lernantino",
  "email": "lernantino@gmail.com"
}
  • 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 (don't forget to push the created thought's _id to the associated user's thoughts array field)

// example data
{
  "thoughtText": "Here's a cool thought...",
  "username": "lernantino",
  "userId": "5edff358a0fcb779aa7b118b"
}
  • 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

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

Acceptance Criteria

GIVEN a social network API
WHEN I enter the command to invoke the application
THEN my server is started and the Mongoose models are synced to the MongoDB database
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
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
WHEN I test API POST and DELETE routes in Insomnia
THEN I am able to successfully create and delete reactions to thoughts and add and remove friends to a user’s friend list

A Video Demonstration of the Application

https://drive.google.com/file/d/1VZYYJW3GQVexdinBktXXbu3KK_4E4n2m/view?usp=sharing

License 📜

License: MIT MIT License Copyright (c) 2022 Sienna Li Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

a social media application that allows users to meet like minded people and share ideas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published