π Project Title: MyTasks β A Personal Task Manager
π Overview:
Build a simple full-stack task manager web app where users can:
- Add new tasks
- View all tasks
- Delete tasks
- Mark tasks as completed
Store tasks in memory for now (not in a database)
β
Functional Requirements:
1. Add a Task
-
Form with input for:
- Task title (required)
- Optional description
-
When submitted:
- Send a
POST request to the backend
- Task is added to the task list
2. View Tasks
3. Delete a Task
- Clicking βDeleteβ sends a
DELETE request
- The task disappears from UI without page reload
4. Mark Task as Completed
- Clicking this sends a
PUT or PATCH request
- Updates taskβs status to βcompletedβ
- UI updates accordingly
π‘ Bonus Features (Optional):
- Filter tasks: Show only βcompletedβ or βpendingβ
- Add a due date
- Sort tasks by date or status
- Save tasks to a JSON file (use
fs module)
π File Structure:
mytasks/
βββ public/
β βββ index.html
β βββ style.css
β βββ script.js
βββ server.js
βββ package.json
π API Endpoints:
| Method |
Endpoint |
Description |
| GET |
/api/tasks |
Get all tasks |
| POST |
/api/tasks |
Add a new task |
| DELETE |
/api/tasks/:id |
Delete task by ID |
| PATCH |
/api/tasks/:id |
Mark task as completed |
π¦ Task Object Structure (Example)
{
"id": 1,
"title": "Study Express.js",
"description": "Build a full-stack project",
"completed": false
}
π― User Experience Requirements:
- Clear, clean UI
- Form validation (task title must not be empty)
- Smooth task updates (no page reloads)
- Mobile responsive (bonus)
π How to Start:
- Set up Express server to serve static files (
public/)
- Create API routes for each function
- Connect the frontend using Fetch API to backend routes