First, make sure you have uv installed. If not, you can install it using pip:
pip install uvAlternatively, you can follow instructions from the uv documentation for the latest install method.
- Set the
DATABASE_URLenvironment variable. This must be done through export or Docker-eflag; it cannot be used in dotfiles.
export DATABASE_URL=asyncpg://user:password@localhost:5432/dbname-
Configure dotenv files in
env/directory:api.env– this file must exist, it contains some general info about the API.security.env.example– use this as a template for your actualsecurity.envfile. Copy and rename it:
cp env/security.env.example env/security.envFill in the required secrets in env/security.env as needed.
Once uv is installed and your env/ directory is populated:
uv add -r requirements.txtStart the FastAPI app using uv:
uv run uvicorn main:applicationThis will boot up your FastAPI server with the user microservice, which includes both auth and general user CRUD functionality.
If using Docker, remember to pass the DATABASE_URL explicitly:
docker run -e DATABASE_URL=asyncpg://user:password@host:port/dbname your_image_nameEnsure your machine has Python 3.13 installed for compatibility with modern uv and FastAPI dependencies.