{"id":26742379,"url":"https://github.com/pankaj085/fastapi-todo-app","last_synced_at":"2026-04-29T16:34:17.688Z","repository":{"id":284765358,"uuid":"955983936","full_name":"pankaj085/fastapi-todo-app","owner":"pankaj085","description":"A fully asynchronous To-Do application built with FastAPI and PostgreSQL. Features include CRUD operations, pagination, and interactive API documentation with Swagger UI and ReDoc. Designed for high performance and scalability with a clean, modular codebase.","archived":false,"fork":false,"pushed_at":"2025-03-27T14:37:28.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:39:03.842Z","etag":null,"topics":["asynchronous","fastapi","postgresql","pydantic","python","sqlalchemy","uvicorn"],"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/pankaj085.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":"2025-03-27T14:10:04.000Z","updated_at":"2025-03-27T14:46:08.000Z","dependencies_parsed_at":"2025-03-27T15:43:14.072Z","dependency_job_id":"9354e3d8-bbdc-4666-9fab-a9571e9fa3cd","html_url":"https://github.com/pankaj085/fastapi-todo-app","commit_stats":null,"previous_names":["pankaj085/fastapi-todo-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2Ffastapi-todo-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2Ffastapi-todo-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2Ffastapi-todo-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2Ffastapi-todo-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankaj085","download_url":"https://codeload.github.com/pankaj085/fastapi-todo-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978283,"owners_count":20703678,"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":["asynchronous","fastapi","postgresql","pydantic","python","sqlalchemy","uvicorn"],"created_at":"2025-03-28T06:17:43.162Z","updated_at":"2025-09-20T09:48:09.137Z","avatar_url":"https://github.com/pankaj085.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📝 FastAPI To-Do App\n\nA fully asynchronous To-Do application built with **FastAPI** and **PostgreSQL**. This app provides a robust backend for managing tasks with full CRUD (Create, Read, Update, Delete) functionality. It is designed to be lightweight, fast, and scalable.\n\n---\n\n## 🚀 Features\n- Full **CRUD operations** for managing tasks.\n- **PostgreSQL** database integration with SQLAlchemy ORM.\n- Fully **asynchronous** support for high performance.\n- Interactive API documentation with **Swagger UI** and **ReDoc**.\n- Pagination support for listing tasks.\n- Health check endpoint for monitoring the application.\n- Modular and clean code structure for easy scalability.\n\n---\n\n## 🛠️ Setup Instructions\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/pankaj085/fastapi-todo-app.git\n```\n```bash\ncd fastapi-todo-app\n```\n\n### 2. Create a Virtual Environment\n```bash\npython -m venv .venv\nsource .venv/bin/activate  # Linux/Mac\n.\\.venv\\Scripts\\activate  # Windows\n```\n\n### 3. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 4. Set Up PostgreSQL\n- Install and configure PostgreSQL on your system.\n- Create a new database for the application.\n- Create the `.env` file and add your database credentials:\n  ```env\n  DATABASE_URL=postgresql+asyncpg://[your_database_username]:[your_password]@localhost/[your_database_name]\n  ```\n\n### 5. Create Database Tables\nRun the following script to create the necessary database tables:\n```bash\npython create_tables.py\n```\n\n### 6. Start the Application\nRun the FastAPI application using Uvicorn:\n```bash\nuvicorn app.main:app --reload\n```\n\nThe application will be available at: [http://localhost:8000](http://localhost:8000)\n\n---\n\n## 📖 API Documentation\nFastAPI provides interactive API documentation:\n- **Swagger UI**: [http://localhost:8000/docs](http://localhost:8000/docs)\n- **ReDoc**: [http://localhost:8000/redoc](http://localhost:8000/redoc)\n\n---\n\n## 🗂️ Project Structure\n```\nfastapi_todo_app/\n├── app/\n│   ├── __init__.py          # Package initializer\n│   ├── main.py              # Application entry point\n│   ├── database.py          # Database configuration\n│   ├── models.py            # SQLAlchemy ORM models\n│   ├── schemas.py           # Pydantic schemas for request/response validation\n│   ├── crud.py              # CRUD operations\n│   ├── routers/\n│   │   ├── __init__.py      # Package initializer for routers\n│   │   ├── tasks.py         # Task-related API endpoints\n├── create_tables.py         # Script to create database tables\n├── requirements.txt         # Python dependencies\n├── .env                     # Environment variables\n├── README.md                # Project documentation\n```\n\n---\n\n## 🛡️ Environment Variables\nThe application uses a `.env` file to manage environment variables. Below are the required variables:\n- `DATABASE_URL`: The connection string for the PostgreSQL database.\n\nExample `.env` file:\n```env\nDATABASE_URL=postgresql+asyncpg://username:password@localhost/todo_db\n```\n\n---\n\n## 🖥️ Example API Endpoints\n\n### 1. Create a Task\n**POST** `/tasks/`\n```json\n{\n  \"title\": \"Buy groceries\",\n  \"description\": \"Milk, Bread, Eggs\",\n  \"completed\": false\n}\n```\n\n### 2. List All Tasks\n**GET** `/tasks/`\n```json\n{\n  \"tasks\": [\n    {\n      \"id\": 1,\n      \"title\": \"Buy groceries\",\n      \"description\": \"Milk, Bread, Eggs\",\n      \"completed\": false,\n      \"created_at\": \"2025-03-27T12:00:00Z\",\n      \"updated_at\": \"2025-03-27T12:00:00Z\"\n    }\n  ],\n  \"count\": 1\n}\n```\n\n### 3. Update a Task\n**PUT** `/tasks/{task_id}/`\n```json\n{\n  \"title\": \"Buy groceries and snacks\",\n  \"description\": \"Milk, Bread, Eggs, Chips\",\n  \"completed\": true\n}\n```\n\n### 4. Delete a Task\n**DELETE** `/tasks/{task_id}/`\n\n---\n\n## 🛠️ Technologies Used\n- **FastAPI**: Web framework for building APIs.\n- **PostgreSQL**: Relational database for storing tasks.\n- **SQLAlchemy**: ORM for database interactions.\n- **Pydantic**: Data validation and settings management.\n- **Uvicorn**: ASGI server for running the application.\n\n---\n\n## 🙌 Acknowledgments\n- [FastAPI Documentation](https://fastapi.tiangolo.com/)\n- [SQLAlchemy Documentation](https://docs.sqlalchemy.org/)\n- [PostgreSQL Documentation](https://www.postgresql.org/docs/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj085%2Ffastapi-todo-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankaj085%2Ffastapi-todo-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj085%2Ffastapi-todo-app/lists"}