{"id":24534400,"url":"https://github.com/labelementary/fastapi-essential","last_synced_at":"2026-04-28T14:34:46.365Z","repository":{"id":273237205,"uuid":"919044078","full_name":"labelementary/fastapi-essential","owner":"labelementary","description":"FastAPI Essential, An Essential Template to get started with FastAPI application with all the essentials included.","archived":false,"fork":false,"pushed_at":"2026-03-19T17:38:26.000Z","size":212,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-20T09:24:18.071Z","etag":null,"topics":["astral-ty","fastapi","python","ruff","uv"],"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/labelementary.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":"2025-01-19T15:12:37.000Z","updated_at":"2026-03-19T17:39:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a226e68-15e4-49cf-afb6-4d30602ded2a","html_url":"https://github.com/labelementary/fastapi-essential","commit_stats":null,"previous_names":["labelementary/fastapi-essential"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/labelementary/fastapi-essential","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labelementary%2Ffastapi-essential","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labelementary%2Ffastapi-essential/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labelementary%2Ffastapi-essential/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labelementary%2Ffastapi-essential/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labelementary","download_url":"https://codeload.github.com/labelementary/fastapi-essential/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labelementary%2Ffastapi-essential/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32385252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: 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":["astral-ty","fastapi","python","ruff","uv"],"created_at":"2025-01-22T11:17:07.917Z","updated_at":"2026-04-28T14:34:46.359Z","avatar_url":"https://github.com/labelementary.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Essential\n\nFastAPI Essential, Pre-Configured FastAPI Project with all essential dependencies and configurations for a robust and scalable FastAPI application.\n\n## Project Setup\n\nFollow these steps to set up your development environment for the first time.\n\n### Prerequisites\n\n*   Python 3.12 or newer.\n*   [UV](https://github.com/astral-sh/uv) installed. This project uses `uv` for package and environment management.\n\n### First-Time Installation\n\n1.  **Clone the Repository**\n    ```bash\n    git clone \u003cyour-repository-url\u003e\n    cd fastapi-essential\n    ```\n\n2.  **Install All Dependencies**\n    Run the following single command. It will automatically create a virtual environment, install all production and development dependencies, and install the project itself in \"editable\" mode.\n    ```bash\n    uv sync --dev\n    ```\n    This command creates a `uv.lock` file, which should be committed to your repository to ensure all developers use the exact same package versions.\n\n3.  **Initialize Pre-Commit Hooks**\n    Set up pre-commit hooks to automatically format and lint your code before each commit. This is crucial for maintaining code quality.\n    ```bash\n    uv run pre-commit install\n    ```\n\n## Development Workflow\n\n### Running the Application\n\nTo start the FastAPI development server with live reloading, run:\n\n```bash\nuv run uvicorn src.main:app --reload --port 7070\n```\nor use the following command:\n\n```bash\nuv run fastapi dev ./src/main.py --reload --port 7070\n```\n\n*   `uvicorn` is the ASGI server that runs your FastAPI application.\n*   `src.main:app` points to the `app` object inside the `src/main.py` file.\n*   `--reload` automatically restarts the server when you make code changes.\n\n### Daily Dependency Management\n\nTo ensure your local environment is perfectly synchronized with the project's lock file (`uv.lock`), especially after pulling changes from git, run:\n\n```bash\nuv sync --dev\n```\nThis command installs any new packages and, importantly, removes any that are no longer required, preventing environment conflicts.\n\n## Code Quality Tools\n\nWhile pre-commit handles checks automatically, you can—and should—run these tools manually to format your code and get immediate feedback.\n\n### 1. Linting and Formatting with Ruff\n\nRuff is an extremely fast linter and code formatter.\n\n*   **Format your code:**\n    This command reformats all files in the `src` directory to match the project's style.\n    ```bash\n    uv run ruff format src\n    ```\n\n*   **Check for errors and auto-fix them:**\n    This command finds potential bugs and style issues, and automatically fixes anything it can.\n    ```bash\n    uv run ruff check src --fix\n    ```\n\n### 2. Static Type Checking with Ty\n\nTy checks your code for type errors, helping you catch bugs before you even run the application.\n\n*   **Run a one-time check:**\n    ```bash\n    uv run ty check\n    ```\n    If there are no errors, the command will finish silently. Otherwise, it will print a detailed report.\n\n*   **Run in \"watch\" mode for live feedback (Recommended):**\n    This command provides instant feedback in your terminal every time you save a file.\n    ```bash\n    uv run ty check --watch\n    ```\n\n## Folder Structure\n\nThe project is organized using a modern `src` layout.\n\n```\n/fastapi-essential\n├── .github/             # GitHub Actions workflows\n├── alembic/             # Alembic database migration scripts\n├── src/                 # Main application source code\n│   ├── configs/         # Holds All Configuration (database, settings)\n│   ├── modules/         # Holds Business Logic Modules (Modular Monolithic)\n│   ├── routes/          # Holds All Services Routers Includes\n│   │   └── user.py/     # Holds User Specific Routers Includes\n│   ├── utils/           # Holds Utility \u0026 Helpers Functions used Gloablly\n│   ├── __init__.py\n│   └── logs.py          # Logs Configurations\n│   └── main.py          # FastAPI Application Entry Point\n├── tests/               # Unit and integration Tests Cases\n├── .gitignore\n├── .pre-commit-config.yaml # Configuration for pre-commit hooks\n├── pyproject.toml       # Project metadata, dependencies, and tool configs (Ruff, Pyright)\n├── README.md            # This file\n└── uv.lock              # Lockfile for reproducible builds```\n\n*   **`src/`**: All the application's Python code lives here. This separation prevents common import issues.\n*   **`alembic/`**: Handles database schema migrations.\n*   **`pyproject.toml`**: The single configuration file for the entire project. It defines dependencies and configures tools like Ruff and Pyright.\n*   **`uv.lock`**: A lockfile that guarantees identical environments for all developers and in production.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabelementary%2Ffastapi-essential","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabelementary%2Ffastapi-essential","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabelementary%2Ffastapi-essential/lists"}