Quickstart
Get Atom running and make your first authorization check.
Prerequisites
- Docker and Docker Compose
makejqfor command examplesopensslonly if you enable certificates (off by default in dev env)
Steps
Create Local Dev Config
There is one config file. .env.example ships working local defaults — admin
login admin / 12345678, password login allowed before email verification,
and certificates disabled — so a fresh copy boots with no SMTP, OAuth, or CA
setup. Edit ADMIN_SECRET before first boot to change the admin password.
Start Atom
This starts (building the images the first time, then reusing them):
- Atom REST and GraphQL at
http://localhost:8080 - Atom Next UI at
http://localhost:3005 - Postgres at
127.0.0.1:5432
After changing backend or UI code, rebuild with make build (or
make atom-build / make ui-build) before make up.
Create A Tenant, Device, And Channel
Use GraphQL at POST http://localhost:8080/graphql.
Create an entity for a device:
Create a channel resource:
Give Publish Access
Find the seeded publish action:
Create a permission block for the channel:
Create a role and attach the permission block:
Assign the role to the device:
Makefile Commands
Run make help for the current target list.
| Command | What it does |
|---|---|
make db | Starts only Postgres (for a host cargo run). |
make dev | Host cargo run (:8090) + UI dev (:3000) on the shared Postgres; runs with make up. |
make up | Starts Postgres, Atom, and Atom UI (builds images only if missing). |
make logs | Follows Atom backend and Atom UI logs. |
make down | Stops the local Compose stack. |
make restart | Stops and starts the Compose stack again (no rebuild). |
make build | Builds Atom backend and Atom UI images. |
make atom-build | Builds only the Atom backend image. |
make ui-build | Builds only the Atom UI image. |
make docker-build | Builds the raw Atom Docker image using Makefile variables. |
make docker-build-release | Builds the raw release Docker image. |
Common overrides:
Direct Cargo Development
Run the Rust service on your host and keep only Postgres in Docker. Postgres is
published on 127.0.0.1:5432 and .env points DATABASE_URL at
localhost:5432, so this works with no extra setup:
Plain cargo run uses LISTEN_ADDR from .env (8080), so it collides with
make up. To run both at once, use make dev (below), which moves the host
backend to a separate port.
UI Development And Running Everything At Once
The host dev flow uses its own ports so it can run alongside make up on
the same Postgres. make dev starts Postgres (Docker) plus Atom and the Next
UI on the host (Ctrl-C stops both; needs host cargo and pnpm):
| Flow | Backend | UI | Postgres |
|---|---|---|---|
make up (Compose) | :8080 | :3005 | :5432 |
make dev (host) | :8090 | :3000 | :5432 (same DB) |
Log in to either with the same admin credentials (admin / 12345678); both
read ADMIN_SECRET from .env and share one database.
Run both together to compare a code change against the released image — they
share one Postgres volume. Override with DEV_HTTP_PORT / DEV_UI_PORT.
To run the UI pieces yourself instead:
The dev UI reads the backend GraphQL endpoint from ATOM_GRAPHQL_URL
(server-side). Origins :3000 and :3005 are already allowed by the default
ATOM_CORS_ALLOWED_ORIGINS in .env.
What Just Happened
- You created an entity for a device.
- You created a resource for a channel.
- You created a permission block that allows
publishon that channel. - You put the permission block inside a role.
- You assigned the role to the device.
- Atom returned allow when asked whether the device can publish.
See Atom In Simple Words for the layman explanation, and Access Control for the full model.