Skip to content
프로젝트

mirzadelic/fastapi-starter-project

GitHub에서 보기

소개

FastAPI Starter Project with SQLModel and Alembic

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

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

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

README.md

Original

FastAPI Starter Project

Project includes:

  • fastapi
  • sqlmodel
  • alembic

Models

Check db/models and migrations, there is one example.

Using docker

Setup env variables in app/core/.env using app/core/.env-example

Install and run

docker-compose up -d web

# you can track logs with:
docker-compose logs -f --tail=100 web

Go to: http://localhost:8000/api/docs/

Migrations

Create migrations

docker-compose exec web alembic revision --autogenerate -m "Example model"

Apply migrations

docker-compose exec web alembic upgrade head

Tests

Run tests

docker-compose exec web pytest .

Without docker

Install

cd app/
pip install -r requirements/development.txt

Setup env variables in app/core/.env.

Run

cd app/
python app/server.py

Go to: http://localhost:8000/api/docs/

Migrations

Create migrations

alembic revision --autogenerate -m "Example model"

Apply migrations

alembic upgrade head

Tests

Run tests

pytest .

Environment Variables

To run this project, you will need to add the following environment variables to your app/core/.env file

BASE_URL - default: http://localhost:8000

RELOAD - default: false

DB_HOST - default: localhost

DB_PORT - default: 5432

DB_USER - default: postgres

DB_PASS - default: postgres

DB_BASE - default: db

DB_ECHO - default: false

관련 프로젝트 살펴보기

불러오는 중…