Go to file
3wish 166d71272d update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
migrations update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
src update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
static/avatars email signin 2024-04-09 16:59:14 +08:00
.dev.Dockerfile update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
.dev.env add environment variables 2024-04-11 17:38:13 +08:00
.dockerignore add environment variables 2024-04-11 17:38:13 +08:00
.gitignore email signin 2024-04-09 16:59:14 +08:00
.local.env add environment variables 2024-04-11 17:38:13 +08:00
.prod.Dockerfile update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
.prod.env add environment variables 2024-04-11 17:38:13 +08:00
Pipfile implement push unreceived msg using another thread with async event loop 2023-09-16 11:35:51 +08:00
Pipfile.lock add environment variables 2024-04-11 17:38:13 +08:00
README.md update alembic to use environment to get postgresql username, password and host 2024-04-15 16:19:43 +08:00
alembic.ini add token 2023-07-11 23:35:30 +08:00
requirements.txt add environment variables 2024-04-11 17:38:13 +08:00

README.md

Initialization

Virtue Environment

First install pipenv (if you don't have) running:

pip install pipenv

Then use pipenv to create virtue environment running in the root directory of the project:

pipenv install

This command will install all the dependencies.

Requirements

Generate requirements file running

pipenv requirements > requirements.txt

Start Up

Start up the app according to different environment variables running:

fastapi

uvicorn src.main:app --reload --env-file ./.local.env

Migration

Generate a migration

alembic revision -m "comment" --autogenerate

Upgrade a migration

This will upgrade to the newest version

alembic upgrade head

or:

alembic upgrade verions_name

or relative upgrades:

alembe upgrade +1

Downgrade a migration

alembic downgrade -1

Run Container

Create a volume for persisting data:

docker volumn create together-backend

Run a container and mount the volume:

docker run --name together-backend \
-v together-backend:/backend/static \
-itd 120.77.202.88/together-backend-dev:v1.0