{"id":28461291,"url":"https://github.com/hngprojects/fastapi-book-project","last_synced_at":"2026-01-20T17:26:17.475Z","repository":{"id":295558354,"uuid":"932260660","full_name":"hngprojects/fastapi-book-project","owner":"hngprojects","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-13T16:22:22.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":145,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-07T03:08:26.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hngprojects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-02-13T16:21:56.000Z","updated_at":"2025-02-13T16:22:25.000Z","dependencies_parsed_at":"2025-05-26T07:21:08.064Z","dependency_job_id":"dca18fc9-27a9-4589-a8c2-6f379f7f5801","html_url":"https://github.com/hngprojects/fastapi-book-project","commit_stats":null,"previous_names":["hngprojects/fastapi-book-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hngprojects/fastapi-book-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hngprojects%2Ffastapi-book-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hngprojects%2Ffastapi-book-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hngprojects%2Ffastapi-book-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hngprojects%2Ffastapi-book-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hngprojects","download_url":"https://codeload.github.com/hngprojects/fastapi-book-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hngprojects%2Ffastapi-book-project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263290443,"owners_count":23443599,"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":[],"created_at":"2025-06-07T03:08:26.086Z","updated_at":"2026-01-20T17:26:17.451Z","avatar_url":"https://github.com/hngprojects.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Book Management API\n\n## Overview\n\nThis project is a RESTful API built with FastAPI for managing a book collection. It provides comprehensive CRUD (Create, Read, Update, Delete) operations for books with proper error handling, input validation, and documentation.\n\n## Features\n\n- 📚 Book management (CRUD operations)\n- ✅ Input validation using Pydantic models\n- 🔍 Enum-based genre classification\n- 🧪 Complete test coverage\n- 📝 API documentation (auto-generated by FastAPI)\n- 🔒 CORS middleware enabled\n\n## Project Structure\n\n```\nfastapi-book-project/\n├── api/\n│   ├── db/\n│   │   ├── __init__.py\n│   │   └── schemas.py      # Data models and in-memory database\n│   ├── routes/\n│   │   ├── __init__.py\n│   │   └── books.py        # Book route handlers\n│   └── router.py           # API router configuration\n├── core/\n│   ├── __init__.py\n│   └── config.py           # Application settings\n├── tests/\n│   ├── __init__.py\n│   └── test_books.py       # API endpoint tests\n├── main.py                 # Application entry point\n├── requirements.txt        # Project dependencies\n└── README.md\n```\n\n## Technologies Used\n\n- Python 3.12\n- FastAPI\n- Pydantic\n- pytest\n- uvicorn\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/hng12-devbotops/fastapi-book-project.git\ncd fastapi-book-project\n```\n\n2. Create a virtual environment:\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. Install dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n## Running the Application\n\n1. Start the server:\n\n```bash\nuvicorn main:app\n```\n\n2. Access the API documentation:\n\n- Swagger UI: http://localhost:8000/docs\n- ReDoc: http://localhost:8000/redoc\n\n## API Endpoints\n\n### Books\n\n- `GET /api/v1/books/` - Get all books\n- `GET /api/v1/books/{book_id}` - Get a specific book\n- `POST /api/v1/books/` - Create a new book\n- `PUT /api/v1/books/{book_id}` - Update a book\n- `DELETE /api/v1/books/{book_id}` - Delete a book\n\n### Health Check\n\n- `GET /healthcheck` - Check API status\n\n## Book Schema\n\n```json\n{\n  \"id\": 1,\n  \"title\": \"Book Title\",\n  \"author\": \"Author Name\",\n  \"publication_year\": 2024,\n  \"genre\": \"Fantasy\"\n}\n```\n\nAvailable genres:\n\n- Science Fiction\n- Fantasy\n- Horror\n- Mystery\n- Romance\n- Thriller\n\n## Running Tests\n\n```bash\npytest\n```\n\n## Error Handling\n\nThe API includes proper error handling for:\n\n- Non-existent books\n- Invalid book IDs\n- Invalid genre types\n- Malformed requests\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit changes (`git commit -m 'Add AmazingFeature'`)\n4. Push to branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nFor support, please open an issue in the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhngprojects%2Ffastapi-book-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhngprojects%2Ffastapi-book-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhngprojects%2Ffastapi-book-project/lists"}