How sanjeevadharshini/org_std_arch works
Triune is a multi-tenant SaaS starter with a React client and an Express/MongoDB API. The primary workflow is user sign-in, token-backed access to the student dashboard, and tenant-scoped student operations; the client also exposes a component gallery. The graph includes the documented authentication, tenant isolation, and role-based access capabilities. Some backend domains and client features are represented at subsystem level because their implementation was not excerpted; unsupported internal links are omitted.
Main entry points: App.tsx App routing · student.routes.ts Student routes · auth.controller.ts Auth controller · student.controller.ts Student controller
Components 28
Web client
- App routing
client/src/app/App.tsx - Login page
client/src/modules/auth/pages/LoginPage.tsx - Student list
client/src/modules/students/pages/StudentListPage.tsx - Component gallery
client/src/modules/gallery/pages/ComponentGalleryPage.tsx - Auth service
client/src/services/auth.service.ts - Student service
client/src/services/student.service.ts - API client
client/src/services/api/apiClient.ts - Token refresh
client/src/services/api/interceptors.ts - Reusable UI
client/src/components/ui
API and access
- Auth routes
server/src/modules/auth/auth.routes.ts - Auth controller
server/src/modules/auth/auth.controller.ts - Authentication
server/src/middlewares/auth.middleware.ts - Student routes
server/src/modules/students/student.routes.ts - Express app
server/src/app.ts - Role authorization
server/src/middlewares/role.middleware.ts
SaaS domains
- Auth service
server/src/modules/auth/auth.service.ts - Student controller
server/src/modules/students/student.controller.ts - Student service
server/src/modules/students/student.service.ts - Student repository
server/src/modules/students/student.repository.ts - Tenant and user domains
server/src/modules/tenants
Shared platform
- Tenant context
server/src/core/database/tenant-context.ts - Tenant repository base
server/src/core/database/base-tenant.repository.ts - MongoDB
- Response contract
server/src/utils/response.ts - Email notifications
server/src/core/notifications/email.service.ts - Push notifications
server/src/core/notifications/push.service.ts - Scheduled jobs
server/src/core/jobs/cron.service.ts
Other components
- User
Connections 26
- User → App routing: uses
client/src/app/App.tsx - App routing → Login page: routes to
client/src/app/App.tsx - App routing → Student list: routes to
client/src/app/App.tsx - App routing → Component gallery: routes to
client/src/app/App.tsx - Login page → Auth service: signs in
- Student list → Student service: loads student data
- Auth service → API client: sends requests
client/src/services/auth.service.ts - Student service → API client: sends requests
client/src/services/student.service.ts - API client → Token refresh: configures
client/src/services/api/apiClient.ts - App routing → Reusable UI: uses
- Express app → Auth routes: mounts
server/src/app.ts - Express app → Student routes: mounts
server/src/app.ts - Auth routes → Auth controller: dispatches to
server/src/modules/auth/auth.routes.ts - Auth controller → Auth service: calls
server/src/modules/auth/auth.controller.ts - Auth service → Tenant and user domains: checks tenant and user
server/src/modules/auth/auth.service.ts - Student routes → Authentication: authenticates
server/src/modules/students/student.routes.ts - Student routes → Role authorization: checks roles
server/src/modules/students/student.routes.ts - Student routes → Student controller: dispatches to
server/src/modules/students/student.routes.ts - Student controller → Student service: calls
server/src/modules/students/student.controller.ts - Student service → Student repository: uses
server/src/modules/students/student.service.ts - Student repository → Tenant repository base: extends tenant access
- Tenant repository base → Tenant context: reads scope
server/src/core/database/base-tenant.repository.ts - Tenant repository base → MongoDB: queries
server/src/core/database/base-tenant.repository.ts - Auth controller → Response contract: formats responses
server/src/modules/auth/auth.controller.ts - Student controller → Response contract: formats responses
server/src/modules/students/student.controller.ts - Authentication → Tenant context: sets user scope
server/src/middlewares/auth.middleware.ts