This is the backend for the DailyTracker application. It is built using Node.js and Express, with MySQL as the database management system.
- Node.js
- MySQL
-
Clone the repository.
git clone <repository_url>
-
Install dependencies.
npm install
-
Setup environment variable -
cp .env.example .env
-
Run the server.
npm run dev
The server will start on port 3000 by default. You can change the port in the index.js
file if necessary.
Create a MySQL database with the following credentials:
- Database name: your_database_name
- Username: your_username
- Password: your_password
Ensure that your MySQL server is running, and update the database configuration in .env
with your database credentials.
POST /users/signup
: Create a new userPOST /users/login
: Login the userPOST /todo/
: Create a todo listPOST /events
: Create an eventPOST /notify/push
: Send push notificationPOST /notify/email
: Send emailPOST /notify/SMS
: Send SMSGET /users/:id
: Get user details and informationGET /todo/:id
: Get all todo lists belonging to the userPATCH /users/:id
: Update the userPATCH /todo/:list-id
: Alter and update the todo listPATCH /events/:event-id
: Update eventDELETE /users/:id
: Delete the user and all associated dataDELETE /todo/
: Delete all todo lists for the userDELETE /todo/:list-id
: Delete the todo list belonging to the userDELETE /event
: Delete all events belonging to the userDELETE /event/:event-id
: Delete an eventDELETE /clear
: Clear all data if due 30 days ago