Chu Thi Thanh
Nguyen Hong Ngoc
Artemis
Funfit is a mobile application that helps users stick with their workout routines, thus promoting a healthy lifestyle. For more information, please refer to the README file: https://docs.google.com/document/d/1WQjS8imb594OwwgxLR8O5RfU5ZfX6ZVX1GNW9qsdOgk/edit
This repository contains the code for the backend of Funfit. This is built using Express.js as the backend framework, MongoDB as the database, mongoose as the ODM and socket.IO for real-time chat.
The frontend repository can be found here: https://github.com/lilythchu/FunFitFE.
- Clone git repository
- Create an .env file in the app's route containing fields as in the env_fields.txt
- Install dependencies
npm install - Run the server on localhost:3000
npm run devstart - Frontend: React Native
- Backend: Express.js
- Deployment: Heroku
- Database: MongoDB
- Quality Assurance: Mocha + Jest
| Endpoint | Description | Method | Note |
|---|---|---|---|
| /user/signup | Create a new account | POST | Sign up with the following required fields:
|
| /user/signup | Log into account | POST | Log in with the following required fields:
|
| /user/refreshToken | Generate refresh token | POST | Required field: refreshToken |
| /user/resetPassword | Reset password | POST | Required fields:
|
| /user/forgotPassword | Send email to reset password | POST | Required field: Email |
| /user/me | Get user's profile | GET | Required field: authorization token |
| /user/level | Get user's level and points | GET | Required field: authorization token |
| /user/getCalendarList | Get user's calendar list | GET | Required field: authorization token |
| /user/getUserProfile | Get a user's profile | GET | Required field:
|
| /user/getPicInfo | Get user's profile picture info | GET | Required field: authorization token |
| /user/downloadPic | Download user's profile picture | GET | Required field: authorization token |
| /user/updateProfile | Update user's profile | PUT | Required field:
|
| /user/upload | Upload user's profile picture | POST | Required field: authorization token |
| /story/recommendedFriends | Get user's friend suggestions | GET | Required field: authorization token |
| /story/getStoriesInfo | Retrieve list of stories | GET | Required field:
|
| /story/getStory | Get a story info | GET | Required field:
|
| /story/uploadStory | Upload a story | POST | Required field:
|
| /story/deleteStory | Delete a story | DELETE | Required field:
|
| /routine/getMyRoutines | Get all my routines | GET | Required field: authorization token |
| /routine/getRecRoutines | Get all recommended routines | GET | Required field: authorization token |
| /routine/getRoutinesByGenre | Get recommended routines by genre | GET | Required field:
|
| /routine/myRoutine | Retrieve information about a routine from my library | GET | Required field:
|
| /routine/recRoutine | Retrieve information about a routine from recommended lists | GET | Required field:
|
| /routine/newRoutine | Create a new routine | POST | Required field:
|
| /routine/addToLibrary | Add a recommended routine to user's library | POST | Required field:
|
| /routine/deleteRoutine | Delete a routine or unsave a recommended routine | DELETE | Required field:
|
| /routine/editRoutine | Edit a routine | PUT | Required field:
|
| /routine/addDaysFollow | Add days and points to routine | POST | Required field:
|
| /routine/addReminder | Add reminder to a routine | POST | Required field:
|
| /chat/initiateConvo | Initiate chat | POST | Required field:
|
| /chat/getAllConvos | Get all conversations | GET | Required field: authorization token |
| /chat/getAConvo | Get a conversation by id | GET | Required field:
|
| /chat/deleteConvo | Delete a conversation | DELETE | Required field:
|
- Ensure the branch you are working on is named semantically based on the task at hand. Eg. add-message-routes
- Submit the Pull Request with main as the target branch.
- If any, link the GitHub issue to the Pull Request.
- Ensure all CI checks are passing.
- Assign a reviewer to review the Pull Request.
- Once the reviewer has approved the Pull Request, merge it and delete the source branch.