- Shell 100%
|
|
||
|---|---|---|
| .githooks | ||
| .github | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .gitleaks.toml | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| mailserver.env.example | ||
| moveit.dev.sh | ||
| moveit.sh | ||
| README.md | ||
sharevent-infra
Orchestration for the Sharevent stack: Postgres, Redis, backend, frontend, nudenet, cron, watcher, mailserver, focalboard and cloudflare-ddns.
Sharevent is multi-repo. Two shared packages are consumed by the apps via a
local file: dependency and must be present at build time:
@sharevent/contracts(PACKAGES/sharevent-contracts) — shared zod schemas / DTOs / enums. Must be built (itsdist/) before FE/BE install.@sharevent/config(PACKAGES/sharevent-config) — shared ESLint, Prettier and TypeScript base configs. Source-only (no build).
One-command local bring-up (Windows, host-based)
For day-to-day development, run the apps directly on the host (fastest HMR):
# from the repo root E:\WEB\sharevent.ro
./dev.ps1 # build contracts, install config, start DB/Redis, migrate, launch BE+FE
./dev.ps1 -Stop # stop the DB/Redis containers
./dev.ps1 -Reset # wipe volumes and restart
dev.ps1:
- builds
@sharevent/contractsand installs@sharevent/config, - starts Postgres + Redis in Docker (loopback-bound),
- runs
prisma migrate deploy, - opens terminals for the contracts watcher, the backend (
pnpm dev) and the frontend (pnpm dev).
Each app validates its environment at startup and fails fast if a required
variable is missing (BE: src/config/env.ts, WATCHER: src/env.ts, FE:
src/env.ts + vite.config.ts). Copy each service's .env.example to .env
first:
| Service | Env file location | Notes |
|---|---|---|
| Backend | BE/sharevent-be/.env |
DB, Redis, SESSION_SECRET (≥16 chars), SMTP, SENTRY_DSN (optional) |
| Watcher | WATCHER/sharevent-watcher/.env |
DATABASE_URL, Redis host/port |
| Frontend | FE/sharevent-fe/.env |
VITE_API_BASE_URL, VITE_APP_BASE_URL, VITE_SENTRY_DSN (optional) |
| Infra | INFRA/sharevent-infra/.env |
values consumed by docker-compose*.yml |
Full stack via Docker Compose
The compose files expect a flat deploy layout (what moveit.sh produces):
$PROJECT_ROOT/
docker-compose.yml # copied from sharevent-infra
sharevent-contracts/ # shared package (built inside the image)
sharevent-config/ # shared package
sharevent-be/ sharevent-fe/ sharevent-watcher/
sharevent-cron/ sharevent-nudenet/ sharevent-infra/
The backend / frontend / watcher images set build.context: . (the deploy
root) and dockerfile: sharevent-<svc>/Dockerfile. Each Dockerfile recreates the
nested PACKAGES/* + <SVC>/<svc> layout inside the image so the file: deps
(@sharevent/* -> ../../PACKAGES/*) resolve, builds @sharevent/contracts
first, then installs and builds the service.
Production / staging bring-up
# from $PROJECT_ROOT (after sharevent-infra is cloned)
./sharevent-infra/moveit.sh # clone/update every repo (incl. contracts + config), build & up
# dev variant:
./sharevent-infra/moveit.dev.sh
moveit.sh fetches all service repos plus sharevent-contracts and
sharevent-config as flat siblings, copies the compose file to the root, then
runs docker compose up -d --build and migrates + seeds the DB.
Manual compose (when repos are already in place)
docker compose -f docker-compose.yml up -d --build # prod
docker compose -f docker-compose.dev.yml up -d --build # dev
Required compose env (INFRA/sharevent-infra/.env): DB_*, DATABASE_URL,
SHADOW_DATABASE_URL, REDIS_PASSWORD, VITE_API_BASE_URL,
VITE_APP_BASE_URL, VITE_SENTRY_DSN, API_KEY (Cloudflare), etc. Secrets are
injected via env_file, never baked into images.
CI
Each repo's .github/workflows/ci.yml runs on PRs and:
- reconstructs the umbrella layout (checks out
sharevent-contracts+sharevent-config), - builds
@sharevent/contracts, - installs, typechecks, lints, and tests the service,
- runs a secret-scan job (gitleaks) that fails on any committed secret.