Skip to the page

First principles

Chapter 3 of 11

Parts of a project

An org holds your clusters, projects and branches. Every project gives people, services and agents one HTTPS address governed by one schema.

Typical stacks scatter credentials across separate tools: user sessions live in an auth service, API keys sit in a gateway and database passwords live in environment secrets where admin keys can read private user notes.

Try it

Napalm separates infrastructure control from application data on your very first command. Sign the CLI in to your org.

Your terminal
napalm login
Opening your browser to sign in…
If the browser doesn’t open, visit:
https://console.napalmdata.com/authorize-cli?port=53817&state=…&challenge=…&name=napalm+CLI+on+studio
Signed in to Northwind
Can make changes until 2026-11-16 01:12 PST
Approve the login once in your browser to save an org token that manages projects and never reads user notes.

Orgs, projects and branches#

Signing in connects the CLI to your org. Four resources organize your projects and databases.

PartPurpose
OrgPurposeHolds your projects, clusters, org tokens, teammates and billing
ProjectPurposeServes one complete backend at notes.napalmdata.com
ClusterPurposeProvides the machines underneath, from single-machine solo to sharded scale
BranchPurposeRuns an isolated database beside main with separate records, keys and sessions

Dedicated cluster

Isolated compute, disks, TLS keys and storage buckets behind one project address.

Isolated branches

Each branch runs beside main with separate records, keys and sessions.

Ada and Ben use main. Schema pushes and test writes on other branches never touch main, and every cluster runs on dedicated compute, disks, TLS keys and storage buckets.

Callers and credentials#

Pillar at work: Caller-bound

Once a project is running, four kinds of callers talk to Napalm. Each caller brings a distinct credential, and Napalm turns that credential into typed globals before any query runs.

CallerCredentialBound globals
Ada and BenCredentialSession from built-in sign-inBound globalsThe signed-in person in global caller
Backend serviceCredentialProject service keyBound globalsEmpty global caller, plus scoped service globals
Ada’s agentCredentialToken approved by AdaBound globalsAda in global caller
You or CICredentialOrg token for the control APIBound globalsNothing, because org tokens cannot query project data

User sessions

Built-in sign-in binds the signed-in person in global caller.

Service keys and org tokens

Service keys query one branch, while org tokens (napalm_…) manage clusters without reading row values.

Approved agent tokens

OAuth consent binds the approving person or a time-limited grant.

Every stored type starts closed to application callers. Org tokens (napalm_…) inspect schemas, counts and rule traces without reading field values.

Schema and query files#

Pillar at work: One typed graph

Those types, rules and queries live as plain files in your repository alongside your app code. The starter notes app begins with five files.

Your repository
dbschema/  default.gel          # types, links and access rules  queries/    addFile.edgeql    addNote.edgeql    myFiles.edgeql    myNotes.edgeql
One schema file and four EdgeQL files define notes, file attachments and access rules.

Pushing to main checks every query against the new schema, applies the migration in one transaction and deploys each query by name at POST /query/{name}. Pushing to another branch checks the queries and migrates only that branch.

When Ada adds a note, her session reaches main, Napalm runs addNote and the ownership rule in one SQL statement, and the saved note streams to her other open tabs.

Next, Ben tries to read Ada’s private notes.

Type a word or two to search every docs page.