{"id":21457816,"url":"https://github.com/e19166/fastapi-todo","last_synced_at":"2026-04-11T21:46:36.709Z","repository":{"id":263259257,"uuid":"889559147","full_name":"e19166/fastapi-todo","owner":"e19166","description":"\"FastAPI-based To-Do List API with CRUD operations, SQLite integration, dockerization, kubernetes deployment and interactive API docs for easy task management. Built for high performance and scalability.","archived":false,"fork":false,"pushed_at":"2024-11-17T11:27:12.000Z","size":16908,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T13:33:50.666Z","etag":null,"topics":["crud-operation","database-management","docker","fastapi","kubernetes","sqlite-database","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e19166.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T16:29:04.000Z","updated_at":"2024-11-17T11:33:44.000Z","dependencies_parsed_at":"2024-11-17T11:55:40.744Z","dependency_job_id":null,"html_url":"https://github.com/e19166/fastapi-todo","commit_stats":null,"previous_names":["e19166/fastapi-todo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2Ffastapi-todo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2Ffastapi-todo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2Ffastapi-todo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2Ffastapi-todo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e19166","download_url":"https://codeload.github.com/e19166/fastapi-todo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971193,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crud-operation","database-management","docker","fastapi","kubernetes","sqlite-database","testing"],"created_at":"2024-11-23T06:07:13.541Z","updated_at":"2026-04-11T21:46:31.670Z","avatar_url":"https://github.com/e19166.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI To-Do List API\n\nWelcome to the FastAPI To-Do List project! 🚀 This project demonstrates how to build a modern, high-performance API using [FastAPI](https://fastapi.tiangolo.com/), Python's fastest web framework. This API allows users to manage a To-Do List, with endpoints to create, read, update, and delete tasks. It integrates seamlessly with a SQLite database for persistent storage and offers interactive API documentation for easy testing.\n\n---\n\n## 🚀 Features\n\n- **FastAPI-based API**: Built using FastAPI for high performance and easy-to-use Pythonic syntax.\n- **CRUD operations**: Create, read, update, and delete tasks in your To-Do list.\n- **Database Integration**: SQLite as the database with SQLAlchemy ORM for easy querying.\n- **Interactive API Docs**: Swagger UI and ReDoc auto-generated for real-time testing of API endpoints.\n- **Asynchronous Support**: FastAPI’s asynchronous support ensures optimal performance for I/O-bound tasks.\n\n---\n\n## ⚡ Getting Started\n\n### Prerequisites\n\nBefore running the project, ensure you have the following installed:\n- Python 3.7+ (FastAPI works best with Python 3.7 or newer)\n- [pip](https://pip.pypa.io/en/stable/) (Python package installer)\n- [Docker](https://www.docker.com/) (optional for containerization)\n- [Kubernetes](https://kubernetes.io/) (optional for deployment)\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/e19166/fastapi-todo.git\ncd fastapi-todo\n```\n\n### 2. Create and Activate a Virtual Environment\n\nFor macOS/Linux:\n\n```bash\n    python3 -m venv venv\n    source venv/bin/activate                         \n```\n\nFor Windows:\n\n```bash\n    python -m venv venv\n    venv\\Scripts\\activate\n```\n\n### 3. Install Dependencies\n\n```bash\n    pip install -r requirements.txt\n```\n\n## 📦 Running the Application Locally\n\n### 1. Start the FastAPI App\n\n```bash\n    uvicorn app.main:app --reload\n```\nThis will start the server at http://127.0.0.1:8000.\n\n### 2. Access the API Documentation\n\n- Swagger UI: http://127.0.0.1:8000/docs\n- ReDoc: http://127.0.0.1:8000/redoc\n\n## 🛠️ Project Structure\n\n```bash\nfastapi-todo/\n├── app/\n│   ├── __init__.py\n│   ├── main.py               # FastAPI entry point\n│   ├── models.py             # SQLAlchemy models\n│   ├── database.py           # Database connection\n│   ├── schemas.py            # Pydantic schemas\n│   ├── crud.py               # CRUD operations\n│   ├── routers/\n│   │   ├── todos.py          # Routes for To-Do operations\n│   └── utils/\n│       ├── dependencies.py   # Dependency injections\n├── migrations/               # Database migrations (if using Alembic)\n├── tests/                    # Unit tests for the API\n├── .env                      # Environment variables (e.g., DB URL)\n├── Dockerfile                # Docker configuration\n├── requirements.txt          # Python dependencies\n└── README.md                 # Project documentation\n```\n\n## ⚡ API Endpoints\n\n* GET /todos/: Retrieve a list of all tasks.\n* GET /todos/{todo_id}: Get a specific task by ID.\n* POST /todos/: Create a new task.\n* PUT /todos/{todo_id}: Update an existing task by ID.\n* DELETE /todos/{todo_id}: Delete a task by ID.\n\n### Example Requests:\n\n* Create Task: POST /todos/\n\n```json\n{\n  \"title\": \"Buy groceries\",\n  \"description\": \"Milk, eggs, bread\",\n  \"completed\": false\n}\n```\n\n* Update Task: PUT /todos/1\n\n```json\n{\n  \"title\": \"Buy groceries\",\n  \"description\": \"Milk, eggs, bread, butter\",\n  \"completed\": true\n}\n```\n\n## 🐳 Dockerization\n\n### 1. Build the Docker Image\n\n```bash\ndocker build -t fastapi-todo .\n```\n\n### 2. Run the Docker Container\n\n```bash\ndocker run -d -p 80:80 fastapi-todo\n```\n\n### 3. Push to Docker Hub\n\n```bash\ndocker tag fastapi-todo your-dockerhub-username/fastapi-todo\ndocker push your-dockerhub-username/fastapi-todo\n```\n\n## 📦 Deployment\n\n### Deploy with Kubernetes:\n\n#### 1. Create Kubernetes Configurations:\n\n* Deployment (deployment.yaml): Defines how the application will be deployed.\n* Service: Exposes the app to external traffic.\n\n#### 2. Apply Kubernetes Configurations:\n\n```bash\nkubectl apply -f deployment.yaml\n```\n\n#### 3. Verify Deployment:\n\n```bash\nkubectl get pods\nkubectl get svc\n```\n\n#### 4. Port Forwarding (if no external IP):\n\n```bash\nkubectl port-forward svc/fastapi-todo-service 8080:80\n```\n\n## 🧪 Testing\n\n### Run the tests with pytest:\n\n```bash \npytest tests/\n```\n\n## 🔧 Enhancements and Future Work\n\n* Add user authentication (JWT tokens).\n* Implement task due dates and priority levels.\n* Introduce task categories or tags for better organization.\n* Support other databases (e.g., PostgreSQL, MySQL).\n\n## 👨‍💻 Contributing\n\nI welcome contributions! If you have suggestions or want to fix an issue, please feel free to fork the repo and submit a pull request.\n\n## 📑 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n### Enjoy building your FastAPI-powered To-Do List API! 🎉\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe19166%2Ffastapi-todo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe19166%2Ffastapi-todo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe19166%2Ffastapi-todo/lists"}