Friendface is an API for a social network web application where users can share their thoughts, react to friends' thoughts, and create a friend list. The backend application uses Express.js for routing, a MongoDB database, and the Mongoose ODM. Additionally, Moment.js is used to format dates and Faker-js is used to seed mock users and thoughts in the database.
- Check if you have Node.js installed by typing
node -v
in your command line. If node is not installed, visit the Node.js website to install. - Next, clone this project repository to your computer.
- Use the command
npm i
to install dependencies. - Seed database with random mock data via Faker-js using command
npm run seed
.
- Start server with command
npm start
. - Alternatively, start server with Nodemon (and restart server automatically when making changes to code) with command
npm run dev
. - Access API routes with Insomnia, Postman, or other REST API testing client.
Watch a video demonstrating get, post, push, and delete routes for User and Thought models:
friendface.mp4
GET AND DELETE ROUTES
User | URL | Thought | URL |
---|---|---|---|
Get All Users | /api/users | Get All Thoughts | /api/thoughts |
Get Single User | /api/users/:userId | Get Single Thought | /api/users/:thoughtId |
Delete User | /api/users/:userId | Delete Thought | /api/users/:thoughtId |
Delete Friend | /api/users/:userId/friends/:friendId | Delete Reaction | /api/users/:thoughtId/reactions/:reactionId |
POST AND PUSH ROUTES
URL | JSON | |
---|---|---|
Create User | /api/users | { "username": "example", "email": "[email protected]" } |
Update User | /api/users/:userId | { "username": "example", "email": "[email protected]" } |
Add Friend | /api/users/:userId/friends/:friendId | |
Create Thought | /api/thoughts | { "thoughtText": "Lorem Ipsum", "username": "example", "userId": "123" } |
Update Thought | /api/thoughts/:thoughtId | { "thoughtText": "Lorem Ipsum" } |
Create Reaction | /api/thoughts/:thoughtId/reactions | { "reactionBody": "Lorem!", "username": "example" } |
This application was created as part of a UT Full Stack Coding Bootcamp challenge.
Tables created using table-magic by Steve GunTrip (stevecat).
- Email [email protected]
- LinkedIn https://www.linkedin.com/in/elizabetholsavsky/
- Portfolio https://elizabetholsavsky.com/
- Hashnode Blog https://blog.elizabetholsavsky.com/
- Twitter @elizavsky