This is a simple To-Do List application built with FastAPI. It allows users to keep track of their daily tasks using a SQLite database. The application is structured with a clean and simple architecture, making it easy to understand and extend.
- 📋 Create, Read, Update, and Delete (CRUD) operations for managing tasks.
- 🗄️ Uses SQLite as the database backend for quick and easy setup.
- ⚡ Fast and efficient API built with FastAPI.
- 🗂️ Project organized with modular structure using routers.
- 📜 Alembic integration for database migrations.
ToDo-list-Fastapi/
├── alembic/ # Alembic configuration for database migrations
├── routers/ # API routers for different functionalities
├── .gitignore # Git ignore file
├── README.md # Project documentation
├── alembic.ini # Alembic configuration file
├── database.py # Database connection and setup
├── main.py # Application entry point
├── models.py # Database models
├── todos.db # SQLite database file
└── requirements.txt # Python dependencies
- Python 3.1+
- FastAPI
- SQLite
-
Clone the repository:
git clone https://github.com/yourusername/ToDo-list-Fastapi.git cd ToDo-list-Fastapi
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --reload
-
Access the API documentation:
- Open your browser and navigate to http://127.0.0.1:8000/docs for the interactive Swagger UI.
- For ReDoc, go to http://127.0.0.1:8000/redoc.
- Create a new task:
POST /tasks/
- Get all tasks:
GET /tasks/
- Get a task by ID:
GET /tasks/{task_id}
- Update a task by ID:
PUT /tasks/{task_id}
- Delete a task by ID:
DELETE /tasks/{task_id}
For detailed API documentation, visit the API Docs.
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
- Author: Kian Anbarestani
- Email: [email protected]
- GitHub: KianAnbarestani
Feel free to open an issue if you find a bug or have suggestions for improvements!