Skip to content

Repository files navigation

About

This is template repository for backend. Clone it/fork it and replace every instance of <company> with your company.

You can do it this way:

export OLD="company"
export NEW="my-awesome-app"

grep -rl --exclude-dir={.venv,.git} "$OLD" . | xargs sed -i "s/$OLD/$NEW/g"

Don't forget to rename the folder as well.

Installing dependencies

Setup:

  • uv version 0.9.* - curl -LsSf https://astral.sh/uv/install.sh | sh
  • docker version 28.5.*
  • Python 3.13 - installed via uv uv python install 3.13

Creating .venv and installing dependencies:

$ uv venv .venv
$ uv sync --no-dev --frozen

If you want with development dependencies for development purposes:

$ uv sync --dev --frozen

Ensure you have correct .env file and their values:

$ cp .env.example .env

Ensure your scripts are exectuble:

$ chmod +x ./scripts/*

If you wanna run backend code, you need to start docker and run entrypoint.sh. For convinience, all you need to do is do:

$ make

Database

In order to have fully functional datadabase, remember to plug in correct envs. -

POSTGRES__DB=companydb
POSTGRES__DB_USER=postgres
POSTGRES__DB_PASSWORD=postgres
POSTGRES__DSN=company-db
POSTGRES__PORT=5432

Then upgrade the db to the most recent migration file.

# e.g. TARGET=heads   && ALEMBIC_CONFIG="alembic/alembic.ini"
$ make db-upgrade TARGET=$(TARGET)
$ alembic -c $(ALEMBIC_CONFIG) upgrade $(TARGET)

If you are having permission difficulties when creating migrations, run:

$ chmod 777 alembic/versions/

About

πŸš€ Template for FastAPI app with SQLAlchemy integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages