A full-stack todo application built with Node.js, Express.js, SQLite and JWT for authentication.
- User Authentication: Secure registration and login with JWT tokens
- Task Management: Create, read, update, and delete todos
- Task States: Mark tasks as complete or incomplete
- Real-time Updates: Dynamic UI updates without page refreshes
- Security: Password hashing with bcrypt and JWT token validation
| Login/Register | Main Dashboard | Completed Tasks |
|---|---|---|
![]() |
![]() |
![]() |
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- SQLite - Lightweight, serverless database
- JSON Web Tokens (JWT) - Secure authentication
- bcryptjs - Password hashing
- Vanilla JavaScript - Client-side interactivity
- HTML - Semantic markup
- CSS - Modern styling with custom properties and flexbox
- REST API - Communication between frontend and backend
Before running this application, make sure you have the following installed:
- Node.js (version 14 or higher)
- npm (comes with Node.js)
-
Clone the repository
git clone <your-repository-url> cd "Todo App-NodeJS_ExpressJS_SQLite"
-
Install dependencies
npm install
-
Create environment file Create a
.envfile in the root directory and add your JWT secret:JWT_SECRET=your_secret_jwt_key_here PORT=3000 (or whatever port you prefer)
-
Start the application
npm start
-
Access the application Open your browser and navigate to
http://localhost:PORT
Todo App-NodeJS_ExpressJS_SQLite/
├── public/ # Frontend files
│ ├── index.html # Main HTML file
│ ├── app.js # Client-side JavaScript
│ └── styles.css # Styling
├── src/ # Backend source code
│ ├── server.js # Main server file
│ ├── db.js # Database configuration
│ ├── middleware/ # Custom middleware
│ │ └── authMiddleware.js
│ └── routes/ # API routes
│ ├── authRoutes.js
│ └── todoRoutes.js
├── imgs/ # Screenshots
├── todo-app.rest # API testing file
├── package.json # Project dependencies
└── README.md # Project documentation
| Method | Endpoint | Description | Body |
|---|---|---|---|
| POST | /auth/register |
Register new user | { "username": "email@example.com", "password": "password123" } |
| POST | /auth/login |
Login user | { "username": "email@example.com", "password": "password123" } |
| Method | Endpoint | Description | Body | Headers |
|---|---|---|---|---|
| GET | /todos |
Get all user todos | - | Authorization: Bearer <token> |
| POST | /todos |
Create new todo | { "task": "Todo description" } |
Authorization: Bearer <token> |
| PUT | /todos/:id |
Update todo | { "task": "Updated task", "completed": 1 } |
Authorization: Bearer <token> |
| DELETE | /todos/:id |
Delete todo | - | Authorization: Bearer <token> |


