{"id":38822192,"url":"https://github.com/yudhaislamisulistya/book-api-fastapi","last_synced_at":"2026-01-17T13:06:15.335Z","repository":{"id":187528394,"uuid":"677067869","full_name":"yudhaislamisulistya/book-api-fastapi","owner":"yudhaislamisulistya","description":"This project provides a simple structure for creating a FastAPI-based web application for managing books, along with Alembic for database migrations. It is designed with beginners in mind and follows a structured folder organization.","archived":false,"fork":false,"pushed_at":"2025-09-02T13:22:58.000Z","size":40,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T15:27:01.837Z","etag":null,"topics":["alembic","best-practice-api","best-practices","best-structur-folder","deta-space","fastapi","python"],"latest_commit_sha":null,"homepage":"https://bookapi-1-v1905306.deta.app/","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/yudhaislamisulistya.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-10T16:54:15.000Z","updated_at":"2025-09-02T13:23:00.000Z","dependencies_parsed_at":"2023-08-10T23:16:41.957Z","dependency_job_id":"f9ab9729-d2c2-4f2f-a95d-1c4098ee3591","html_url":"https://github.com/yudhaislamisulistya/book-api-fastapi","commit_stats":null,"previous_names":["yudhaislamisulistya/book-api-fastapi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yudhaislamisulistya/book-api-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yudhaislamisulistya%2Fbook-api-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yudhaislamisulistya%2Fbook-api-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yudhaislamisulistya%2Fbook-api-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yudhaislamisulistya%2Fbook-api-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yudhaislamisulistya","download_url":"https://codeload.github.com/yudhaislamisulistya/book-api-fastapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yudhaislamisulistya%2Fbook-api-fastapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["alembic","best-practice-api","best-practices","best-structur-folder","deta-space","fastapi","python"],"created_at":"2026-01-17T13:06:15.259Z","updated_at":"2026-01-17T13:06:15.320Z","avatar_url":"https://github.com/yudhaislamisulistya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Book with FastAPI and Alembic\n[![CodeFactor](https://www.codefactor.io/repository/github/yudhaislamisulistya/book-api-fastapi/badge)](https://www.codefactor.io/repository/github/yudhaislamisulistya/book-api-fastapi)\nThis project provides a simple structure for creating a FastAPI-based web application for managing books, along with Alembic for database migrations. It is designed with beginners in mind and follows a structured folder organization.\n\n## Prerequisites\n\n- Python 3.9\n- [Deta](https://deta.space/) account for deployment (optional but recommended)\n\n## Getting Started\n\n1. Clone this repository:\n\n   ```bash\n   git clone https://github.com/yudhaislamisulistya/book-api-fastapi.git\n   cd book-api-fastapi\n   ```\n\n2. Install the project dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n3. Run command for migration database:\n   ```bash\n   alembic revision --autogenerate\n   or\n   alembic upgrade head\n   ```\n4. Run the application locally using the following command:\n\n   ```bash\n   uvicorn main:app --reload\n   ```\n\n   Or, if you want to use Deta for deployment:\n\n   - Create an account on [Deta](https://deta.space/).\n   - Install Deta CLI:\n\n     ```bash\n     curl -fsSL https://get.deta.dev/space-cli.sh | sh\n     ```\n\n   - Initialize a Deta project and deploy:\n\n     ```bash\n     space new\n     space push\n     ```\n\n   - or Alternative with Space CLI\n     ```bash\n     space dev\n     ```\n\n   - Obtain the token and project ID from Deta and update them in `deploy.yml` for CI/CD setup.\n\n5. Access the application at the following URL (if using Deta):\n\n   ```\n   https://bookapi-1-v1905306.deta.app/\n   or\n   http://localhost:8080/\n   ```\n\n6. Access the API documentation at the following URL:\n\n   ```\n   https://bookapi-1-v1905306.deta.app/docs\n   or\n   http://localhost:8080/docs\n   ```\n\n## Example Endpoints\n\nHere are some example endpoints that you can use:\n\n### Read Books\n\n**GET** `/api/v1/books/`\n\nRetrieves a list of all books.\n\n### Create Book\n\n**POST** `/api/v1/books/`\n\nCreates a new book.\n\n### Delete Book\n\n**DELETE** `/api/v1/books/{book_id}`\n\nDeletes a book by its ID.\n\n## Schemas\n\n- `BookInput` - Schema for creating a book.\n- `BookOutput` - Schema for the book response.\n\n## Project Structure\n\nThe project follows this folder structure:\n\n- `.github/workflows` - GitHub Actions workflows\n- `alembic` - Alembic database migration scripts\n- `app` - Main application code\n  - `configs` - Database configuration\n  - `controllers` - Controllers for business logic\n  - `endpoints` - API endpoints\n  - `libs` - Utility libraries (databases and templates)\n  - `model` - Database table structures\n  - `routes` - API routes\n  - `schemas` - Pydantic request and response schemas\n  - `tests` - Unit tests\n  - `utils` - Additional utility libraries\n- `Spacefile` - Deta configuration\n- `main.py` - FastAPI application entry point\n- `requirements.txt` - Project dependencies\n\n## Contribution\n\nFeel free to contribute to this project by submitting pull requests. Your contributions can help improve and expand this beginner-friendly FastAPI and Alembic structure.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\u003c!-- Security scan triggered at 2025-09-02 15:22:57 --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyudhaislamisulistya%2Fbook-api-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyudhaislamisulistya%2Fbook-api-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyudhaislamisulistya%2Fbook-api-fastapi/lists"}