{"id":15567236,"url":"https://github.com/iml1111/imfast","last_synced_at":"2025-04-24T00:02:50.178Z","repository":{"id":40612247,"uuid":"507339790","full_name":"iml1111/IMFast","owner":"iml1111","description":"Boilerplate for Large Scale FastAPI Web Backend Structure","archived":false,"fork":false,"pushed_at":"2024-04-11T03:07:40.000Z","size":44,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:02:35.996Z","etag":null,"topics":["boilerplate","fastapi","python"],"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/iml1111.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":"2022-06-25T14:57:02.000Z","updated_at":"2024-09-09T05:34:03.000Z","dependencies_parsed_at":"2025-03-06T22:41:32.889Z","dependency_job_id":null,"html_url":"https://github.com/iml1111/IMFast","commit_stats":null,"previous_names":[],"tags_count":11,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2FIMFast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2FIMFast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2FIMFast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2FIMFast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iml1111","download_url":"https://codeload.github.com/iml1111/IMFast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535088,"owners_count":21446507,"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":["boilerplate","fastapi","python"],"created_at":"2024-10-02T17:10:27.309Z","updated_at":"2025-04-24T00:02:50.138Z","avatar_url":"https://github.com/iml1111.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![imfast](https://user-images.githubusercontent.com/29897277/178490130-561c60cd-5e77-47c8-a5a4-239c908a1b13.png)\n# IMFast\n**Boilerplate for Large Scale FastAPI Web Backend Structure (Edited 2022-07-12)**\n\nThis is boilerplate, assuming you are building a large-scale application server using `FastAPI`.\n\nI look forward to your feedback.\n\nIf you use Mongodb with `Motor`, I recommend this.\n\n- [IMFast-Motor](https://github.com/iml1111/IMFast-Motor)\n\n## Dependency\n\n- python 3.9+\n- FastAPI \u003e= 0.78\n- uvicorn \u003e= 0.18.2\n\nIn IMFast, the following libraries are additionally installed for convenient development.\n\n```\n- python-dotenv\n- orjson\n- pytest\n- jinja2\n- loguru\n- python-jose[cryptography]\n- passlib[bcrypt]\n- requests\n- httpx\n- trio\n```\n\n## Environment variables\n\nTo run the application, you need to set the following environment variables.\n\nFor the `python-dotenv` library, you can write an `dev.env` file in the same path as `settings.py`, or you can directly enter an environment variable.\n\n```\n- APP_NAME\n- {APP_NAME}_SECRET_KET\n- {APP_NAME}_SLOW_API_TIME\n...\n```\n\nBut, since default values are defined for all environment variables, it can be executed immediately.\n\n## Get Started\n\n```shell\n$ git clone https://github.com/iml1111/IMFast\n$ cd IMFast/\n\n# virtualenv (if necessary)\n$ python3 -m venv venv\n$ source ./venv/bin/activate\n\n# Install dependency\n$ cd IMFlask/\n$ pip install -r requirements.txt\n\n# App test\n$ ./imfast test\ntest/test_basics.py::test_app_exists PASSED                                        [  9%]\ntest/test_basics.py::test_index_page[asyncio] PASSED                               [ 18%]\ntest/test_basics.py::test_index_page[trio] PASSED                                  [ 27%]\ntest/test_basics.py::test_404_page[asyncio] PASSED                                 [ 36%]\ntest/test_basics.py::test_404_page[trio] PASSED                                    [ 45%]\ntest/test_sample.py::test_get_champion[asyncio] PASSED                             [ 54%]\ntest/test_sample.py::test_get_champion[trio] PASSED                                [ 63%]\ntest/test_sample.py::test_create_champion[asyncio] PASSED                          [ 72%]\ntest/test_sample.py::test_create_champion[trio] PASSED                             [ 81%]\ntest/test_sample.py::test_bad_request_api[asyncio] PASSED                          [ 90%]\ntest/test_sample.py::test_bad_request_api[trio] PASSED                             [100%]\n\n11 passed in 0.24s.\n\n$ App start\n$ ./imfast run\nINFO:     Will watch for changes in these directories:\nINFO:     Uvicorn running on http://127.0.0.1:5000 (Press CTRL+C to quit)\nINFO:     Started reloader process [4053] using StatReload\nINFO:     Started server process [4093]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\n```\n\n## Commands\n\nYou can try various commands in the form of `imfast \u003ccommand\u003e`. The command codes are written in `main.py`.\n\n```shell\n$ ./imfast --help\nUsage: main.py [OPTIONS] COMMAND [ARGS]...\n\n  Command Groups\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  init-db   Sample command\n  prod-run  Please use 'imfast prod-run'.\n  routes    Print all routes\n  run       Please use 'imfast run'.\n  test      Run tests\n  \n$ ./imfast routes\n# Routes\nPath ======================= Methods ======= Name ==============\n/                           {'GET'}          index\n/api/auth/me                {'GET'}          me\n/api/auth/refresh           {'POST'}         refresh\n/api/auth/signin            {'POST'}         login\n/api/v1/champion            {'GET'}          get_champion\n/api/v1/champion            {'POST'}         create_champion\n/api/v1/sample/bad_request  {'PUT'}          bad_request_api\n/api/v1/sample/error        {'POST'}         error\n/api/v1/sample/slow         {'GET'}          slow\n/docs                       {'HEAD', 'GET'}  swagger_ui_html\n/docs/oauth2-redirect       {'HEAD', 'GET'}  swagger_ui_redirect\n/openapi.json               {'HEAD', 'GET'}  openapi\n/redoc                      {'HEAD', 'GET'}  redoc_html\n```\n\n`IMFast/imfast` is simple shell script, Help your fastapi development. \n\nIf you want to check the script detail, click [here.](https://github.com/iml1111/IMFast/blob/main/IMFast/imfast)\n\n\n\n# Concepts\n\n### Application Factory\n\nApplications should operate differently at development, testing, and production levels.\n\n### Dependency Separation\n\nAll Controllers and Modules must be independently executable except for API endpoint functions.\n\n### Extremely scalable\n\nAll structures are just files and folders based on modules and packages that are basically supported by Python. There are no restrictions, and you should be able to expand and change it as much as you want.\n\n\n\n## Structure\n\n```\nIMFast\n├── app\n│   ├── __init__.py\n│   ├── api\n│   │   ├── __init__.py\n│   │   ├── auth.py\n│   │   ├── template.py\n│   │   └── v1\n│   │       ├── __init__.py\n│   │       └── sample.py\n│   ├── asset\n│   │   └── index.html\n│   ├── decorator.py\n│   ├── depends\n│   │   ├── __init__.py\n│   │   └── jwt.py\n│   ├── error_handler.py\n│   ├── exception.py\n│   ├── middleware\n│   │   ├── __init__.py\n│   │   └── hello.py\n│   ├── request.py\n│   ├── response.py\n│   └── route\n│       ├── __init__.py\n│       └── gzip.py\n│\n├── controller\n│   ├── __init__.py\n│   ├── jwt.py\n│   └── password.py\n│\n├── model\n│   ├── __init__.py\n│   └── appmodel\n│       ├── __init__.py\n│       └── champion.py\n│\n├── test\n│   ├── __init__.py\n│   ├── conftest.py\n│   ├── test_basics.py\n│   └── test_sample.py\n│\n├── main.py\n├── settings.py\n├── imfast\n├── requirements.txt\n├── dev.env\n└── prod.env\n```\n\n## main.py\n\nmain module of IMFast. It manages the objects created by the application factory.\n\nIt calls the appropriate settings from `settings.py`, creates an Application object, and executes the given command.\n\n## app\n\nHere, code related to FastAPI is written. Required resources are placed in the appropriate space according to the rules adhered to by FastAPI.\n\n- **app/api**: set of API Routers\n- **app/assets**: set of static templates\n- **app/decorator**: It is a set that manages API level middleware as a decorator.\n- **app/depends**: set of FastAPI Denpendencies\n- **app/error_handler**: set of Exception and Status code Handler\n- **app/exception**: set of custom Exceptions\n- **app/middleware**: set of FastAPI custom Middlewares\n- **app/route**: set of custom FastAPI APIRoute\n- **app/request**: set of custom FastAPI Request\n- **app/response**: set of API Response and Response Model Factory\n\n## controller\n\nThis means an independent module that does not depend on FastAPI.\n\n## model \n\nIt manages various types of data models used in applications including DTO and ORM.\n\n- **model/appmodel**: A set of `Pydantic` models to control FastAPI body data\n\n## test\n\nIt is a test module package written based on `pytest`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fimfast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiml1111%2Fimfast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fimfast/lists"}