Olympus Docs
InternalsAthena

Athena, route map

Every page route and API route in the Athena admin dashboard

Athena exposes 19 user-facing pages and 24 API routes (route.ts files), grouped into 12 feature modules. This page maps them all.

Page routes

PathSourcePurpose
/src/app/page.tsxDashboard home with analytics widgets.
/identitiessrc/app/identities/page.tsxList + filter identities.
/identities/[id]src/app/identities/[id]/page.tsxIdentity detail: traits, credentials, verifiable addresses.
/sessionssrc/app/sessions/page.tsxAll active sessions; revoke.
/oauth2-clientssrc/app/oauth2-clients/page.tsxOAuth2 client management.
/oauth2-clients/[id]src/app/oauth2-clients/[id]/page.tsxClient detail.
/oauth2-tokenssrc/app/oauth2-tokens/page.tsxToken introspection.
/m2m-clientssrc/app/m2m-clients/page.tsxM2M client management (with secret rotation).
/messagessrc/app/messages/page.tsxKratos courier message log (verification, recovery).
/schemassrc/app/schemas/page.tsxIdentity schemas; live reload.
/settingssrc/app/settings/page.tsxSettings vault editor (Athena + global settings).
/social-connectionssrc/app/social-connections/page.tsxOIDC IdP connections.
/locked-accountssrc/app/locked-accounts/page.tsxActive lockouts; manual unlock.
/securitysrc/app/security/page.tsxSecurity audit log.
/analyticssrc/app/analytics/page.tsxPKCE analytics, MFA stats, login attempts.
/login, /logout, /callbacksrc/app/<...>/page.tsxOAuth2 login flow into Athena.

API routes

PathMethodsSource
/api/healthGETsrc/app/api/health/route.ts
/api/auth/loginGETsrc/app/api/auth/login/route.ts
/api/auth/callbackGETsrc/app/api/auth/callback/route.ts
/api/auth/logoutPOSTsrc/app/api/auth/logout/route.ts
/api/auth/sessionGETsrc/app/api/auth/session/route.ts
/api/identitiesGET, POSTsrc/app/api/identities/route.ts
/api/identities/[id]GET, PATCH, DELETEsrc/app/api/identities/[id]/route.ts
/api/sessionsGET, DELETEsrc/app/api/sessions/route.ts
/api/clients/m2mGET, POSTsrc/app/api/clients/m2m/route.ts
/api/clients/m2m/[id]GET, DELETEsrc/app/api/clients/m2m/[id]/route.ts
/api/clients/m2m/[id]/rotate-secretPOSTsrc/app/api/clients/m2m/[id]/rotate-secret/route.ts
/api/connections/publicGETsrc/app/api/connections/public/route.ts
/api/connections/socialGET (deprecated)src/app/api/connections/social/route.ts
/api/oauth2/clientsGET, POSTsrc/app/api/oauth2/clients/route.ts
/api/oauth2/clients/[id]GET, PATCH, DELETEsrc/app/api/oauth2/clients/[id]/route.ts
/api/oauth2/tokensPOST (introspect)src/app/api/oauth2/tokens/route.ts
/api/locked-accountsGETsrc/app/api/locked-accounts/route.ts
/api/locked-accounts/[id]/unlockPOSTsrc/app/api/locked-accounts/[id]/unlock/route.ts
/api/messagesGETsrc/app/api/messages/route.ts
/api/schemasGET, POSTsrc/app/api/schemas/route.ts
/api/schemas/[id]GET, PATCH, DELETEsrc/app/api/schemas/[id]/route.ts
/api/settingsGETsrc/app/api/settings/route.ts
/api/settings/batchPOSTsrc/app/api/settings/batch/route.ts
/api/settings/[key]GET, PUT, DELETEsrc/app/api/settings/[key]/route.ts
/api/configGETsrc/app/api/config/route.ts

The generated per-route reference is at Reference, Athena API.

Feature module layout

Under src/features/, these are the logical groupings:

ModuleResponsibility
analyticsDashboard widgets, PKCE/MFA charts.
authAthena's own auth chain (session cookie, OAuth2 callback).
identitiesIdentity CRUD UI + list view.
m2m-clientsM2M client management.
messagesCourier message log.
oauth2-authOAuth2 login flow into Athena.
oauth2-clientsOAuth2 client management.
oauth2-tokensToken introspection UI.
schemasIdentity schemas + live reload.
securityAudit log viewer.
sessionsSessions list + revoke.
settingsSettings vault UI.

Each feature module typically contains: page.tsx (Next.js route), actions.ts (server actions / API client calls), components/ (atomic feature-specific React).

Service layer

Under src/services/, these wrap the Kratos and Hydra admin APIs:

  • services/kratos/, admin and public Kratos client (10 endpoint wrappers).
  • services/hydra/, admin Hydra client (clients, consent sessions, tokens).

Reasoning: Athena should never call Kratos or Hydra directly from a route handler, always through the service layer. This makes mocking in tests trivial and keeps the auth-passing logic in one place.

Middleware chain

src/middleware.ts is the Next.js edge middleware. The full chain:

  1. isPublicRoute? (/api/health, /api/auth/**, /api/connections/social) → pass through.
  2. isProxyRoute? (/api/kratos/**, /api/hydra/**, /api/iam-kratos/**, /api/iam-kratos-admin/**, /api/hydra-admin/**) → pass through (the Ory APIs enforce their own auth).
  3. verifySession(cookie) → 401 if invalid or missing.
  4. isAdminRoute? + check role === admin → 403 if not admin.
  5. Route handler runs.

See Athena API Authentication for the auth chain in full detail.

Testing approach

Unit tests with Vitest, mocking the services/kratos/* and services/hydra/* modules, see Develop, Testing strategy. The service-layer abstraction makes this clean.

End-to-end tests with Playwright cover a small set of golden-path flows: log in as admin, create an identity, list identities, delete identity, log out. Not exhaustive, Vitest does the bulk.

Where next

On this page