A basic full-stack To-Do application with complete CRUD functionality.
- ✅ Create - Add new tasks with title and optional description
- ✅ Read - Display all tasks in a clean interface
- ✅ Update - Edit tasks or mark them as complete
- ✅ Delete - Remove tasks with confirmation
- ✅ Filter - View all, active, or completed tasks
- ✅ Responsive Design - Works on desktop and mobile
- ✅ Real-time Updates - Auto-refresh every 5 seconds
Backend:
- Node.js
- Express.js
- SQLite3
Frontend:
- HTML5
- CSS3
- Vanilla JavaScript
- Navigate to the project directory:
cd "d:\TO DO Application"- Install dependencies:
npm installStart the server:
npm startThe app will be available at: http://localhost:3000
GET /api/todos- Get all todosGET /api/todos/:id- Get a specific todoPOST /api/todos- Create a new todoPUT /api/todos/:id- Update a todoDELETE /api/todos/:id- Delete a todo
POST /api/todos
Content-Type: application/json
{
"title": "Buy groceries",
"description": "Milk, eggs, bread"
}PUT /api/todos/1
Content-Type: application/json
{
"title": "Buy groceries",
"description": "Milk, eggs, bread",
"completed": true
}DELETE /api/todos/1TO DO Application/
├── package.json # Project dependencies
├── server.js # Express backend server
├── todos.db # SQLite database (created on first run)
└── public/
├── index.html # Main HTML file
├── style.css # Styling
└── app.js # Frontend JavaScript
The SQLite database includes a single todos table:
CREATE TABLE todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
description TEXT,
completed INTEGER DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)- Add a Task: Enter a title (required) and optional description, then click "Add Task"
- Mark Complete: Check the checkbox next to a task
- Edit a Task: Click "Edit" to modify the task
- Delete a Task: Click "Delete" and confirm
- Filter Tasks: Use the filter buttons to view all, active, or completed tasks
- Tasks are persisted in SQLite database
- Data survives server restarts
- Frontend auto-refreshes every 5 seconds
- Input validation on both client and server sides
- XSS protection with HTML escaping