A full-stack task manager with JWT authentication, built with FastAPI (backend) and plain HTML/JS (frontend).
- User registration & login with JWT authentication
- Password hashing with bcrypt
- Full task CRUD (create, read, update, delete)
- Mark tasks as complete / incomplete
- Pagination & filtering (
?completed=true/false) - Users can only access their own tasks
- Interactive API docs at
/docs - Pytest test suite
- Dockerfile included
taskmanager/
├── README.md
├── frontend/
│ └── index.html ← single-file UI served by FastAPI
└── backend/
├── Dockerfile
├── requirements.txt
├── .env.example
└── app/
├── main.py
├── core/
│ ├── config.py
│ └── security.py
├── db/
│ └── database.py
├── models/
│ └── models.py
├── schemas/
│ └── schemas.py
└── routers/
├── deps.py
├── auth.py
└── tasks.py
└── tests/
├── conftest.py
├── test_auth.py
└── test_tasks.py
# 1. Clone the repo
git clone https://github.com/YOUR_USERNAME/taskmanager.git
cd taskmanager/backend
# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment variables
cp .env.example .env
# Edit .env and set a strong SECRET_KEY
# 5. Run the server
uvicorn app.main:app --reload
# App: http://localhost:8000
# Docs: http://localhost:8000/docs| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
JWT signing secret (change this!) | dev-secret-key-change-in-production |
ALGORITHM |
JWT algorithm | HS256 |
ACCESS_TOKEN_EXPIRE_MINUTES |
Token lifetime in minutes | 30 |
DATABASE_URL |
SQLAlchemy DB URL | sqlite:///./taskmanager.db |
⚠️ Never commit your.envfile. Use.env.exampleas the template.
| Method | Path | Description |
|---|---|---|
POST |
/auth/register |
Register a new user |
POST |
/auth/login |
Login and receive a JWT |
| Method | Path | Description |
|---|---|---|
POST |
/tasks |
Create a task |
GET |
/tasks |
List tasks (paginated, filterable) |
GET |
/tasks/{id} |
Get a specific task |
PUT |
/tasks/{id} |
Update a task |
DELETE |
/tasks/{id} |
Delete a task |
Query params for GET /tasks:
?completed=true— only completed tasks?completed=false— only active tasks?page=1&page_size=10— pagination
cd backend
pytest tests/ -vcd backend
docker build -t taskmanager .
docker run -p 8000:8000 -e SECRET_KEY=your-secret taskmanager- Push this repo to a public GitHub repository
- Go to render.com → New Web Service
- Connect your repo
- Set Root Directory to
backend - Build command:
pip install -r requirements.txt - Start command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT - Add environment variable:
SECRET_KEY= any random 32+ character string - Click Deploy
Live endpoints:
- Frontend:
https://your-app.onrender.com/ - API Docs:
https://your-app.onrender.com/docs