How emn90909/emtra works
Purpose and Runtime
This is a Vite-built React/TypeScript single-page application for a public product/marketing site plus authenticated user and administrator dashboards. It is deployable on Vercel and uses Supabase for authentication and application data. Primary browser bootstrap: src/main.tsx; application composition and route selection: src/App.tsx.
Public Site and Route Pages
Public-facing pages cover the landing experience, products, learning content, contact/support, and legal pages. The landing page is assembled from reusable content sections, while standalone pages support deeper product and support flows.
• src/pages/Index.tsx
• src/pages/Products.tsx
• src/pages/Support.tsx
Shared site shell elements are provided by navigation and footer components:
• src/components/layout/Navbar.tsx
• src/components/layout/Footer.tsx
Marketing Content Composition
The public landing experience is componentized into independently maintainable visual/content sections, including hero messaging, capabilities, methodology, testimonials, and calls to action. Animation/reveal behavior is isolated from the content sections.
• src/components/sections/Hero.tsx
• src/components/sections/Capabilities.tsx
• src/components/Reveal.tsx
This boundary lets public-content changes remain separate from authenticated application behavior.
Authentication and Session Boundary
Authentication UI supports login, signup-related routing, multi-factor enrollment, and MFA verification. A session context provider establishes authenticated client state for the component tree; protected dashboard/admin behavior should depend on this boundary rather than local page state.
• src/components/auth/SessionContextProvider.tsx
• src/components/auth/LoginForm.tsx
• src/components/auth/MFAEnroll.tsx
Supabase client integration is centralized at:
• src/integrations/supabase/client.ts
User Dashboard
Authenticated users enter a dashboard page that composes account settings, overview data, community content, and open-issue views. This is the primary post-authentication control flow: session established → dashboard route → selected dashboard content.
• src/pages/Dashboard.tsx
• src/components/dashboard/Overview.tsx
• src/components/dashboard/OpenIssues.tsx
Role-Based Administration
Administration is separated into a dedicated route/page, role detection hook, admin dashboard content, and management views for blog and issue records. The authorization boundary is represented by the admin hook and should gate admin page/content access.
• src/hooks/useAdmin.ts
• src/pages/admin/AdminDashboard.tsx
• src/components/admin/AdminIssueManagement.tsx
Data, Styling, and Deployment
Supabase migrations define the backend schema/evolution history, while the frontend uses Tailwind-oriented styling plus a local reusable UI component layer. Vite is the development/build runtime; vercel.json represents deployment configuration.
• supabase/migrations/0000_sincere_iguana_trot.sql
• src/components/ui
• tailwind.config.ts
• vercel.json
Main entry points: App.tsx App Composition & Routes · client.ts Supabase Client · Dashboard.tsx User Dashboard · Index.tsx Landing Page
Components 22
Public Site
- Landing Page
src/pages/Index.tsx - Products Page
src/pages/Products.tsx - Support Page
src/pages/Support.tsx - Navigation & Footer
src/components/layout/Navbar.tsx - Marketing Sections · Hero and capabilities compose the landing experience.
src/components/sections/Hero.tsx - Reveal Animation
src/components/Reveal.tsx
Authentication
- Session Provider · Establishes authenticated client state for the application tree.
src/components/auth/SessionContextProvider.tsx - Login UI
src/components/auth/LoginForm.tsx - MFA Enrollment
src/components/auth/MFAEnroll.tsx
Authenticated App
- User Dashboard
src/pages/Dashboard.tsx - Dashboard Overview
src/components/dashboard/Overview.tsx - Open Issues
src/components/dashboard/OpenIssues.tsx
Administration
- Admin Role Check · Gates administrator route and content access.
src/hooks/useAdmin.ts - Admin Dashboard
src/pages/admin/AdminDashboard.tsx - Issue Management
src/components/admin/AdminIssueManagement.tsx
Platform
- Supabase Client · Central client for authentication and application data.
src/integrations/supabase/client.ts - Database Migrations
supabase/migrations/0000_sincere_iguana_trot.sql - Reusable UI Layer
src/components/ui - Tailwind Styling
tailwind.config.ts - Vercel Deployment
vercel.json
Other components
- Browser Bootstrap
src/main.tsx - App Composition & Routes
src/App.tsx
Connections 27
- Browser Bootstrap → App Composition & Routes: mounts
- Browser Bootstrap → Session Provider: provides session
- App Composition & Routes → Landing Page: public route
- App Composition & Routes → Products Page: public route
- App Composition & Routes → Support Page: public route
- App Composition & Routes → Login UI: auth route
- App Composition & Routes → MFA Enrollment: MFA route
- App Composition & Routes → User Dashboard: protected route
- App Composition & Routes → Admin Dashboard: admin route
- Landing Page → Navigation & Footer: uses
- Landing Page → Marketing Sections: composes
- Marketing Sections → Reveal Animation: animates with
- Session Provider → Supabase Client: auth session
- Login UI → Supabase Client: authenticates via
- MFA Enrollment → Supabase Client: verifies via
- Session Provider → User Dashboard: authorizes access
- User Dashboard → Dashboard Overview: composes
- User Dashboard → Open Issues: composes
- User Dashboard → Supabase Client: reads application data
- Admin Dashboard → Admin Role Check: checks role
- Admin Role Check → Supabase Client: reads role
- Admin Dashboard → Issue Management: composes
- Issue Management → Supabase Client: manages records
- Database Migrations → Supabase Client: evolves schema
- App Composition & Routes → Reusable UI Layer: uses components
- Reusable UI Layer → Tailwind Styling: styled by
- Vercel Deployment → Browser Bootstrap: deploys built app