How sakura3id/community-portal works
Community Portal is Sakura 3’s resident identity hub: residents authenticate, complete an approval profile, and—once approved—reach the ecosystem app directory or return to the requesting app. Admin-facing mobile screens cover approvals, roles, and app-level access; the README also describes session sharing across subdomains. The workflow and auth/permission wiring are supported by sampled source. Several feature screens and integrations are represented from README claims and tree paths, so their internal call relationships are not inferred.
Main entry points: App.tsx Portal Router · supabase.ts Supabase Client · useAuth.tsx Auth Context · LoginScreen.tsx Sign-in Screen
Components 23
Portal Entry
- Portal Router
src/App.tsx - Sign-in Screen
src/components/LoginScreen.tsx - Mobile Hub
src/components/mobile/MobileHubScreen.tsx
Identity Workflow
- Profile Submission
src/components/PendingApprovalScreen.tsx - Rejected Access
src/components/RejectedScreen.tsx - App Directory
src/components/EcosystemLandingScreen.tsx - Auth Context
src/hooks/useAuth.tsx - Permission Checks
src/hooks/usePermissions.tsx
Access Governance
- Approval Review
src/components/mobile/MobileApprovalsScreen.tsx - Role Management
src/components/mobile/MobileRolesScreen.tsx - App Access Rules
src/components/mobile/MobileAppRbacScreen.tsx - Governance Logs
src/components/mobile/MobileLogsScreen.tsx
Platform Services
- Supabase Client
src/lib/supabase.ts - Supabase Auth and DB
- Google OAuth
- Demo Login Function
supabase/functions/predefined-login/index.ts - User Deletion Function
supabase/functions/delete-users/index.ts - Notification Function
supabase/functions/send-notification-email/index.ts - Resend Email
- Analytics
src/lib/analytics.ts
Other components
- Resident
- Resident App
- Ecosystem Apps
Connections 25
- Resident → Portal Router: opens portal
- Portal Router → Auth Context: provides auth
- Portal Router → Permission Checks: checks access
- Portal Router → Sign-in Screen: renders signed out
- Portal Router → Profile Submission: renders pending
- Portal Router → Rejected Access: renders rejected
- Portal Router → App Directory: renders approved
- Sign-in Screen → Auth Context: starts sign-in
- Auth Context → Supabase Client: uses client
- Supabase Client → Supabase Auth and DB: auth and data
- Supabase Auth and DB → Google OAuth: OAuth sign-in
- Auth Context → Demo Login Function: invokes demo login
- Profile Submission → Supabase Client: reads and submits profile
- Permission Checks → Supabase Client: reads roles and status
- Portal Router → Resident App: redirects after approval
- Resident App → Portal Router: requests authentication
- Supabase Auth and DB → Ecosystem Apps: shares session cookie
- Approval Review → Supabase Client: manages approvals
- Role Management → Supabase Client: manages roles
- App Access Rules → Supabase Client: manages app access
- Governance Logs → Supabase Client: reads governance logs
- User Deletion Function → Supabase Auth and DB: verifies admin and deletes
- Notification Function → Resend Email: sends notifications
- Supabase Auth and DB → Notification Function: triggers notification
- Portal Router → Analytics: tracks portal activity