Server installation
Development (Docker), environment variables, test and live environments, production in Türkiye.
- DevelopmentDocker Compose
- test branchCI green
- biy-portal-testautomatic deploy
- test → main PRend-to-end tests
- biy-portal-prodmanual deploy
Development environment
git clone github.com/ozerbaygin/BIY (private repository) cp .env.example .env # never put real secrets here docker compose up # db (PostgreSQL 16), app (migrations + uvicorn), worker # portal: http://localhost:8000 health: /health/live, /health/ready
- On start,
appbrings the database schema up to date withalembic upgrade head;workerruns the background jobs (python -m app.workers.runner). - The application connects with the restricted
biy_approle; row-level security (RLS) is enforced for this role.
Key environment variables
APP_ENV(development, test, production),DATABASE_URL,SECRET_KEY(random, at least 32 characters in test and production).RUN_EMBEDDED_WORKER: when true the worker runs inside the web process (no separate worker charge on Render).SYNTHETIC_DATA_ONLY: true in test and demo environments; the screen shows a "synthetic data only" notice.PUBLIC_BASE_URL(WebAuthn and links in emails), session and sign-in lock durations,MAIL_BACKENDand SMTP settings, PDF reading limits.
Secret values (SECRET_KEY, SMTP password) live only in environment variables; they are never written to code, logs or tests.
Test and live environments (Render, synthetic data only)
- The repository has only the
testandmainbranches.testdeploys automatically tobiy-portal-test;mainis deployed by hand tobiy-portal-prod. - Each environment has a web service and a PostgreSQL database (
render.yaml);alembic upgrade headruns before each deploy. Health:/health/readyshows the version and migration state. - Because Render is outside Türkiye, no real customer data is entered in these environments.
Production with real data (Türkiye)
- Plan (design 8.3): a single server in a data centre in Türkiye, application and PostgreSQL with Docker Compose; encrypted backups at a second Turkish provider; Let's Encrypt TLS; monitoring with Prometheus and Grafana.
- Before signing, confirm that the data centre really is in Türkiye and ask for its ISO 27001 certificate.
- The image starts uvicorn with
--forwarded-allow-ips='*'. In production set this only to the address of your own reverse proxy; otherwise the IP restriction can be bypassed by writing the header. - The KMS or Vault provider for the master key and the malware scanner have not been chosen yet; they are chosen together with the production provider.
The production provider in Türkiye, the domain name and the SMTP provider have not been chosen yet; this chapter will be detailed with P15 once they are.
Regenerating the guide images
TEST_DATABASE_URL=postgresql://... python scripts/guide_media.py # test database only
The script starts its own server, sets up a synthetic company and writes the screenshots and videos under app/web/static/guide/.