How proobker/bnks works
Purpose and Runtime
EduFit is an education-oriented web application centered on student/teacher authentication, student assessments, personalized event recommendations, and dashboard views. The active architecture is Next.js App Router, with the root layout and route entry points in src/app/layout.tsx and src/app/page.tsx. The repository also retains parallel Vite/legacy React entry points (src/main.tsx, src/App.tsx), which create a material boundary and potential source-of-truth ambiguity.
Route Surface and UI Stages
Primary user-facing flows are implemented as App Router pages:
• Authentication: src/app/(auth)/student-login/page.tsx, src/app/(auth)/teacher-login/page.tsx, and OAuth completion at src/app/(auth)/callback/page.tsx.
• Student workflow: src/app/student/page.tsx and src/app/assessment/page.tsx.
• Recommendation output: src/app/recommendations/page.tsx.
The root layout (src/app/layout.tsx) supplies application-wide rendering concerns, while src/app/globals.css is the global styling boundary.
Authentication and Authorization
Authentication state is managed through React context, principally src/context/AuthContext.tsx, with Supabase client access in src/lib/supabase.ts. Login-specific UI separates student Google authentication (src/components/auth/StudentGoogleButton.tsx) from teacher credential entry (src/components/auth/TeacherLoginForm.tsx).
Route access is guarded by components including src/components/RouteProtection.tsx and src/components/auth/ProtectedRoute.tsx. The callback route is the handoff boundary where external OAuth identity returns to the application.
Assessment-to-Recommendation Pipeline
The core product flow is: authenticated student enters or completes assessment data → application scores/matches the student → matching events are rendered as recommendations.
Assessment orchestration begins at src/app/assessment/page.tsx. Domain calculations are isolated in src/lib/scoring.ts; AI-related enrichment or generation is bounded in src/lib/ai.ts. Recommendations are presented from src/app/recommendations/page.tsx, with matching logic in src/lib/event-matching.ts and event discovery UI in src/components/events/EventFinder.tsx.
Event Domain and Data Contracts
Event records and matching contracts are represented locally in src/data/events.ts, src/lib/event-types.ts, and shared types in src/lib/types.ts. This separates static/sample event catalog data from the recommendation algorithm. Matching should consume normalized assessment outputs and event types rather than page-local UI state.
Persistence and External Services
Supabase is the principal backend integration, configured through src/lib/supabase.ts (with an older JavaScript counterpart at src/lib/supabase.js). Database structure is declared in supabase/schema.sql; environment configuration is expected via .env.example. Supabase likely provides authentication and relational persistence, while Google is an external identity provider for the student login path. Next.js is deployable to Vercel per the project baseline.
Legacy/Duplicate Implementation Boundary
The tree contains overlapping JavaScript and TypeScript implementations: src/contexts/AuthContext.tsx versus src/context/AuthContext.tsx, plus legacy pages such as src/pages/Dashboard.tsx and src/pages/Landing.tsx. App Router paths under src/app/ should be treated as the primary runtime surface because the repository is configured as Next.js (next.config.ts); Vite-era files (vite.config.ts, src/main.tsx) require deliberate consolidation or isolation before extending cross-cutting behavior.
Main entry points: event-matching.ts Event matching · scoring.ts Scoring · supabase.ts Supabase · page.tsx Student dashboard
Components 20
Next.js App Router
Primary runtime surface.
- Root layout · Supplies application-wide rendering concerns.
src/app/layout.tsx - Route entry
src/app/page.tsx - Student dashboard
src/app/student/page.tsx
Authentication
- Login routes · Student and teacher login entry points.
src/app/(auth)/student-login/page.tsx - OAuth callback · External identity handoff boundary.
src/app/(auth)/callback/page.tsx - Auth state
src/context/AuthContext.tsx - Login UI · Google student sign-in and teacher credential form.
src/components/auth/StudentGoogleButton.tsx - Route guards
src/components/RouteProtection.tsx
Assessment & Recommendations
- Assessment · Collects and orchestrates student assessment input.
src/app/assessment/page.tsx - Scoring · Normalizes and scores assessment outputs.
src/lib/scoring.ts - AI enrichment
src/lib/ai.ts - Event matching
src/lib/event-matching.ts - Recommendations
src/app/recommendations/page.tsx - Event finder · Renders event discovery output.
src/components/events/EventFinder.tsx
Data & Services
- Event catalog
src/data/events.ts - Event contracts · Event and shared domain types.
src/lib/event-types.ts - Supabase · Provides authentication and relational persistence.
src/lib/supabase.ts - Database schema
supabase/schema.sql
Legacy Runtime
Parallel Vite-era implementation boundary.
- Vite legacy entry · Parallel implementation requiring isolation or consolidation.
src/main.tsx - Duplicate auth context
src/contexts/AuthContext.tsx
Connections 20
- Root layout → Route entry: wraps
- Route entry → Student dashboard: student flow
- Login routes → Login UI: uses
- Login UI → Supabase: authenticates
- Supabase → OAuth callback: returns OAuth session
- OAuth callback → Auth state: establishes session
- Auth state → Route guards: authorizes
- Route guards → Student dashboard: guards
- Student dashboard → Assessment: starts assessment
- Assessment → Scoring: submits inputs
- Scoring → AI enrichment: enriches
- Scoring → Event matching: normalized results
- AI enrichment → Event matching: optional enrichment
- Event matching → Event catalog: matches against
- Event contracts → Event matching: defines inputs
- Event matching → Recommendations: produces recommendations
- Recommendations → Event finder: renders with
- Supabase → Database schema: persisted by
- Vite legacy entry → Duplicate auth context: uses
- Vite legacy entry → Root layout: parallel to primary runtime