Skip to content

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.

  1. Install the CLI.

    brew install plat5dev/tap/plat5
    # or
    curl -fsSL https://plat5.com/install.sh | sh

    macOS and Linux. On Windows, run it in WSL2.

  2. 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 -y

    Or run plat5 init my-app with no flags for the interactive wizard, or plat5 init my-app -y for bare Plat5 with the default organization → project starting plat5.yml. Keep the default modules (auth, observability, operator).

  3. Start it. The first start downloads the images, which takes a few minutes.

    cd my-app
    plat5 start

    It 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] / password
    Operator console http://localhost:5412 [email protected] / password
    Plat5
    Gateway http://localhost:5400
    Auth http://localhost:5401 sign-up codes: plat5 logs auth | grep code
    Control plane http://localhost:5402 admin token dev-admin-token
    Operator gateway http://localhost:5410 config: operator.yml
    Operator IdP http://localhost:5411
    Grafana http://localhost:5403 Plat5 folder: Service Health, Auth, Debug
    Personal key plat5-uk-1-… acts as them in every tree
    Open http://localhost:3001 and sign in as [email protected] / password.

    (A “tree” in Plat5 is one root organization and everything under it.) plat5 status prints this summary again.

  4. Create a project. Use the personal key from the summary. Projects are Plat5’s: the starter’s plat5.yml declares them, and Plat5 serves the routes.

    KEY=plat5-uk-1-… # the personal key
    curl -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.

  5. 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 in X-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"
  6. 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"
  7. 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.
  • 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.yml says which routes your API serves and which permission each needs. plat5.yml says which roles grant them, and where each can be granted. Edit either, then run plat5 plan to see the change and plat5 apply to make it.