https://github.com/anqorithm/fastapi-sub-modules
https://github.com/anqorithm/fastapi-sub-modules
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anqorithm/fastapi-sub-modules
- Owner: anqorithm
- Created: 2025-01-23T06:58:27.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-29T18:30:32.000Z (4 months ago)
- Last Synced: 2025-02-15T18:53:42.130Z (3 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Modular App with Git Submodules (POC)
A proof of concept demonstrating how to build a modular FastAPI application using Git submodules as packages.
## Key Concepts
- **Git Submodules**: Used as independent packages, allowing for modular development.
- **Shared Dependencies**: Ensures that all modules can share common dependencies, reducing redundancy.
- **Centralized FastAPI App Integration**: Combines all modules into a single FastAPI application.
- **Poetry**: Utilized for managing dependencies and virtual environments.## Quick Start
1. **Clone the Repository with Submodules**:
Use the following command to clone the repository along with its submodules:
```bash
git clone --recurse-submodules https://github.com/anqorithm/fastapi-sub-modules.git
```2. **Install Dependencies**:
Navigate to the project directory and install dependencies using Poetry:
```bash
poetry install
```3. **Activate the Virtual Environment**:
Activate the virtual environment created by Poetry:
```bash
poetry shell
```4. **Run the Application**:
Start the FastAPI application using Uvicorn:
```bash
poetry run uvicorn src.main:app --reload
```5. **Explore the API**:
Open your browser and navigate to `http://localhost:8000/docs` to explore the API documentation provided by FastAPI's interactive Swagger UI.This setup is particularly useful for projects that require a modular architecture, allowing different teams to work on separate modules independently while still integrating them into a single application. The use of Git submodules helps in managing these modules as separate repositories, which can be beneficial for version control and collaboration.