start: from nothing to a running application

start: from nothing to a running application A workflow diagram generated by Archify. 01 / Your terminal · go run github.com/septagon-oss/platformkit/apps/platformkit@main start 02 / start.go 03 / Brought up: PostgreSQL 16, then kit/app Process Database First tenant Serve start · --data ./data · Your terminal · go run github.com/septagon-oss/platformkit/apps/platformkit@main start › Process · --addr :8080 start --data ./data --addr :8080 first run? · password or crud.ErrConflict · Your terminal · go run github.com/septagon-oss/platformkit/apps/platformkit@main start › First tenant · no: the tenant exists first run? password or crud.ErrConflict no: the tenant exists Ctrl+C · app stops, then the database · Your terminal · go run github.com/septagon-oss/platformkit/apps/platformkit@main start › Serve Ctrl+C app stops, then the database NotifyContext · SIGINT and SIGTERM · start.go › Process · end everything NotifyContext SIGINT and SIGTERM end everything startConfig · freePort() fills the dev config · start.go › Process · platformkit.localhost:8080 startConfig freePort() fills the dev config platformkit.localhost:8080 app.Bootstrap · tenant.Bootstrap: platformkit · start.go › Database · admin@platformkit.localhost app.Bootstrap tenant.Bootstrap: platformkit admin@platformkit.localhost /admin/login · http://platformkit.localhost · start.go › Serve · :8080 · printed on stderr /admin/login http://platformkit.localhost :8080 · printed on stderr starts PostgreSQL · embedded V16, cached once · Brought up: PostgreSQL 16, then kit/app › Database · data under ./data/postgres starts PostgreSQL embedded V16, cached once data under ./data/postgres ensureRole · platformkit_app role · Brought up: PostgreSQL 16, then kit/app › Database · postgres-init.sql ensureRole platformkit_app role postgres-init.sql app.New → Run · migrate · gates · serve · Brought up: PostgreSQL 16, then kit/app › Serve · role all · events.Memory() app.New → Run migrate · gates · serve role all · events.Memory() MigrateURL compose(cfg) serves :8080 a.Run(ctx) Legend User UI Agent logic Policy Context / trace External system

First run, later runs

  • • admin@platformkit.localhost's password: printed once
  • • crud.ErrConflict: the tenant exists; sign in as before

No NATS

  • • Role all, no Transport: kit/app picks events.Memory()
  • • startConfig has no nats section; no broker is started

A deployment never uses start

  • • It has a config.yaml and a database of its own
  • • It uses run: --role web|worker|all --config