How juma1-hub/crystal-investment-test-2 works
Crystal Investments is a Supabase-backed investment platform. Visitors explore the firm and its opportunities, register or sign in, then use the investor portal to review account information and manage investment-related requests; administrators oversee operations through a separate console. The README also documents manual, MFA-protected financial review and gated payment automation. The graph preserves those documented capabilities, but the database migrations are absent from the supplied tree and the relevant admin/payment excerpts are incomplete, so uncertain implementation links are omitted.
Main entry points: supabase.ts Supabase client · InvestorPortal.tsx Investor portal · AdminConsole.tsx Admin console · app Public routes
Components 31
Public website
- Public routes
app - Home page
app/page.tsx - Opportunities
app/opportunities/page.tsx - Investment divisions
components/PublicInvestmentDivisions.tsx - Managed site text
components/SiteContentText.tsx - Site shell
app/layout.tsx - Registration
app/register/page.tsx - Sign in
app/login/page.tsx
Investor portal
- Investor routes
app/investor - Investor portal
components/InvestorPortal.tsx - Account overview
components/InvestorLiveOverview.tsx - KYC documents
components/InvestorKycUpload.tsx - Statements
components/InvestorStatement.tsx - Referral account
components/InvestorReferralPanel.tsx - Investor support
components/InvestorSupportInbox.tsx - Notifications
components/InvestorNotificationSettings.tsx
Administration
- Admin routes
app/admin - Admin console
components/AdminConsole.tsx - Portfolio management
components/AdminPortfolioManager.tsx - Financial requests
components/AdminFinancialRequests.tsx - Referral administration
components/AdminReferralManager.tsx - Branches and team
components/AdminBranchesManager.tsx - Roles and permissions
components/AdminRolesManager.tsx - Site management
components/AdminSiteManager.tsx
Platform services
- Supabase client
lib/supabase.ts - Supabase platform
- Daily accrual
supabase/functions/crystal-daily-accrual/index.ts - M-Pesa initiation
supabase/functions/mpesa-stk-push/index.ts - M-Pesa callback
supabase/functions/mpesa-callback/index.ts - Auth rate-limit gateway
cloudflare/src/index.mjs
Other components
- Visitor
Connections 39
- Visitor → Public routes: browses
- Public routes → Home page: serves home
- Home page → Opportunities: links to
app/page.tsx - Opportunities → Investment divisions: renders
app/opportunities/page.tsx - Opportunities → Managed site text: renders
app/opportunities/page.tsx - Public routes → Registration: serves registration
- Public routes → Sign in: serves sign-in
- Site shell → Public routes: wraps routes
app/layout.tsx - Registration → Supabase client: uses client
app/register/page.tsx - Sign in → Supabase client: uses client
app/login/page.tsx - Investor routes → Investor portal: renders portal
app/investor/[section]/page.tsx - Investor routes → Account overview: renders overview
app/investor/page.tsx - Investor routes → Referral account: renders referrals
app/investor/page.tsx - Investor portal → KYC documents: renders
components/InvestorPortal.tsx - Investor portal → Statements: renders
components/InvestorPortal.tsx - Investor portal → Referral account: renders
components/InvestorPortal.tsx - Investor portal → Investor support: renders
components/InvestorPortal.tsx - Investor portal → Notifications: renders
components/InvestorPortal.tsx - Investor portal → Supabase client: uses client
components/InvestorPortal.tsx - Account overview → Supabase client: uses client
components/InvestorLiveOverview.tsx - Referral account → Supabase client: uses client
components/InvestorReferralPanel.tsx - Admin routes → Admin console: renders console
app/admin/page.tsx - Admin console → Portfolio management: manages portfolio
- Admin console → Financial requests: manages requests
- Admin console → Referral administration: manages referrals
- Admin console → Branches and team: manages branches
- Admin console → Roles and permissions: manages permissions
- Admin console → Site management: manages content
- Portfolio management → Supabase client: uses client
components/AdminPortfolioManager.tsx - Referral administration → Supabase client: uses client
components/AdminReferralManager.tsx - Branches and team → Supabase client: uses client
components/AdminBranchesManager.tsx - Roles and permissions → Supabase client: uses client
components/AdminRolesManager.tsx - Site management → Supabase client: uses client
components/AdminSiteManager.tsx - Supabase client → Supabase platform: connects to
lib/supabase.ts - Managed site text → Supabase client: reads configuration
components/SiteContentText.tsx - Daily accrual → Supabase platform: posts accrual
- M-Pesa initiation → Supabase platform: uses backend
- M-Pesa callback → Supabase platform: updates payment
- Auth rate-limit gateway → Supabase client: proxies auth