
This commit includes: - Project structure and configuration - Database models for tasks, users, and categories - Authentication system with JWT - CRUD endpoints for tasks and categories - Search, filter, and sorting functionality - Health check endpoint - Alembic migration setup - Documentation
134 lines
3.2 KiB
Markdown
134 lines
3.2 KiB
Markdown
# Task Management Tool
|
|
|
|
A robust task management application built with FastAPI and SQLite. The application allows users to create, organize, and track tasks with categories, priorities, and due dates.
|
|
|
|
## Features
|
|
|
|
- 🔐 User authentication (register, login)
|
|
- ✅ Task management (create, read, update, delete)
|
|
- 🏷️ Categories for organizing tasks
|
|
- 🔍 Search, filter, and sorting functionality
|
|
- 🎯 Priority levels for tasks
|
|
- 📅 Due dates for tasks
|
|
- 🔄 Task completion status tracking
|
|
|
|
## Technology Stack
|
|
|
|
- **Backend**: FastAPI
|
|
- **Database**: SQLite with SQLAlchemy ORM
|
|
- **Authentication**: JWT with OAuth2
|
|
- **Migration**: Alembic
|
|
- **Validation**: Pydantic
|
|
- **Code Quality**: Ruff
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Python 3.8 or higher
|
|
- pip (Python package manager)
|
|
|
|
### Installation
|
|
|
|
1. Clone the repository:
|
|
|
|
```bash
|
|
git clone <repository-url>
|
|
cd taskmanagementtool
|
|
```
|
|
|
|
2. Create a virtual environment and activate it:
|
|
|
|
```bash
|
|
python -m venv venv
|
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
```
|
|
|
|
3. Install dependencies:
|
|
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
4. Create a .env file based on .env.example:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
5. Run database migrations:
|
|
|
|
```bash
|
|
alembic upgrade head
|
|
```
|
|
|
|
### Running the Application
|
|
|
|
Start the server with uvicorn:
|
|
|
|
```bash
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
The API will be available at http://localhost:8000
|
|
|
|
### API Documentation
|
|
|
|
Once the server is running, you can access:
|
|
|
|
- Interactive API documentation: http://localhost:8000/docs
|
|
- Alternative API documentation: http://localhost:8000/redoc
|
|
- OpenAPI schema: http://localhost:8000/openapi.json
|
|
|
|
## API Endpoints
|
|
|
|
### Authentication
|
|
|
|
- `POST /api/v1/auth/register` - Register a new user
|
|
- `POST /api/v1/auth/login` - Login and get access token
|
|
|
|
### Users
|
|
|
|
- `GET /api/v1/users/me` - Get current user info
|
|
- `PUT /api/v1/users/me` - Update current user info
|
|
|
|
### Tasks
|
|
|
|
- `GET /api/v1/tasks` - List all tasks
|
|
- `POST /api/v1/tasks` - Create a new task
|
|
- `GET /api/v1/tasks/{task_id}` - Get a specific task
|
|
- `PUT /api/v1/tasks/{task_id}` - Update a task
|
|
- `DELETE /api/v1/tasks/{task_id}` - Delete a task
|
|
|
|
### Categories
|
|
|
|
- `GET /api/v1/categories` - List all categories
|
|
- `POST /api/v1/categories` - Create a new category
|
|
- `GET /api/v1/categories/{category_id}` - Get a specific category
|
|
- `PUT /api/v1/categories/{category_id}` - Update a category
|
|
- `DELETE /api/v1/categories/{category_id}` - Delete a category
|
|
|
|
### Health Check
|
|
|
|
- `GET /health` - Check application health status
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Description | Default |
|
|
|----------|-------------|---------|
|
|
| SECRET_KEY | Secret key for JWT token generation | (See .env.example) |
|
|
| ALGORITHM | Algorithm used for JWT | HS256 |
|
|
| ACCESS_TOKEN_EXPIRE_MINUTES | Token expiration time in minutes | 30 |
|
|
| BACKEND_CORS_ORIGINS | List of allowed CORS origins | [] |
|
|
|
|
## Database Structure
|
|
|
|
The application uses three main database models:
|
|
|
|
1. **User** - Stores user information
|
|
2. **Task** - Stores task details with references to users and categories
|
|
3. **Category** - Stores category information with references to users
|
|
|
|
## License
|
|
|
|
This project is licensed under the MIT License - see the LICENSE file for details. |