How mauriceos/residential-app works
Purpose and repository shape
This is an NCRRA member-platform repository containing two parallel deliverables: a TypeScript/Vite interactive application scaffold and an implementation-oriented platform with mobile, service, provider-adapter, contract, and operations artifacts. The implementation is organized around membership, ticketing, tenant isolation, and member-facing mobile flows.
TypeScript application entry and UI shell
The runnable TypeScript application enters through ncrra-app/client/src/main.tsx and composes its top-level UI in ncrra-app/client/src/App.tsx. Its Node server starts at ncrra-app/server/index.ts, with shared API routing in ncrra-app/server/routers.ts.
• The client contains Home, navigation, dashboard layout, map, and AI chat surfaces, centered on ncrra-app/client/src/pages/Home.tsx, ncrra-app/client/src/components/DashboardLayout.tsx, and ncrra-app/client/src/components/AIChatBox.tsx.
• Client-server interaction is mediated through tRPC client/server infrastructure: ncrra-app/client/src/lib/trpc.ts, ncrra-app/server/_core/trpc.ts, and ncrra-app/server/_core/context.ts.
• This stack also includes platform-provided capabilities such as OAuth, LLM, mapping, notification, storage proxy, image generation, and voice transcription under ncrra-app/server/_core/.
Mobile member application
The production-oriented member client is a Flutter app, entered at ncrra-app/implementation/mobile/flutter/ncrra_member_app/lib/main.dart and assembled by ncrra-app/implementation/mobile/flutter/ncrra_member_app/lib/src/app.dart.
• Authentication is composed around a Keycloak OIDC session: lib/src/core/auth/authentication_composition.dart and lib/src/core/auth/keycloak_oidc_session.dart.
• The network boundary is centralized in lib/src/core/network/ncrra_api_client.dart, separating feature UI from backend transport.
• Feature stages include onboarding, member sections, home, and ticket dashboard: lib/src/features/onboarding/presentation/onboarding_flow.dart, lib/src/features/member_sections/presentation/member_section_screens.dart, and lib/src/features/tickets/presentation/ticket_dashboard_screen.dart.
• Android and iOS packaging are maintained in the same Flutter project.
Domain services and persistence
Two independent ASP.NET services define primary backend domain boundaries:
• Membership API: ncrra-app/implementation/backend/dotnet/Ncrra.Membership.Api/Program.cs with EF Core persistence in Persistence/MembershipDbContext.cs.
• Ticketing API: ncrra-app/implementation/backend/dotnet/Ncrra.Ticketing.Api/Program.cs with persistence in Persistence/TicketingDbContext.cs.
• Each service owns migrations and a tenant database-session mechanism, e.g. Ncrra.Membership.Api/Security/TenantSessionScope.cs and Ncrra.Ticketing.Api/Security/TenantSessionScope.cs. This makes tenant context a hard boundary between request handling and PostgreSQL access, with RLS integration SQL supplied per service.
Provider integration and contracts
External-provider connectivity is isolated in a Go provider-adapter rather than embedded in membership or ticketing services. Its service entry point is ncrra-app/implementation/backend/go/provider-adapter/cmd/provider-adapter/main.go; agreement-record processing has a separate command at cmd/agreement-record/main.go.
• Provider implementations conform to a port/registry boundary in internal/provider/port.go and internal/provider/registry.go.
• Cross-service/API contracts are versioned independently: implementation/contracts/openapi/ticketing.openapi.yaml and implementation/contracts/events/ticket-created.v1.json.
Runtime infrastructure and delivery
The target platform is containerized with PostgreSQL, Keycloak, Caddy, and observability components defined by ncrra-app/implementation/ops/compose/compose.yaml. Supporting configs include otel-collector.yaml, prometheus.yml, and Caddyfile.
• Keycloak realm configuration is versioned at implementation/ops/keycloak/realm-ncrra-dev.json.
• Ansible bootstrap/inventory artifacts support environment provisioning: implementation/ops/ansible/playbooks/bootstrap.yml.
• CI includes general verification and database migration workflows: ncrra-app/.github/workflows/verify.yml and ncrra-app/.github/workflows/rls-migrations.yml.
Main entry points: compose.yaml Container runtime · Ncrra.Ticketing.Api/Program.cs Ticketing API · app.dart Member flows · Ncrra.Membership.Api/Program.cs Membership API
Components 21
TypeScript Scaffold
Interactive Vite app and Node API.
- Vite client
ncrra-app/client/src/main.tsx - Dashboard & member UI · Home, dashboard, map, and AI chat surfaces.
ncrra-app/client/src/App.tsx - Node API
ncrra-app/server/index.ts - tRPC boundary · Shared client, server, and request context.
ncrra-app/server/_core/trpc.ts
Member Mobile App
Flutter member-facing client.
- Flutter app
ncrra-app/implementation/mobile/flutter/ncrra_member_app/lib/main.dart - Member flows · Onboarding, member sections, home, and tickets.
ncrra-app/implementation/mobile/flutter/ncrra_member_app/lib/src/app.dart - Keycloak OIDC session
- NCRRA API client
Domain Services
Tenant-isolated membership and ticketing APIs.
- Membership API
ncrra-app/implementation/backend/dotnet/Ncrra.Membership.Api/Program.cs - Membership tenant session · Sets tenant context before database access.
- Membership PostgreSQL
ncrra-app/implementation/backend/dotnet/Ncrra.Membership.Api/Persistence/MembershipDbContext.cs - Ticketing API
ncrra-app/implementation/backend/dotnet/Ncrra.Ticketing.Api/Program.cs - Ticketing tenant session · Sets tenant context before database access.
- Ticketing PostgreSQL
ncrra-app/implementation/backend/dotnet/Ncrra.Ticketing.Api/Persistence/TicketingDbContext.cs
Integration & Contracts
Provider boundary and versioned interchange.
- Provider adapter · Isolates external-provider connectivity.
ncrra-app/implementation/backend/go/provider-adapter/cmd/provider-adapter/main.go - Provider port & registry
- Ticketing contracts · Versioned API and ticket-created event contracts.
Platform Operations
Runtime, identity, provisioning, and delivery.
- Container runtime · PostgreSQL, Keycloak, Caddy, and observability.
ncrra-app/implementation/ops/compose/compose.yaml - Keycloak realm
- Environment bootstrap
- Verification & RLS CI · Verification and database migration workflows.
ncrra-app/.github/workflows/rls-migrations.yml
Connections 23
- Vite client → Dashboard & member UI: renders
- Dashboard & member UI → tRPC boundary: calls
- Node API → tRPC boundary: hosts
- Flutter app → Member flows: assembles
- Member flows → Keycloak OIDC session: authenticates
- Member flows → NCRRA API client: uses
- Keycloak OIDC session → Keycloak realm: OIDC realm
- NCRRA API client → Membership API: member requests
- NCRRA API client → Ticketing API: ticket requests
- Membership API → Membership tenant session: establishes
- Membership tenant session → Membership PostgreSQL: RLS-scoped access
- Ticketing API → Ticketing tenant session: establishes
- Ticketing tenant session → Ticketing PostgreSQL: RLS-scoped access
- Ticketing API → Provider adapter: provider integration
- Provider adapter → Provider port & registry: implements
- Ticketing API → Ticketing contracts: implements
- Container runtime → Membership API: runs
- Container runtime → Ticketing API: runs
- Container runtime → Provider adapter: runs
- Container runtime → Keycloak realm: loads
- Environment bootstrap → Container runtime: provisions
- Verification & RLS CI → Membership PostgreSQL: migrates RLS
- Verification & RLS CI → Ticketing PostgreSQL: migrates RLS