公式ドキュメント
https://github.com/fastapi/fastapi
https://github.com/fastapi/full-stack-fastapi-template
/
└ src/...sourceの略(appの名前のものもある)
├ assets/
├ crud/
├ database/
├ routers/
├ schemas/
├ services/
├ init.py
├ dependencies.py
├ main.py
└ models.py
ディレクトリ説明
名前 | 説明 |
---|---|
assets | 画像データなどを格納 |
crud | DBのcrud操作に関する処理 |
database | DB設定に関する処理 |
routers | ルーティング後のエンドポイント |
schemas | データのスキーマ定義 |
services | crud操作に関係のない関数 |
ファイル説明
名前 | 説明 |
---|---|
init.py | 何も書かなくて良い モジュール設定用 |
dependencies.py | 依存性注入に関する記述 |
main.py | エンドポイントに関する設定を行うFastAPIの実行ファイル |
models.py | DBモデル設計 ORM (Object Relational Mapper) |