Skip to content

Latest commit

 

History

History
108 lines (91 loc) · 2.44 KB

README.md

File metadata and controls

108 lines (91 loc) · 2.44 KB

FastApi project template

Setup project

# Activate virtual environment
pipenv shell

# Install dependencies
pipenv install

Add env

  • add env file in root directory
  • copy from .env.example
.env

Run project

run the project

uvicorn app.main:app --reload --port 8000
# or
./run-project.sh

Database migration process with Alembic

Alembic is a database migration tool for SQLAlchemy.

revision (migration)

you can use the following command to create a new migration file.

alembic revision --autogenerate -m "initial project"

this will create a new migration file in the alembic/versions directory.

upgrade (migrate)

you can use the following command to migrate the database.

alembic upgrade head

Directory structure

├── app/
│   ├── api/
│   │   ├── v1/
│   │   │   └── user.py
│   │   ├── health.py
│   │   └── root_index.py
│   ├── config/
│   │   ├── authorization.py
│   │   └── cors.py
│   ├── database/
│   │   └── database.py
│   ├── middleware/
│   │   └── authorization_middleware.py
│   ├── models/
│   │   └── users.py
│   ├── schemas/
│   │   └── user_schema.py
│   ├── serializers/
│   │   └── user_serializer.py
│   ├── services/
│   │   └── user_service.py
│   ├── templates/
│   │   ├── mails/
│   │   │   ├── css/
│   │   │   │   └── mail.css
│   │   │   └── welcome_email.html
│   │   └── user.html
│   ├── utils/
│   │   ├── mailer/
│   │   │   ├── inline_css.py
│   │   │   ├── mail.py
│   │   │   └── mail_templating.py
│   │   ├── base.py
│   │   ├── jwt_utils.py
│   │   ├── paginate.py
│   │   ├── password.py
│   │   └── validation.py
│   ├── __init__.py
│   └── main.py
├── alembic/*
├── docker/*
├── alembic.ini
├── .env
├── .env.example
├── .gitignore
├── build.sh
├── Pipfile
├── Pipfile.lock
├── README.md
└── run-project.sh

Note

This project needs python 3.12 or higher

postman collection documentation