This project is a simple task management system built to demonstrate backend development fundamentals such as authentication, role-based access control, RESTful API design, and frontend–backend integration.
The project runs in two parts:
- Backend (Flask REST API)
- Frontend (HTML, CSS, JavaScript)
Both parts are included in this repository and are explained in this README.
- Python 3
- Flask
- SQLite
- JWT Authentication
- bcrypt / Werkzeug for password hashing
- HTML
- CSS
- JavaScript (Vanilla)
- User registration and login
- Secure password hashing
- JWT-based authentication
- Role-based access control (User and Admin)
- CRUD operations for tasks
- Users can manage only their own tasks
- Admin can view and delete all users and tasks
- API versioning using
/api/v1 - Proper HTTP status codes and error handling
- Basic request and error logging
- Simple frontend to test APIs
intern-project/
│
├── backend/
│ ├── app.py
│ ├── config.py
│ ├── models/
│ │ ├── user.py
│ │ └── task.py
│ ├── routes/
│ │ ├── auth.py
│ │ └── tasks.py
│ ├── utils/
│ │ └── auth_helper.py
│ ├── logs/
│ │ └── app.log
│ ├── users.db
│ └── requirements.txt
│
├── frontend/
│ ├── index.html
│ ├── dashboard.html
│ ├── script.js
│ └── style.css
│
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/register |
Register a new user |
| POST | /api/v1/login |
Login and receive a JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/tasks |
Create a task |
| GET | /api/v1/tasks |
Get tasks (user gets own, admin gets all) |
| DELETE | /api/v1/tasks/<id> |
Delete a task |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/users |
View all users |
| DELETE | /api/v1/users/<id> |
Delete a user |
All protected endpoints require a JWT token in the request header:
Authorization: Bearer <token>
This project runs in two parts — backend and frontend. Follow the steps below to run both.
- Navigate to the backend directory:
cd intern-project/backend- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate- Install backend dependencies:
pip install -r requirements.txt- Start the backend server:
python app.pyThe backend server will run at:
http://127.0.0.1:5000
Keep this terminal running.
- Open a new terminal window.
- Navigate to the frontend directory:
cd intern-project/frontend- Open the frontend in a browser:
open index.htmlYou can also open index.html directly by double-clicking it.
- Start the backend server.
- Open the frontend in a browser.
- Register a new user.
- Login to access the dashboard.
- Create, view, and delete tasks.
- Admin users can manage all users and tasks.
- Passwords are hashed before storing.
- JWT authentication is required for protected routes.
- Role-based access is enforced at the API level.
- Input validation and error handling are implemented.
- SQLite can be replaced with PostgreSQL or MySQL.
- Redis can be added for caching.
- Docker can be used for containerization.
- Services can be separated into authentication and task modules.
- Load balancing can be added for horizontal scaling.