A workspace monorepo for the TechConnect biomedical research application, including the Angular frontend, FastAPI backend, and shared SQLModel schema package.
.
├── frontend/ # Angular frontend application
├── packages/
│ ├── schemas/ # Python - SQLModel schemas & SQL export
│ └── api/ # Python - FastAPI backend
└── pyproject.toml # UV workspace root
- uv - Python package manager (only requirement!)
Note: You don't even need Python installed! uv can download and manage Python versions for you automatically.
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or with pip
pip install uv
# Or with Homebrew
brew install uv# Install all Python dependencies (creates .venv automatically)
uv sync --all-packages
# Run backend development server (from workspace root)
uv run --package techconnect-api fastapi dev packages/api/app/main.py
# Generate frontend TypeScript models from the Python schemas
uv run --package techconnect-schemas export-schema --format typescript --output frontend/src/app/generated/models.ts
# Run the Angular frontend
cd frontend && npm install && npm start
# Or run from the package directory
cd packages/api && uv run fastapi dev app/main.py
# Export SQL schema
uv run --package techconnect-schemas export-schema --dialect postgresql
# Initialize database tables
uv run --package techconnect-schemas init-dbThe application now requires authentication for the domain API routes and the Angular workspace UI.
- Local SQLite development automatically bootstraps a default administrator account:
- Email:
admin@techconnect.local - Password:
techconnect-dev-password
- Email:
- Non-SQLite environments should define bootstrap credentials explicitly before first start:
AUTH_BOOTSTRAP_EMAILAUTH_BOOTSTRAP_PASSWORD- Optional:
AUTH_BOOTSTRAP_FULL_NAME
- Session cookies are HTTP-only and issued by the API at
POST /api/auth/login.
Example environment values for a deployed environment:
AUTH_BOOTSTRAP_EMAIL=admin@example.com
AUTH_BOOTSTRAP_PASSWORD=change-me-now
AUTH_BOOTSTRAP_FULL_NAME="TechConnect Administrator"
AUTH_COOKIE_SECURE=true# Sync all workspace packages
uv sync --all-packages
# Sync a specific package
uv sync --package techconnect-api
uv sync --package techconnect-schemas# Run FastAPI backend (development mode with auto-reload)
uv run --package techconnect-api fastapi dev packages/api/app/main.py
# Or from the package directory (simpler)
cd packages/api
uv run fastapi dev app/main.py
# Production mode
uv run --package techconnect-api fastapi run packages/api/app/main.py
# Using uvicorn directly (alternative)
uv run --package techconnect-api uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Backend will be available at:
# - API: http://localhost:8000
# - Docs: http://localhost:8000/docs# From the frontend directory
cd frontend
npm install
npm start
# The frontend scripts regenerate TypeScript models from packages/schemas automatically.# Export SQLite schema (default)
uv run --package techconnect-schemas export-schema
# Export PostgreSQL schema
uv run --package techconnect-schemas export-schema --dialect postgresql
# Export MySQL schema
uv run --package techconnect-schemas export-schema --dialect mysql
# Export generated TypeScript models for the Angular frontend
uv run --package techconnect-schemas export-schema --format typescript --output frontend/src/app/generated/models.ts# Initialize tables directly in the database (uses DATABASE_URL in the root .env)
uv run --package techconnect-schemas init-db# Build all packages
uv build --all-packages
# Build specific package
uv build --package techconnect-api
uv build --package techconnect-schemasRuff is used for linting and formatting Python code. It's included in the dev dependencies.
# Install dev dependencies (includes ruff)
uv sync --all-packages --extra dev
# Check for linting errors
uv run ruff check packages/schemas packages/api
# Check and auto-fix linting errors
uv run ruff check --fix packages/schemas packages/api
# Format Python code
uv run ruff format packages/schemas packages/api
# Check formatting without making changes
uv run ruff format --check packages/schemas packages/apiPyrefly is a fast type checker for Python. It's included in the dev dependencies.
# Install dev dependencies (includes pyrefly)
uv sync --all-packages --extra dev
# Type check the schemas package
uv run --directory packages/schemas pyrefly check .
# Type check the api package
uv run --directory packages/api pyrefly check .
# Type check from workspace root (run in each package directory)
cd packages/schemas && uv run pyrefly check . && cd ../..
cd packages/api && uv run pyrefly check . && cd ../..# Run API tests
uv run --package techconnect-api pytest
# Run tests with coverage
uv run --package techconnect-api pytest --covSQLModel schemas for the TechConnect application. Can be used standalone to generate SQL DDL.
# Export schema to stdout
uv run --package techconnect-schemas export-schema --dialect postgresql
# Initialize database tables
uv run --package techconnect-schemas init-dbFastAPI API that uses the schemas package.
# Start development server (with auto-reload)
cd packages/api
uv run fastapi dev app/main.py
# Or from workspace root
uv run --package techconnect-api fastapi dev packages/api/app/main.pyA production-oriented Docker Compose stack is available for VPS deployments with multiple services running on the host. It builds the Angular frontend into an Nginx container, runs the FastAPI backend in a separate container, and persists PostgreSQL data in a named volume.
The web container is published on 127.0.0.1:${TECHCONNECT_HTTP_PORT} so a host-level Nginx instance can front it without exposing the container port directly.
See docs/docker-compose-deployment.md for setup and operations.
- Make schema changes in
packages/schemas/models/ - Regenerate frontend types with
uv run --package techconnect-schemas export-schema --format typescript --output frontend/src/app/generated/models.tsor any frontend npm script - Export and apply DDL to your database or run
uv run --package techconnect-schemas init-db - Add API endpoints in
packages/api/app/
-
Create the package directory:
packages/my-package/ -
Add a
pyproject.tomlwith the package metadata -
Update the root
pyproject.tomlto include it in members:[tool.uv.workspace] members = ["packages/api", "packages/schemas", "packages/my-package"]
-
Run
uv sync --all-packages