How fjdvm/brenraphaels-authentication-microservice works
This is a staff access portal: users authenticate centrally, see systems and modules they may access, and launch connected business systems through a one-time-code/handle handoff. Administrators manage users, access, account requests and audit logs; members can review activity. Separate integration endpoints support authorization, validation, exchange and payment-account reads. The graph preserves these documented capabilities and the sampled audit, payment and provisioning layers. Several routes and UI areas were not sampled, so their internal call relationships are omitted rather than inferred.
Main entry points: prisma.ts Portal database · page.tsx Staff portal home · session.ts Session and guards · route.ts Payment account APIs
Components 27
Identity and access
- Login experience
app/(auth)/login/page.tsx - Session and guards
lib/auth/session.ts - Auth provider
lib/auth/server.ts - Password reset webhook
app/api/webhooks/neon-auth/route.ts
Portal experience
- Staff portal home
app/page.tsx - Accessible systems
lib/portal/accessible-systems.ts - Portal shell
components/layout/portal-shell.tsx - System launch cards
components/portal/system-launch-cards.tsx
Administration
- Admin access overview
app/(protected)/admin/access/page.tsx - User and access management
lib/admin - Account request fulfillment
lib/account-requests/fulfillment.server.ts
System integrations
- Integration API routes
app/api/integrations - System handoff
lib/integrations/handoff.ts - Handoff persistence ports
lib/integrations/prisma-ports.server.ts - Payment account APIs
app/api/integrations/payment-details/route.ts - Payment account rules
lib/settings/payment-accounts.ts - Payment account persistence
lib/settings/payment-accounts.server.ts
Audit and services
- System logs view
components/admin/system-logs-view.tsx - Audit log access
lib/audit/audit-logs.server.ts - Audit queries
lib/audit/system-logs-query.ts - Member activity log
app/(protected)/my-logs/page.tsx - Portal database
lib/db/prisma.ts
Other components
- Portal user
- Business system
- Neon Auth
- Audit log service
- SMTP email
Connections 32
- Portal user → Login experience: signs in
app/(auth)/login/page.tsx - Login experience → Session and guards: checks session
app/(auth)/login/page.tsx - Session and guards → Auth provider: checks identity
lib/auth/session.ts - Auth provider → Neon Auth: uses
lib/auth/server.ts - Session and guards → Portal database: reads user
lib/auth/session.ts - Portal user → Staff portal home: opens portal
app/page.tsx - Staff portal home → Session and guards: requires user
app/page.tsx - Staff portal home → Accessible systems: loads access
app/page.tsx - Staff portal home → Portal shell: renders
app/page.tsx - Staff portal home → System launch cards: renders
app/page.tsx - Accessible systems → Portal database: reads systems
lib/portal/accessible-systems.ts - Portal user → Admin access overview: opens admin
app/(protected)/admin/access/page.tsx - Admin access overview → Session and guards: requires user
app/(protected)/admin/access/page.tsx - Admin access overview → Audit log access: loads activity
app/(protected)/admin/access/page.tsx - Account request fulfillment → Portal database: updates requests
lib/account-requests/fulfillment.server.ts - Account request fulfillment → User and access management: provisions user
lib/account-requests/fulfillment.server.ts - Member activity log → Audit log access: loads activity
app/(protected)/my-logs/page.tsx - Member activity log → Audit queries: parses date range
app/(protected)/my-logs/page.tsx - Member activity log → System logs view: renders admin view
app/(protected)/my-logs/page.tsx - Audit log access → Audit log service: reads and writes
lib/audit/audit-logs.server.ts - System logs view → Audit queries: uses filters
components/admin/system-logs-view.tsx - Integration API routes → System handoff: routes handoff
app/api/integrations/authorize/route.ts - Integration API routes → Handoff persistence ports: uses persistence
app/api/integrations/authorize/route.ts - Handoff persistence ports → Portal database: reads and writes
lib/integrations/prisma-ports.server.ts - Business system → Integration API routes: calls APIs
- Payment account APIs → Handoff persistence ports: checks system
app/api/integrations/payment-details/route.ts - Payment account APIs → Payment account persistence: loads active accounts
app/api/integrations/payment-details/route.ts - Payment account APIs → Payment account rules: selects settings
app/api/integrations/payment-details/route.ts - Payment account persistence → Portal database: reads and persists
lib/settings/payment-accounts.server.ts - Neon Auth → Password reset webhook: sends reset event
- Password reset webhook → Portal database: checks user
app/api/webhooks/neon-auth/route.ts - Password reset webhook → SMTP email: sends reset email
app/api/webhooks/neon-auth/route.ts