A comprehensive TODO application built with FastAPI, featuring advanced task management, team collaboration.
- JWT-based authentication with refresh tokens
- Two-factor authentication (2FA) support
- Role-based access control (Admin/User)
- Secure password hashing
- User registration and profile management
- User roles and permissions
- Avatar support
- Account deactivation
- Create, read, update, delete tasks
- Task status tracking (Pending, In Progress, Completed, Archived)
- Priority levels (Low, Medium, High, Urgent)
- Due dates and time tracking
- Task completion and archiving
- Subtasks and task dependencies
- Create and manage tags with custom colors
- Project organization
- Task categorization
- Filter tasks by tags and projects
- Create and manage teams
- Invite users to teams
- Project-team associations
- Task assignment to team members
- Advanced search with multiple filters
- Search by keywords, tags, status, priority
- Date range filtering
- Search suggestions
- Task completion statistics
- Daily productivity metrics
- Progress tracking
- Productivity insights
- Task reminders with custom messages
- System notifications for task assignments
- Due date notifications
- Team activity notifications
- Upload files to tasks
- Multiple file format support
- File size validation
- Secure file access
- Backend: FastAPI
- Database: SQLite (configurable to MySQL/PostgreSQL)
- Authentication: JWT with passlib
- ORM: SQLAlchemy
- Validation: Pydantic
- File Upload: FastAPI file handling
- Documentation: Auto-generated with FastAPI
-
Clone the repository
git clone https://github.com/bPavan16/TodoApp-fastApi.git cd fastAPI -
Create virtual environment
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Environment Configuration
# Copy example environment file cp .env.example .env # Edit .env file with your configuration
-
Run the application
python main.py
The application will be available at http://localhost:8000
Once the application is running, you can access:
- Interactive API docs:
http://localhost:8000/docs - ReDoc documentation:
http://localhost:8000/redoc
Create a .env file based on .env.example:
# Database
DATABASE_URL=sqlite:///./todoapp.db
# Security
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=7
# File Upload
MAX_FILE_SIZE=10485760 # 10MB
UPLOAD_DIR=uploads/No additional setup required. The database file will be created automatically.
POST /auth/register- Register new userPOST /auth/login- Login userPOST /auth/logout- Logout userGET /auth/me- Get current user profilePOST /auth/refresh- Refresh access tokenPOST /auth/2fa/enable- Enable 2FAPOST /auth/2fa/verify- Verify 2FA codePOST /auth/oauth/github- GitHub OAuth login
GET /users/- List users (admin)GET /users/{id}- Get user by IDPUT /users/{id}- Update userDELETE /users/{id}- Delete userGET /users/{id}/tasks- Get user's tasks
GET /tasks/- List tasks with filtersPOST /tasks/- Create new taskGET /tasks/{id}- Get task by IDPUT /tasks/{id}- Update taskDELETE /tasks/{id}- Delete taskPOST /tasks/{id}/complete- Mark task completePOST /tasks/{id}/archive- Archive taskPOST /tasks/{id}/assign- Assign taskGET /tasks/{id}/subtasks- Get subtasksPOST /tasks/{id}/subtasks- Create subtaskGET /tasks/{id}/dependencies- Get dependenciesPOST /tasks/{id}/dependencies- Add dependency
GET /tags/- List tagsPOST /tags/- Create tagGET /tags/{id}- Get tagPUT /tags/{id}- Update tagDELETE /tags/{id}- Delete tagGET /tags/{id}/tasks- Tasks with tag
GET /projects/- List projectsPOST /projects/- Create projectGET /projects/{id}- Get projectPUT /projects/{id}- Update projectDELETE /projects/{id}- Delete projectGET /projects/{id}/tasks- Project tasks
GET /teams/- List user's teamsPOST /teams/- Create teamGET /teams/{id}- Get teamPUT /teams/{id}- Update teamDELETE /teams/{id}- Delete teamPOST /teams/{id}/invite- Invite userGET /teams/{id}/members- Team members
GET /search/tasks- Search tasksGET /search/tasks/suggestions- Search suggestions
GET /analytics/summary- Task summaryGET /analytics/daily- Daily statisticsGET /analytics/productivity- Productivity metrics
GET /notifications/- List notificationsPOST /notifications/mark-all-read- Mark all readPUT /notifications/{id}/read- Mark as readDELETE /notifications/{id}- Delete notification
POST /tasks/{id}/reminders- Add reminderGET /reminders/- List remindersDELETE /reminders/{id}- Delete reminder
POST /tasks/{id}/attachments- Upload fileGET /tasks/{id}/attachments- List attachmentsGET /attachments/{id}/download- Download fileDELETE /attachments/{id}- Delete attachment
curl -X POST "http://localhost:8000/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"username": "testuser",
"password": "securepassword",
"full_name": "Test User"
}'curl -X POST "http://localhost:8000/auth/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=testuser&password=securepassword"curl -X POST "http://localhost:8000/tasks/" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Complete project documentation",
"description": "Write comprehensive documentation for the project",
"priority": "high",
"due_date": "2024-12-31T23:59:59"
}'curl "http://localhost:8000/search/tasks?q=documentation&priority=high" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"python main.pypytestThe application automatically creates database tables on startup. For production deployments, consider using Alembic for database migrations.
- Password hashing with bcrypt
- JWT tokens with expiration
- Refresh token rotation
- Two-factor authentication
- Input validation and sanitization
- File upload security
- CORS protection
- SQL injection prevention
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions, please open an issue on the GitHub repository.
- FastAPI team for creating an amazing framework
- SQLAlchemy for ORM capabilities