After opening the file paste this link: python -m uvicorn main:app --reload
and then paste this link in the browser: http://127.0.0.1:8000/docs
This project implements a secure task manager API with:
- user registration and login
- password hashing with bcrypt
- JWT-based authentication
- protected task endpoints
- user-specific task ownership enforcement
- logout support via token blacklist
- main.py: FastAPI app entry point
- routers/auth.py: signup, login, logout, current user routes
- routers/task.py: task CRUD routes
- crud.py: reusable database operations
- models.py: SQLAlchemy database models
- schemas.py: request/response validation models
- oauth2.py: JWT authentication helpers
- token_blacklist.py: logout support
- Create and activate a Python environment.
- Install dependencies:
pip install -r requirements.txt
- Start the API:
or
python run.py
uvicorn main:app --reload
- POST /auth/signup
- POST /auth/login
- POST /auth/logout
- GET /auth/me
- POST /auth/refresh
- POST /auth/verify-email
- POST /auth/forgot-password
- POST /auth/reset-password
- GET /auth/admin
- Refresh-token based session renewal
- Logout with token blacklisting
- Email verification flow
- Password reset flow
- Admin-role access control
- Lightweight request-rate limiting
- POST /tasks
- GET /tasks
- GET /tasks/{id}
- PUT /tasks/{id}
- DELETE /tasks/{id}
Run the automated tests:
pytest -q