Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork66
Clean Architecture Example using FastAPI framework
License
0xTheProDev/fastapi-clean-example
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Example Application Interface using FastAPI framework in Python 3
This example showcases Repository Pattern in Hexagonal Architecture(also known as Clean Architecture). Here we have two Entities - Books and Authors, whose relationships have been exploited to create CRUD endpoint in REST under OpenAPI standard.
Install all the project dependency usingPipenv:
$ pipenv install --dev
Run the application from command prompt:
$ pipenv run uvicorn main:app --reload
You can also open a shell inside virtual environment:
$ pipenv shell
Open
localhost:8000/docsfor API DocumentationOpen
localhost:8000/graphqlfor GraphQL Documentation
Note: In case you are not able to accesspipenv from youPATH locations, replace all instances ofpipenv withpython3 -m pipenv.
For Testing,unittest module is used for Test Suite and Assertion, whereaspytest is being used for Test Runner and Coverage Reporter.
- Run the following command to initiate test:
$ pipenv run pytest
- To include Coverage Reporting as well:
$ pipenv run pytest --cov-report xml --cov.
© MIT License
About
Clean Architecture Example using FastAPI framework
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.