Git Branches & Deployments (DEV / PROD)
You do not manually upload files or build apps over SSH on the VPS. Pushing or merging to the tracked Git branches triggers vps-deployer (:9000) automatically.
How Code Reaches DEV, PROD & Live Docs π Hybrid Sync (Layout Preserved)
Branch β Environment Mapping
| Git Branch | Target Environment | What Happens Automatically |
|---|---|---|
develop or dev | DEV (dev-*.planovi.app) | vps-deployer pulls into /opt/vps-apps/<repo>/dev, runs service build hook, reloads Nginx, posts status to Google Chat. |
main | PROD (*.planovi.app) | vps-deployer pulls into /opt/vps-apps/<repo>/prod, runs service build hook, reloads Nginx, posts status to Google Chat, and triggers docs-sync to update the Rolling Docs PR. |
Feature branches (feat/*, fix/*) | None | Open a PR into develop (or dev for planovi-converter) first, verify on DEV, then merge to main. |
What vps-deployer Builds Automatically Per Repo
| Repository | Automated Post-Deploy Build | Critical Gotchas to Know |
|---|---|---|
planovi-flutter-app | Reads .fvmrc (3.44.8) β validates & injects /opt/vps-apps/flutter-app/{dev,prod}.public.env β compiles flutter build web --release. | Deploy aborts if .fvmrc is missing or if *.public.env contains any secret key (SERVICE_ROLE, SECRET, PASSWORD, API_KEY). |
planovi-backend | Runs rsync -av --delete supabase/functions/ β /opt/vps-stack/supabase/functions-{dev,prod} β restarts supabase-edge-runtime-{dev,prod}. | SQL migrations are NOT auto-applied by vps-deployer β apply DB migrations intentionally against DEV first, then PROD. |
planovi-converter | Rebuilds converters-api-{dev,prod} container β rebuilds mTLS ingress β compiles Flutter admin/ web panel β compiles & signs ARM firmware (planovi-firmware-builder). | Takes ~2β4 minutes because it compiles both Flutter Web and ARM C/C++ firmware. |
planovi-microservices | Bind-mounted directly into php-app container β reloads Nginx DNS cache. | Instant deploy (~5 seconds). |
planovi-webpage | Bind-mounted directly into php-app container β reloads Nginx DNS cache. | Instant deploy (~5 seconds). |
planovi-docs | Connected directly to Cloudflare Pages (not vps-deployer). | Every PR gets a Cloudflare Pages Preview URL; merging to main publishes live to docs.planovi.app in ~1 minute. |
Auto-Rollback & Notifications
- Before pulling new code,
vps-deployersnapshotsold_commit = git rev-parse HEAD. - If any step fails (Dart compile error, invalid
.fvmrc, broken Docker build),vps-deployerautomatically executesgit reset --hard <old_commit>and posts the extracted error lines directly to Google Chat. - Only one deploy runs at a time (
_deploy_lock), so concurrent pushes queue safely.
Documentation (Latest = PROD), DEV vs PROD & Versioning Rules
There is one documentation portal (docs.planovi.app / dev-docs.planovi.app), and Latest always reflects PROD (main) β never half-finished experiments from develop / dev:
- DEV pushes (
develop/dev) deploy todev-*.planovi.appand do not triggerdocs-sync. Environment differences (dev-*domains,*-devcontainers,*_DEVsecrets) are documented side-by-side inside this portal. - PROD pushes (
main) triggerdocs-syncasynchronously, which runsrun-syncβcheck-secretsβastro buildand opens/updates a single Rolling PR (docs/auto-syncβmain) inPA-IDEAS/planovi-docs. Cloudflare Pages attaches a live Preview URL to every PR for review before 1-click merge.
Developer Rules for Commits, Releases & Tagging
- Tag Only
main(Neverdevelopor Feature Branches):docs-syncreads production checkouts (/opt/vps-apps/*/prod+/opt/vps-stack), so Git release tags must always point to a commit already merged and deployed onmain.
- Use
vMAJOR.MINORFormat for Milestone Releases (v1.0,v1.1,v2.0):vps-deployerforwardsrefs/tags/v*webhooks directly todocs-sync(without re-running an app deploy) to freeze an immutable version snapshot (/repos/<repo>/vXY/) + auto-generated Release Notes.- Tag milestones, not tiny fixes: create a new tag when closing a milestone, changing
BR-*business rules, shipping a major module, changing API/DB contracts, or releasing new mobile/firmware versions. Avoid tagging routine typos or CSS hotfixes so the version switcher stays clean.
- Follow the 3-Step Release Order (Prevent Stale Snapshots):
- Merge code to
mainβvps-deployerdeploys PROD βdocs-syncupdates the Rolling PR (docs/auto-sync) inplanovi-docs. - Review & merge
docs/auto-sync(updating any changedBR-*business rules if needed) soLatestreflects the new behavior. - Push the release tag on
mainto freeze the updated docs into the immutable version snapshot:Terminal window git checkout main && git pullgit tag -a v1.1 -m "Release v1.1: concise summary of changes"git push origin v1.1
- Merge code to
- Use Conventional Commits (
feat(scope):,fix(scope):,refactor(scope):):snapshot.mjspulls commit subjects directly into each versionβs Release Notes, anddocs-syncuses commit history to identify affected business rules. When changing aBR-*rule, include a 1-sentence why in the PR description.
- Single Source of Truth & Secret Hygiene:
- Never create local
docs/directories inside service repositories β all docs live inPA-IDEAS/planovi-docs. - Never commit real secret values in
.env.exampleor code (all secrets live in PA Management β Loginy and/opt/vps-stack/.env;docs-syncblocks PRs ifcheck-secretsdetects a leak).
- Never create local
- Excalidraw+ Diagrams Hygiene:
- Feel free to rearrange and polish layouts in the Planovi collection inside Excalidraw+ β the 6-hour periodic sync pulls your manual layout into
planovi-docswithout overwriting it. - Keep the
[PLANOVI]title prefix on managed scenes sodocs-syncstays matched todiagrams/manifest.json.
- Feel free to rearrange and polish layouts in the Planovi collection inside Excalidraw+ β the 6-hour periodic sync pulls your manual layout into
Roadmap Note (Global Platform Versioning): Currently each repository versions its own documentation tab independently (
vX.Ytags per repo). In a future phase, global platform-level release snapshots will automatically capture and link historical versions across all repositories together whenever a platform milestone is cut.