プロジェクト
概要
汎用APIを作成するためのFastAPIベースプロジェクト。
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- +1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルfastapi-clean-architecture
description
Base FastAPI project for applying general RestAPI Application cases.

concept
- Minimal functionality.
- Convincing architecture.
- Easy to read.
- Compatibility.
- Versatility.
base models
- user
- post [user (1 : n) post]
- tag [post (n : n) tag]
integrated with
- Python3.9+
- Fastapi 0.78.0
- Database
- MySQL5.7+
- Migration with alembic
- pytest with real DB
- Load with two ways (eager, lazy)
- Modeling with schema (1:1, 1:n, n:n)
- dependency-injector
- service-repository pattern
- JWT authentication
- role separation each endpoint
- Deployment
- container environment(k8s, docker)
- raw WAS(Web Application Server)
commands
- db(alembic)
alembic upgrade head: apply every migrationsalembic downgrade base: rollback every migrationsalembic revision --autogenerate -m "revision_name": create new migrationalembic history: get alembic revision history
- How to migration
- Create or modify models from
app/model/*.py alembic -x ENV=[dev|stage|prod] revision --autogenerate -m "revision_name"- Check auto generated migration file from
app/migrations/versions/*.py alembic -x ENV=[dev|stage|prod] upgrade head
If ENV does not exist, it will be applied to the test.
- Create or modify models from
- server
uvicorn app.main:app --reload: base- options
- host:
--host 0.0.0.0 - port:
--port 8000
- host:
- test
pytest: basepytest --cov=app --cov-report=term-missing: coverage with stdoutpytest --cov=app --cov-report=html: coverage with html
sample env
# mysql case
ENV=dev
DB=mysql
DB_USER=root
DB_PASSWORD=qwer1234
DB_HOST=localhost
DB_PORT=3306
# postgres case
ENV=dev
DB=postgresql
DB_USER=gyu
DB_PASSWORD=
DB_HOST=localhost
DB_PORT=5432
references
関連プロジェクトを探す
読み込み中…