🛠️ Development
Setup
-
Install tools:
-
Install dependencies:
-
Create a virtual environment:
bash uv sync
-
Run pre-commit Install pre-commit hooks:
bash pre-commit install
-
-
Set up the database:
# Start the local postgres db just db-start # Create and upgrade the database to the latest migration alembic upgrade head # For future database changes: # Create a new migration after modifying models alembic revision --autogenerate -m "Description of changes" # Apply the new migration alembic upgrade head
-
Setup Env vars
-
Option #1: Local
.env
file.env.example
contains all the env vars that can be set. The default value is listed there as well.- Create a file called
.env
and override any settings you wish to change - I would recommend at least setting
SMTP_LOCAL_DEV=true
to prevent sending emails during development
-
Option #2: Using Infisical to manage secrets
- Install the infisical-cli tool
- Run
infisical init
to setup the project
-
-
Run the development server:
# If you have infisical setup it will run the correct commands just server-start
-
Access to the web interface at http://localhost:8000
-
[Optional] Run the command to automatically process the css files w/ tailwindcss:
bash just npm-watch
-
[Optional] check out the available
just
commands:bash just --list
Alebmic Commands
-
If you need to undo a migration, you can use the following commands:
bash alembic downgrade -1
Then you can manually delete the migration file from the
alembic/versions
directory. -
If you need to merge two heads, you can use the following command:
bash alembic merge heads
This will create a blank version file that combines the two heads. Nothing to do except now you can updated your db