Quickstart
You’ll run Plat5 with a starter API and its consoles on your laptop, create a project, and call the API inside it. Then you’ll see the audit log, the trace and the admin console for the same request.
You need Docker. Nothing else: the starter runs in Docker too.
-
Install the CLI.
brew install plat5dev/tap/plat5# orcurl -fsSL https://plat5.com/install.sh | shmacOS and Linux. On Windows, run it in WSL2.
-
Create your app. Run the interactive wizard to start a new project (choosing integrations and starter templates) or copy a standalone example (
tasks-saas,topaz-documents,enterprise-sso). To try the full Tasks SaaS demo with API and both consoles right away, pass--example tasks-saas:plat5 init my-app --example tasks-saas -yOr run
plat5 init my-appwith no flags for the interactive wizard, orplat5 init my-app -yfor bare Plat5 with the defaultorganization → projectstartingplat5.yml. Keep the default modules (auth,observability,operator). -
Start it. The first start downloads the images, which takes a few minutes.
cd my-appplat5 startIt applies
plat5.yml, creates a dev user ([email protected]) who owns an organization called Dev (/orgs/dev), and ends with everything you need:my-app is running.Customer console http://localhost:3001 [email protected] / passwordOperator console http://localhost:5412 [email protected] / passwordPlat5Gateway http://localhost:5400Auth http://localhost:5401 sign-up codes: plat5 logs auth | grep codeControl plane http://localhost:5402 admin token dev-admin-tokenOperator gateway http://localhost:5410 config: operator.ymlOperator IdP http://localhost:5411Grafana http://localhost:5403 Plat5 folder: Service Health, Auth, DebugDev person [email protected]Personal key plat5-uk-1-… acts as them in every treeOpen http://localhost:3001 and sign in as [email protected] / password.(A “tree” in Plat5 is one root organization and everything under it.)
plat5 statusprints this summary again. -
Create a project. Use the personal key from the summary. Projects are Plat5’s: the starter’s
plat5.ymldeclares them, and Plat5 serves the routes.KEY=plat5-uk-1-… # the personal keycurl -s -X POST http://localhost:5400/orgs/dev/projects \-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \-d '{"display_name":"Web"}'Its slug is
web, from the name. You reach it as the organization’s admin: the starter doesn’t give a project’s creator a role of its own. -
Call your API inside it. The request says
/orgs/dev/projects/web/tasks. Your API receives/projects/<the project's id>/tasks, with your member id inX-Plat5-Member-Id: Plat5 found the project, checked your role there, and filled in the id.curl -s -X POST http://localhost:5400/orgs/dev/projects/web/tasks \-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \-d '{"title":"Launch"}'curl -s http://localhost:5400/orgs/dev/projects/web/tasks -H "Authorization: Bearer $KEY" -
Read the audit log. The project and the task you just created are in it. Your API didn’t write a line of audit code.
curl -s http://localhost:5400/orgs/dev/audit-events -H "Authorization: Bearer $KEY" -
Look around.
- The customer console at localhost:3001. Sign in as
[email protected]/password: the same user, the Dev organization, and your project. Invite members, give them a role on the organization or on one project, make keys. - Grafana at localhost:5403. Find the trace for your request, from the gateway into your API, beside the logs of every container.
- The admin console at localhost:5412. Sign in as
[email protected]/password: the operator side, where your team reaches every organization and project, with its own audit log of what operators did.
- The customer console at localhost:3001. Sign in as
What just happened
Section titled “What just happened”- Your API never saw a credential. Plat5 checked the key, found the project in the path, checked your role there, applied the rate limit, recorded the request in the audit log, and put the project’s id in the path.
- One credential reaches every organization its user is in. The path says which one, and the gateway checks the caller’s access there. Someone without a role on the project, or on the organization above it, gets a 403 that doesn’t say whether it exists.
services/api.ymlsays which routes your API serves and which permission each needs.plat5.ymlsays which roles grant them, and where each can be granted. Edit either, then runplat5 planto see the change andplat5 applyto make it.
plat5 stopstops everything. Your data is kept for next time.- To run the API on your machine, with your debugger:
plat5 start -x app, then run it the way the starter’s README says. - Write a service to add your own routes.
- The model explains organizations, projects and the rest as levels you declare, and access how a request is decided.
- Explore the playbooks for Enterprise B2B SaaS, Record-level auth with Topaz, and Public portals & subdomains.