A fully developed Task Manager API built with FastAPI, including user roles, permissions, admin management, and secure password reset.
-
Task Management:
- Create, update, delete, and list tasks
-
Admin User Management:
- Admins can perform CRUD operations on users
- Assign roles and permissions to users and admin
-
User Roles & Permissions:
- Role-based access control (RBAC)
- Certain endpoints accessible only to admin or specific roles
-
Forgot Password / Password Reset:
- Users can reset password using PIN sent via email
-
User Authentication (JWT-based)
-
Auto-generated Swagger UI documentation
git clone https://github.com/Malikabriq/FastAPI-based-Task-Manager-API-fully-developed-.git
cd FastAPI-based-Task-Manager-API-fully-developed-python -m venv venvWindows:
venv\Scripts\activateLinux/Mac:
source venv/bin/activatepip install -r requirements.txtuvicorn main:app --reloadOpen the API docs at:
http://127.0.0.1:8000/docs
my_task_manager/
│── app/
│ ├── main.py
│ ├── models.py
│ ├── routers/
│ │ ├── tasks.py
│ │ └── users.py # admin CRUD, roles & permissions, forgot password
│ ├── schemas.py
│ └── database.py
│── requirements.txt
│── README.md
│── .gitignore
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Create User | POST | /users/ |
Assign role & permissions on creation |
| Read User | GET | /users/{user_id} |
View user info and role |
| Update User | PUT | /users/{user_id} |
Update user details, roles, and permissions |
| Delete User | DELETE | /users/{user_id} |
Remove user |
Role-based access: Only admin or specific roles can access protected endpoints.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Request PIN | POST | /users/forgot-password |
Sends PIN to user email |
| Reset Password | POST | /users/reset-password |
Reset password using PIN |
Example using cURL:
# Request PIN
curl -X POST "http://127.0.0.1:8000/users/forgot-password" -H "Content-Type: application/json" -d '{"email":"user@example.com"}'
# Reset Password
curl -X POST "http://127.0.0.1:8000/users/reset-password" -H "Content-Type: application/json" -d '{"email":"user@example.com","pin":"123456","new_password":"newpass123"}'- Task CRUD operations
- User CRUD by admin
- Role & permission assignment for users and admin
- Forgot password via email/PIN
- JWT authentication
Open-source and free to use.
Open-source and free to use.