{"id":15142640,"url":"https://github.com/simonmacor/fastapi-starter","last_synced_at":"2026-01-19T18:31:48.014Z","repository":{"id":256048694,"uuid":"854165968","full_name":"simonmacor/fastapi-starter","owner":"simonmacor","description":"FastAPI Starter Kit – a base project designed to help you develop web applications using Python and the FastAPI framework.","archived":false,"fork":false,"pushed_at":"2024-09-08T18:56:54.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T15:54:25.079Z","etag":null,"topics":["alembic","bdd","behave","fastapi","mountebank","pytest","python3","sqlalchemy"],"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/simonmacor.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-09-08T14:52:54.000Z","updated_at":"2024-09-08T18:56:52.000Z","dependencies_parsed_at":"2024-11-01T13:00:56.243Z","dependency_job_id":null,"html_url":"https://github.com/simonmacor/fastapi-starter","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"105d6408af8596b7a2efd0c48861b426364b7763"},"previous_names":["simonmacor/fastapi-starter"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/simonmacor/fastapi-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonmacor%2Ffastapi-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonmacor%2Ffastapi-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonmacor%2Ffastapi-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonmacor%2Ffastapi-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonmacor","download_url":"https://codeload.github.com/simonmacor/fastapi-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonmacor%2Ffastapi-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28580186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T18:29:59.827Z","status":"ssl_error","status_checked_at":"2026-01-19T18:29:40.878Z","response_time":67,"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","bdd","behave","fastapi","mountebank","pytest","python3","sqlalchemy"],"created_at":"2024-09-26T09:43:13.663Z","updated_at":"2026-01-19T18:31:47.999Z","avatar_url":"https://github.com/simonmacor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/simonmacor/fastapi-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/simonmacor/fastapi-starter/actions/workflows/ci.yml)\n\n# FastAPI Starter Kit\n\n**FastAPI Starter Kit** – a base project designed to help you develop web applications using Python and the **FastAPI** framework. This starter kit is built to simplify backend development with a pre-configured architecture for testing, database management, and mocking third-party services.\n\n## Features\n\n- **FastAPI Framework**: A modern and fast framework for building web APIs with Python.\n- **BDD Testing with Behave**: Use behavior-driven development (BDD) for scenario-based testing.\n- **Unit Testing with Pytest**: Pre-configured for unit and functional tests.\n- **SQLAlchemy**: ORM (Object-Relational Mapper) for database interaction.\n- **Alembic**: A database schema migration tool for managing schema changes.\n- **Mountebank**: Mock third-party services with imposters for integration testing.\n- **PostgreSQL**: Latest version of PostgreSQL as the default database.\n- **Adminer**: A web-based tool to easily manage the PostgreSQL database.\n\n## Prerequisites\n\n- **Docker** and **Docker Compose** must be installed on your machine.\n\n## Installation\n\n1. Clone this repository:\n\n   ```bash\n   git clone https://github.com/your-project/fastapi-web-starter-kit.git\n   cd fastapi-web-starter-kit\n   ```\n\n2. Install Python dependencies (if working locally without Docker):\n\n   ```bash\n   python3 -m venv env\n   source env/bin/activate\n   pip install -r requirements.txt\n   ```\n\n3. Start the application using Docker Compose:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n4. Access the FastAPI application at [http://localhost:8000](http://localhost:8000).\n5. Access **Adminer** to manage the database at [http://localhost:8080](http://localhost:8080).\n\n## Important Files\n\n- **`requirements.txt`**: Contains the necessary Python libraries.\n  - [FastAPI Documentation](https://fastapi.tiangolo.com/)\n  - [Behave Documentation](https://behave.readthedocs.io/en/latest/)\n  - [Pytest Documentation](https://docs.pytest.org/en/6.2.x/)\n  - [SQLAlchemy Documentation](https://docs.sqlalchemy.org/en/14/)\n  - [Alembic Documentation](https://alembic.sqlalchemy.org/en/latest/)\n  \n- **`docker-compose.yml`**: Docker configuration for the application, including PostgreSQL, Adminer, and Mountebank.\n\n- **`alembic/`**: Directory for database migrations using Alembic.\n\n- **`tests/`**: Directory for unit, functional, and BDD tests.\n\n- **`imposters.ejs`**: Configuration file for Mountebank, allowing you to mock third-party services.\n\n## Included Services\n\n### FastAPI\n\nFastAPI is used to create fast and performant RESTful APIs. The application is available at [http://localhost:8000](http://localhost:8000).\n\n- [FastAPI Documentation](https://fastapi.tiangolo.com/)\n\n### PostgreSQL and Adminer\n\nPostgreSQL is the database configured with the latest version, and you can manage it via **Adminer** at [http://localhost:8080](http://localhost:8080).\n\n- [PostgreSQL Documentation](https://www.postgresql.org/docs/)\n- [Adminer Documentation](https://www.adminer.org/)\n\n### Mountebank\n\nMountebank is configured to simulate third-party services and test API integrations. Imposter configuration is stored in the `imposters.ejs` file.\n\n- [Mountebank Documentation](http://www.mbtest.org/docs/gettingStarted)\n\n### Testing\n\n- **BDD with Behave**: BDD scenarios are defined in the `features/` directory.\n  - [Behave Documentation](https://behave.readthedocs.io/en/latest/)\n\n- **Unit and Functional Testing with Pytest**: Traditional tests are located in the `tests/` directory.\n  - [Pytest Documentation](https://docs.pytest.org/en/6.2.x/)\n\n### Database Migrations\n\nDatabase schema migrations are managed via Alembic. Use the following commands to create and apply migrations:\n\n```bash\n# Create a new migration\nalembic revision --autogenerate -m \"Migration name\"\n\n# Apply migrations\nalembic upgrade head\n```\n\n- [Alembic Documentation](https://alembic.sqlalchemy.org/en/latest/)\n\n## Useful Commands\n\n- **Start the application:**\n\n  ```bash\n  docker-compose up --build\n  ```\n\n- **Apply database migrations:**\n\n  ```bash\n  docker-compose exec app alembic upgrade head\n  ```\n\n- **Run unit and functional tests:**\n\n  ```bash\n  docker-compose exec app pytest\n  ```\n\n- **Run BDD tests:**\n\n  ```bash\n  docker-compose exec app behave\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonmacor%2Ffastapi-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonmacor%2Ffastapi-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonmacor%2Ffastapi-starter/lists"}