https://github.com/gisoreb/fastapigraphqlrest
https://github.com/gisoreb/fastapigraphqlrest
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gisoreb/fastapigraphqlrest
- Owner: GisoreB
- License: mit
- Created: 2024-05-05T21:46:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-05T21:46:51.000Z (about 1 year ago)
- Last Synced: 2025-01-14T11:32:21.120Z (5 months ago)
- Language: Python
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-clean-example
[](https://docs.python.org/3/)
[](https://fastapi.tiangolo.com/)
[](https://www.openapis.org/)
[](https://swagger.io/)
[](https://graphql.org/)
[](https://black.readthedocs.io/en/stable/)
[](https://docs.pydantic.dev/)
[](https://github.com/0xTheProDev/fastapi-clean-example/issues)
[](https://github.com/0xTheProDev/fastapi-clean-example/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/0xTheProDev/fastapi-clean-example/pulls)
[](https://github.com/0xTheProDev/fastapi-clean-example/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/0xTheProDev/fastapi-clean-example/graphs/contributors)
[](https://github.com/0xTheProDev/fastapi-clean-example/pulse)## Description
_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.
## Installation
- Install all the project dependency using [Pipenv](https://pipenv.pypa.io):
```sh
$ pipenv install --dev
```- Run the application from command prompt:
```sh
$ pipenv run uvicorn main:app --reload
```- You can also open a shell inside virtual environment:
```sh
$ pipenv shell
```- Open `localhost:8000/docs` for API Documentation
- Open `localhost:8000/graphql` for GraphQL Documentation
_*Note:* In case you are not able to access `pipenv` from you `PATH` locations, replace all instances of `pipenv` with `python3 -m pipenv`._
## Testing
For Testing, `unittest` module is used for Test Suite and Assertion, whereas `pytest` is being used for Test Runner and Coverage Reporter.
- Run the following command to initiate test:
```sh
$ pipenv run pytest
```
- To include Coverage Reporting as well:
```sh
$ pipenv run pytest --cov-report xml --cov .
```## License
© MIT License