{"id":26045106,"url":"https://github.com/murungaowen/fast-api_starter_template","last_synced_at":"2026-04-11T11:44:34.432Z","repository":{"id":280996912,"uuid":"943795807","full_name":"MurungaOwen/fast-api_starter_template","owner":"MurungaOwen","description":"This is a fast api starter template for backend projects that are to use SQL alchemy as ORM, postgresql, rabbit mq.","archived":false,"fork":false,"pushed_at":"2025-03-06T11:57:34.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T12:38:55.139Z","etag":null,"topics":["backend","docker","fastapi","fastapi-template","postgresql","python","rabbitmq","sqlalchemy"],"latest_commit_sha":null,"homepage":"","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/MurungaOwen.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}},"created_at":"2025-03-06T09:26:42.000Z","updated_at":"2025-03-06T12:02:52.000Z","dependencies_parsed_at":"2025-03-06T12:49:04.258Z","dependency_job_id":null,"html_url":"https://github.com/MurungaOwen/fast-api_starter_template","commit_stats":null,"previous_names":["murungaowen/fast-api_starter_template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MurungaOwen/fast-api_starter_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MurungaOwen%2Ffast-api_starter_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MurungaOwen%2Ffast-api_starter_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MurungaOwen%2Ffast-api_starter_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MurungaOwen%2Ffast-api_starter_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MurungaOwen","download_url":"https://codeload.github.com/MurungaOwen/fast-api_starter_template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MurungaOwen%2Ffast-api_starter_template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259957270,"owners_count":22937544,"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":["backend","docker","fastapi","fastapi-template","postgresql","python","rabbitmq","sqlalchemy"],"created_at":"2025-03-07T19:31:34.580Z","updated_at":"2026-04-11T11:44:34.381Z","avatar_url":"https://github.com/MurungaOwen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Backend Project\n\nThis Template is a FastAPI backend-only application that uses SQLAlchemy for ORM, RabbitMQ for messaging, and PostgreSQL as the database. The structure is organized to maintain clean separation of concerns and follows best practices for a scalable and maintainable project.\n\n## Folder Structure\n\n```plaintext\nmyproject/\n├── src/\n│   ├── core/\n│   │   ├── __init__.py\n│   │   ├── config.py\n│   │   ├── security.py\n│   │   └── dependencies.py\n│   ├── main.py\n│   ├── models/\n│   │   ├── user.py # sample model, you'll add others below\n│   │   └── __init__.py\n│   ├── routers/\n│   │   ├── user.py\n│   │   └── __init__.py\n│   ├── schemas/\n│   │   ├── user.py\n│   │   └── __init__.py\n│   ├── services/\n│   │   ├── __init__.py\n│   │   ├── database.py\n│   │   ├── rabbitmq.py\n│   │   └── user.py\n│   └── utils/\n│       ├── __init__.py\n│       ├── logger.py\n│       ├── common.py\n│       └── email.py\n├── docker-compose.yml\n├── requirements.txt\n├── Dockerfile\n└── README.md\n```\n\n### Explanation of Folder Structure\n\n- **src/**: Main source directory.\n  - **core/**: Core utilities and configurations.\n    - **config.py**: Configuration settings (e.g., environment variables).\n    - **security.py**: Security-related functions (e.g., password hashing).\n    - **dependencies.py**: Common dependencies to be injected into routes.\n  - **main.py**: The entry point of the FastAPI application.\n  - **models/**: Database models.\n    - **user.py**: Database model for the user entity.\n  - **routers/**: API routers.\n    - **user.py**: API routes for user operations.\n  - **schemas/**: Pydantic schemas for data validation and serialization.\n    - **user.py**: Pydantic schemas for the user entity.\n  - **services/**: Business logic and service layer.\n    - **database.py**: Database connection and session management.\n    - **rabbitmq.py**: RabbitMQ connection and utility functions.\n    - **user.py**: Business logic for user-related operations.\n  - **utils/**: Utility functions and helpers.\n    - **logger.py**: Logging configuration and utilities.\n    - **common.py**: Common utility functions.\n    - **email.py**: Email sending utilities.\n\n### Docker and Requirements\n\n- **docker-compose.yml**: Docker Compose file for setting up the application with PostgreSQL and RabbitMQ.\n- **requirements.txt**: List of Python dependencies for the project.\n- **Dockerfile**: Dockerfile for building the FastAPI application container.\n\n### Getting Started\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/MurungaOwen/fast-api_starter_template.git\n   cd fast-api_starter_template\n   ```\n\n2. **Set up the environment**:\n   Create a `.env` file in the root directory and add the necessary environment variables.\n\n3. **Build and run the application**:\n   ```bash\n   docker-compose up --build\n   ```\n\n4. **Access the API**:\n   The API will be available at `http://localhost:8000`.\n\n### Usage\n\n#### Logging\n\nThe `logger.py` file provides a simple logging setup:\n\n```python\nfrom src.utils.logger import get_logger\n\nlogger = get_logger(__name__)\n\nlogger.info(\"This is an info message\")\nlogger.error(\"This is an error message\")\n```\n\n#### API Endpoints\n\n- **Root Endpoint**: `GET /` - Returns a \"Hello World\" message.\n- **User Endpoint**: `POST /users/` - Creates a new user.\n\n### Contributing\n\nContributions are welcome! Please submit a pull request or open an issue to discuss changes.\n\n### License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurungaowen%2Ffast-api_starter_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurungaowen%2Ffast-api_starter_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurungaowen%2Ffast-api_starter_template/lists"}