{"id":24829488,"url":"https://github.com/sid-146/fastapi-template","last_synced_at":"2026-05-04T02:37:31.495Z","repository":{"id":274864441,"uuid":"924271308","full_name":"sid-146/fastapi-template","owner":"sid-146","description":"Template for fastapi based project","archived":false,"fork":false,"pushed_at":"2025-03-10T19:39:16.000Z","size":9,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T19:42:20.148Z","etag":null,"topics":["fastapi","python","template-generic-repo"],"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/sid-146.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":"2025-01-29T17:58:50.000Z","updated_at":"2025-03-10T19:12:06.000Z","dependencies_parsed_at":"2025-01-29T20:36:05.197Z","dependency_job_id":"3d3b119d-5dd5-429f-a7a5-cb7cbadd5f96","html_url":"https://github.com/sid-146/fastapi-template","commit_stats":null,"previous_names":["sid-146/fastapi-template"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sid-146%2Ffastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sid-146%2Ffastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sid-146%2Ffastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sid-146%2Ffastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sid-146","download_url":"https://codeload.github.com/sid-146/fastapi-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573896,"owners_count":20637674,"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":["fastapi","python","template-generic-repo"],"created_at":"2025-01-30T23:26:05.911Z","updated_at":"2026-05-04T02:37:26.465Z","avatar_url":"https://github.com/sid-146.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Pylint](https://github.com/sid-146/fastapi-template/actions/workflows/pylint.yml/badge.svg?branch=main)](https://github.com/sid-146/fastapi-template/actions/workflows/pylint.yml)\n\n# FastAPI Template Repository\n\nThis repository provides a fast and easy starting point for building RESTful APIs with [FastAPI](https://fastapi.tiangolo.com/). It includes a minimal, yet comprehensive setup to get you up and running quickly, with sensible defaults for projects of any size.\n\n## Features\n\n-   **FastAPI**: Fast and modern web framework for building APIs with Python 3.7+.\n-   **SQLAlchemy**: ORM for interacting with databases.\n-   **Alembic**: For database migrations.\n-   **Pydantic**: For data validation and serialization.\n-   **Docker**: Containerization setup for easy deployment.\n-   **Testing**: Setup for unit tests and integration tests.\n-   **Pre-configured CORS**: Easily configurable for cross-origin requests.\n-   **Environment configuration**: Manage environment variables with `.env` files.\n-   **Swagger UI**: Automatic generation of API documentation.\n\n## Getting Started\n\n### Prerequisites\n\nMake sure you have the following tools installed:\n\n-   Python 3.8 (preferably 3.9 or higher)\n-   [Docker](https://www.docker.com/)\n-   [Poetry](https://python-poetry.org/) (optional, for dependency management)\n\n### Clone the Repository\n\nStart by cloning this repository to your local machine:\n\n```bash\ngit clone https://github.com/sid-146/fastapi-template.git\ncd fastapi-template\n```\n\n### Create Virtual Env\n\nUsing python `venv` module create a virtual environment\n\n```bash\npython -m venv venv\n```\n\nor\n\n```bash\npy -m venv venv\n```\n\n### Activate Virtual Env\n\nNavigate to Scripts in virtual environment.\n\n```bash\ncd venv/Scripts\n```\n\nrun `activate` script. After this your environment will be activated.\n\n### Install Dependencies\n\nUsing `pip` (for standard Python environments):\n\n```bash\npip install -r requirements.txt\n```\n\nOr using `Poetry`:\n\n```bash\npoetry install\n```\n\n### Configure Environment Variables\n\nCopy the example environment file and edit the values as necessary:\n\n```bash\ncp .env.example .env\n```\n\nMake sure to update your `.env` file with the appropriate settings for your local environment (e.g., database URL, secret keys).\n\n### Run the Application\n\nTo run the application, you can use the following command:\n\n```bash\nuvicorn app.main:app --reload\n```\n\nOr Run using `app.py` file\n\n```bash\ncd src\npy app.py\n```\n\nThis will start the FastAPI server at `http://localhost:8000`.\n\n### Docker Setup (Optional)\n\nIf you prefer using Docker to run the application, you can build and start a container using:\n\n```bash\ndocker-compose up --build\n```\n\nOnce the container is up, the app will be accessible at `http://localhost:8000`.\n\n## Project Structure\n\n```plaintext\nfastapi-template/\n├── src/\n│   ├── app.py                      # FastAPI application instance\n│   ├── models/                     # Database models\n├── ├── api/\n├── ├──  ├──  __init__.py           # Holds all the routers created in routes folder\n├── ├──  ├──  routes/               # Routes of different endpoint\n├── ├──  ├──  middleware/           # Middleware required\n├── ├──  ├──  models/               # Models for request and respones\n├── ├──  ├──   ├── requests/        # Requests models\n├── ├──  ├──   ├── responses/       # Responses models\n├── ├──  ├──  functions/            # Business Logic Functions\n├── ├── components/\n├── ├── core/                       # Core config like server starting config\n├── ├──  ├── config.py              # Config flie\n├── ├── db/\n├── ├──  ├── models/                # DB Models\n├── ├──  ├── scripts/               # DB Scripts\n├── ├── utils/\n├── ├── test/\n├── alembic/                        # Database migrations\n├── .env.example                    # Example environment configuration file\n├── Dockerfile                      # Dockerfile for containerizing the app (todo)\n├── docker-compose.yml              # Docker Compose configuration (todo)\n├── requirements.txt                # Python dependencies\n└── README.md                       # This file\n```\n\n## Testing\n\nTo run tests, use the following command:\n\n```bash\npytest\n```\n\nMake sure that your test cases are properly configured in the `tests/` folder.\n\n## Deployment\n\nThis template is ready for deployment with Docker and can be deployed on any platform that supports Docker (e.g., AWS, Heroku, DigitalOcean).\n\nYou can also deploy directly to a cloud service like [Uvicorn with Gunicorn](https://www.uvicorn.org/) for better production performance.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## To use this\n\nFeel free to customize this as needed by forking this repository 🍴!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsid-146%2Ffastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsid-146%2Ffastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsid-146%2Ffastapi-template/lists"}