Quickstart
Plystra Core v1.0 is a self-hosted identity and authorization service. It separates login accounts from the business identity that acts inside a Space:
User -> UserMember -> Member -> SpaceThe current Core repository includes the HTTP API server, PostgreSQL migrations, Ent schemas, the authorization engine, the Finance Reviewer demo, OpenAPI artifacts, and release readiness checks.
Prerequisites
Section titled “Prerequisites”- Go, using the version supported by the Core repository.
- Docker and Docker Compose.
- PostgreSQL through the included Compose baseline, or a compatible PostgreSQL database.
rgis useful for maintainers but is not required to run Core.
Install
Section titled “Install”git clone https://github.com/plystra/plystra.gitcd plystracp .env.example .envdocker compose up -dThe Compose baseline starts PostgreSQL and plystra-core. Core reads .env, uses DOCKER_DATABASE_URL inside Compose, and exposes the API on SERVER_PORT, which defaults to 8080.
Apply and Verify the Schema
Section titled “Apply and Verify the Schema”Run migrations before relying on any API behavior:
go run ./cmd/plystractl migrate upgo run ./cmd/plystractl migrate verifygo run ./cmd/plystractl ent checkgo run ./cmd/plystractl doctorExpected healthy output includes:
migrations verifiedent schema is in syncenvironment: developmentconfiguration: okdatabase: okmigrations: currentschema: okservice readiness: okdoctor warns when development secrets still use defaults. In production those same conditions become startup blockers.
Run the Demo
Section titled “Run the Demo”go run ./cmd/explain-demoThe demo prints four required traces:
| Case | Decision | What it proves |
|---|---|---|
| Alice approves Finance APAC invoice | allow | group_tree covers a descendant group. |
| Alice approves Legal EMEA invoice | deny: SCOPE_OUT_OF_BOUNDS | Group boundaries are enforced. |
| Bob approves through the same Member | allow | Multiple Users can act through the same Member identity. |
| Alice uses a revoked binding | deny: USER_MEMBER_REVOKED | UserMember is the active authorization bridge. |
If this demo output looks correct, the fastest next step is Integrate Your App. That guide turns this same model into copy-paste API calls for your own Space, identities, resources, roles, and backend guard.
Start the API
Section titled “Start the API”go run ./cmd/plystradPublic operational endpoints:
curl http://localhost:8080/api/v1/healthcurl http://localhost:8080/api/v1/readycurl http://localhost:8080/api/v1/versionLegacy operational aliases also exist under /system/* and /api/v1/system/*.
Use Protected API Routes
Section titled “Use Protected API Routes”All non-public Core API routes require the bootstrap admin token:
curl -H "X-Plystra-Admin-Token: $PLYSTRA_ADMIN_TOKEN" \ http://localhost:8080/api/v1/audit-logsThe same token can also be passed as Authorization: Bearer <token> for admin-token protected routes. Session endpoints use a separate opaque bearer-token flow.
For an end-to-end business integration, use Integrate Your App instead of assembling the individual endpoint calls from scratch.
Login Flow
Section titled “Login Flow”The seeded local demo users are:
alice@example.com / plystra-demobob@example.com / plystra-demoLogin returns an opaque access token, refresh token, active actor context, and available member bindings:
curl -X POST http://localhost:8080/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"alice@example.com","password":"plystra-demo"}'Use the access token for actor context:
curl -H "Authorization: Bearer $ACCESS_TOKEN" \ http://localhost:8080/api/v1/actor/contextProduction Baseline
Section titled “Production Baseline”Before setting SERVER_MODE=production, configure:
DATABASE_URLPLYSTRA_SESSION_SECRET or JWT_SECRETPLYSTRA_ADMIN_TOKENCORS_ALLOWED_ORIGINSSERVER_PUBLIC_URLProduction mode rejects default database credentials, short or default secrets, wildcard CORS origins, and localhost public URLs.
What Is Disabled by Default
Section titled “What Is Disabled by Default”The current v1.0 release keeps risky preview surfaces closed unless explicitly enabled:
DATA_CONSOLE_ENABLED=falseMETRICS_ENABLED=falseWhen disabled, those routes return FEATURE_DISABLED.