Getting Started

Architecture

How Urmate request flow, dashboards, APIs, services, database, and integrations fit together.

Architecture

Urmate uses Next.js App Router with server route handlers, Prisma, Better Auth, and feature-specific service modules.

Request Flow

Browser
  -> app/(routes) page
  -> components/*
  -> app/api route handler
  -> lib/* service
  -> Prisma / external provider / runtime service

Layers

LayerPathResponsibility
Pagesapp/(routes)User-facing routes and route groups.
APIsapp/apiServer route handlers, webhooks, provider proxies, runtime controls.
UIcomponentsDashboard shells, feature pages, shared UI primitives.
Domain logiclibBusiness logic, auth, Prisma access, XRouter, study, chat, infra, runtime helpers.
Databaseprisma/schema.prismaRelational schema.
ScriptsscriptsDev servers, sync jobs, relay scripts.

Dashboard Shells

ShellFile
Main dashboardcomponents/dashboard/dashboard-sidebar.tsx
Studycomponents/dashboard/study-sidebar.tsx
Instructorcomponents/dashboard/study-instructor-sidebar.tsx
Study Admincomponents/dashboard/study-admin-sidebar.tsx
Chatcomponents/chat-dashboard/chat-sidebar.tsx
XRoutercomponents/dashboard/xrouter-sidebar.tsx
Cloud Infrastructurecomponents/dashboard/cloudinfrastructure-sidebar.tsx
Game Buildercomponents/dashboard/game-builder-sidebar.tsx
Code Tutorcomponents/dashboard/code-tutor-sidebar.tsx
Platform Admincomponents/admin/admin-sidebar.tsx

Auth Boundary

Auth is handled by Better Auth:

  • lib/auth.ts
  • lib/auth-client.ts
  • lib/auth-session.ts
  • lib/admin-session.ts
  • app/api/auth/[...all]/route.ts

Server-side access checks are required for admin, instructor, billing, runtime, and secret-bearing APIs.

Integration Patterns

IntegrationPattern
Telegram/Discord/MetaProvider records + webhook receiver + channel agent runtime.
Google CalendarInstructor OAuth flow with separate Calendar client.
XRouterProvider registry + model catalog + OpenAI/Anthropic-compatible endpoints.
Builder/Game/Code runtimesRuntime session records + start/stop APIs + external process/service.
VPS infraRelay service + heartbeat + command/file/port APIs.
CirclesSSO/session/avatar bridge + optional separate hosted app.
Copyright © 2026