Skip to content
프로젝트

0xTheProDev/fastapi-clean-example

GitHub에서 보기

소개

FastAPI 프레임워크를 사용한 클린 아키텍처 예제입니다.

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

fastapi-clean-example

Python FastAPI OpenAPI Swagger GraphQL Code style: black Typed with: pydantic Open Issues Closed Issues Open Pulls Closed Pulls Contributors Activity

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:

    $ 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/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:
    $ pipenv run pytest
    
  • To include Coverage Reporting as well:
    $ pipenv run pytest --cov-report xml --cov .
    

License

© MIT License

관련 프로젝트 살펴보기

불러오는 중…