A full-stack Task Manager built with FastAPI (backend) and plain HTML/CSS/JS (frontend). Features JWT authentication, SQLite/PostgreSQL support, pagination, and filtering.
- User registration & login (JWT-based auth, bcrypt password hashing)
- Create, view, update, and delete tasks
- Mark tasks as completed
- Pagination and filtering (
?completed=true/false) - Task isolation — users only see their own tasks
- Single-file frontend served by FastAPI
- SQLite (dev) / PostgreSQL (production) support
- Pytest test suite with 15+ test cases
- Docker support
taskmanager/
├── backend/
│ ├── app/
│ │ ├── api/
│ │ │ ├── auth.py # /register, /login endpoints
│ │ │ ├── tasks.py # /tasks CRUD endpoints
│ │ │ └── deps.py # JWT dependency injection
│ │ ├── core/
│ │ │ ├── config.py # Settings (pydantic-settings)
│ │ │ └── security.py # JWT + bcrypt utilities
│ │ ├── db/
│ │ │ └── session.py # SQLAlchemy engine + session
│ │ ├── models/
│ │ │ ├── user.py # User ORM model
│ │ │ └── task.py # Task ORM model
│ │ ├── schemas/
│ │ │ ├── user.py # Pydantic schemas for users
│ │ │ └── task.py # Pydantic schemas for tasks
│ ├── requirements.txt
│ ├── pytest.ini
│ ├── Dockerfile
│ └── .env.example
├── frontend/
│ └── index.html # Single-page frontend app
├── Dockerfile # Full-stack Docker build
├── .gitignore
└── README.md
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /register |
No | Register new user |
| POST | /login |
No | Login, returns JWT |
| POST | /tasks |
Yes | Create a task |
| GET | /tasks |
Yes | List tasks (paginated, filterable) |
| GET | /tasks/{id} |
Yes | Get single task |
| PUT | /tasks/{id} |
Yes | Update task |
| DELETE | /tasks/{id} |
Yes | Delete task |
| GET | /docs |
No | Swagger UI |
Query parameters for GET /tasks:
page— page number (default: 1)size— items per page (default: 10, max: 100)completed— filter by status:trueorfalse
Copy .env.example to .env and fill in values:
cp backend/.env.example backend/.env| Variable | Default | Description |
|---|---|---|
SECRET_KEY |
(required) | JWT signing secret — use a long random string |
ALGORITHM |
HS256 |
JWT algorithm |
ACCESS_TOKEN_EXPIRE_MINUTES |
30 |
Token TTL in minutes |
DATABASE_URL |
sqlite:///./taskmanager.db |
Database connection string |
FRONTEND_URL |
http://localhost:3000 |
Allowed CORS origin |
Generate a strong SECRET_KEY:
python -c "import secrets; print(secrets.token_hex(32))"- Python 3.11+
- pip
# 1. Clone the repo
git clone https://github.com/yourusername/taskmanager.git
cd taskmanager
# 2. Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
cd backend
pip install -r requirements.txt
# 4. Configure environment
cp .env.example .env
# Edit .env and set SECRET_KEY
# 5. Run the server
uvicorn app.main:app --reload --port 8000Open http://localhost:8000 for the frontend app.
Open http://localhost:8000/docs for the Swagger UI.
docker build -t taskmanager .
docker run -p 8000:8000 \
-e SECRET_KEY=your-secret-key \
-e DATABASE_URL=sqlite:///./taskmanager.db \
taskmanagercd backend
docker build -t taskmanager-api .
docker run -p 8000:8000 -e SECRET_KEY=your-secret-key taskmanager-api- Push to a public GitHub repo
- Create a new Web Service on Render
- Set Build Command:
pip install -r backend/requirements.txt - Set Start Command:
cd backend && uvicorn app.main:app --host 0.0.0.0 --port $PORT - Set environment variables in Render dashboard:
SECRET_KEY— generate withpython -c "import secrets; print(secrets.token_hex(32))"DATABASE_URL— usesqlite:///./taskmanager.dbfor SQLite, or add a PostgreSQL database from RenderFRONTEND_URL— your Render app URL
railway login
railway init
railway add
railway upSet env vars in the Railway dashboard.
- Open the hosted URL
- Click Register and create an account
- Log in with your credentials
- Create tasks using the form at the top
- Click the circle button to mark a task complete
- Use filters (All / Pending / Completed) to sort your view
- Click delete to remove a task