pip install -r requirements.txt
brew install postgresql
uvicorn main:app --reload
- Start Docker daemon
- [Optional] Provide permission for the first run:
sudo chmod 755 docker-build.sh
sudo chmod 755 docker-run.sh
- From the root directory, run the following cmds:
. ./scripts/build.sh
. ./scripts/run.sh
http://0.0.0.0:4000/api/docs Default docu generated by FastAPI
Detail explanation sees Explicit Architecture.
App uses onion architecture that leverages Inversion of Control.
core/
knows nothing but itself;
infrastructure/
has access to itself and everything in core/
;
presentation/
knows everything in the app.
core <-- infrastructure <-- presentation
The directory tree looks like this:
app/
├── core/
├── infrastructure/
└── presentation/
This part includes the main Business Logic of the app, which actually do the work.
app/
├── core/
├── abstractions/
├── domain/
└── services/
...
This part connects the core/
to other tools like Database, search engine, or other third party APIs.
app/
├── core/
├── infrastructure/
├── adapters/
└── database/
...
This part is responsible to communicate with external world, receiving or sending infos.
app/
├── core/
├── infrastructure/
└── presentation/
└── api/