Follow a request through the system
Potik runs the web interface and API as separate processes. The browser gets server-rendered HTML from React Router. The web server calls the Go API on behalf of the signed-in user. A mobile client can use the same API with its own access token. Both paths reach the same authorization rules.
Diagram source
flowchart LR
Browser -->|HTML and forms| Web[React Router server]
Web -->|Identity operations| Identity[ZITADEL]
Web -->|GraphQL and bearer token| API[Go API]
Mobile -->|Bearer token| API
API -->|Application records| PG[(PostgreSQL)]
Web -->|Browser sessions| PG
API -. optional outbox .-> PG
Worker[Optional worker] -. reads outbox .-> PG
Worker -. jobs .-> Redis[(Optional Redis)]
API -. private realtime updates .-> Browser
The migration command upgrades PostgreSQL before the API starts. A generated app with events disabled needs no worker or Redis. When events are enabled, the outbox and domain change can commit together, so a restart between a database write and notification delivery does not lose the event. See the events runbook for embedded and separate worker deployments.
What happens when I rename a project?
Diagram source
sequenceDiagram
actor User
participant Web as React Router
participant API as GraphQL resolver
participant Service as Projects service
participant DB as PostgreSQL
User->>Web: Submit the new name on the detail page
Web->>API: renameProject with the user's access token
API->>Service: Rename with the verified actor
Service->>DB: Update the ID within the permitted scope
DB-->>Service: Updated row or no matching record
Service-->>Web: Result through GraphQL
Web-->>User: Updated detail page or form error
| When changing… | Edit… |
|---|---|
| Form behavior or the displayed name | apps/web/app/routes/project.tsx and apps/web/app/features/projects/ |
| The contract available to web and mobile clients | backend/internal/graph/schema.graphqls and the matching resolver |
| What makes a valid project | backend/internal/modules/projects/projects.go |
| Which rows a given actor can read or change | backend/internal/platform/authorization/ and backend/queries/projects.sql |
| How data is stored | A new SQL migration under backend/migrations/ and the repository under backend/internal/modules/projects/postgres/ |
The form can flag an empty name for convenience. The Go service validates the same rule for every client. The repository includes the actor's scope in its SQL, so supplying somebody else's project ID cannot grant access. Generated Go and TypeScript bindings follow the schema and queries. Make changes in their sources and regenerate as shown in Build a field notes feature.