How benjiavdullahu/intellex works
1. Overall shape
- This is a Next.js App Router application with a mostly client-side React UI, styled with Tailwind CSS and built from shadcn/ui-style primitives.
- The repo is organized around a product flow for an educational matching platform: landing, onboarding/form, dashboard, session, leaderboard, and a small API layer.
2. Primary user flows
- The app appears to guide a user through:
- entering or creating a profile,
- answering skill-interest questions,
- landing in a dashboard where matching and progress are surfaced,
- joining a learning session,
- and viewing a leaderboard/rewards view.
- The readme confirms the product goal: peer-to-peer skill sharing with weekly rewards.
3. Route-level architecture
- app/page.tsx is the landing/home entry point.
- app/form/page.tsx likely handles the onboarding / skill input form.
- app/dashboard/page.tsx and app/dashboard/create/page.tsx support the core authenticated workspace and a create/match action.
- app/session/page.tsx is the live learning session experience.
- app/leaderboard/page.tsx presents rankings and reward status.
- app/api/verbwire/route.ts is the only explicit server route and acts as an integration point for blockchain/NFT operations.
4. Client UI composition
- components/component/* contains feature-oriented UI pieces rather than generic atoms:
- navbar, profile-icon, mode-toggle, and dots are shared shell elements.
- summary/summary.tsx suggests a dashboard card or status summary.
- survey/* contains the onboarding/questionnaire experience and completion/thank-you states.
- components/ui/* provides the lower-level reusable primitives such as buttons, cards, tables, forms, inputs, sliders, radios, dropdowns, and avatar.
5. State and auth boundary
- lib/hooks/use-auth.ts is the main auth hook, indicating client components likely read a shared authentication state.
- lib/sign-in-or-create.ts suggests a helper that either logs in an existing user or creates a new one, which is a key boundary between UI and identity management.
- lib/get-user-data.ts likely bridges auth identity to profile/survey data needed across dashboard and session screens.
6. Data and backend services
- lib/firebase.ts is the central Firebase initialization/configuration layer.
- Firebase is the main application data backend implied by the readme and file structure; it likely stores user profiles, survey responses, match data, and leaderboard-related records.
- Because there is no broader server directory, most business logic seems to live in client code and Firebase-backed helpers, with Next.js server routes used only for specific integrations.
7. Blockchain / reward integration
- The readme highlights Verbwire and NFT rewards for top weekly learners.
- app/api/verbwire/route.ts is the architecture boundary for minting or reward-related blockchain actions, insulating the rest of the app from direct API handling.
- This suggests the leaderboard flow is not just cosmetic; it likely culminates in an external minting or asset issuance step.
8. Session experience
- app/session/page.tsx plus the survey-related components imply a dedicated interactive session area.
- The readme says the platform supports 1:1 video calls, whiteboard collaboration, and screen sharing, though it also notes the build is currently failing because of the 100ms video feature.
- Architecturally, this means the session surface is a distinct integration-heavy boundary compared with the rest of the app.
9. Matching / survey workflow
- lib/questions.ts and the survey/* components indicate a questionnaire-driven profile capture step.
- The likely data flow is: user answers questions → responses are persisted or derived into skill preferences → dashboard/matching logic uses that profile to suggest peers or sessions.
- app/form/page.tsx is probably the entry point for this matching input pipeline.
10. Theming and app shell
- app/layout.tsx, components/theme-provider.tsx, and components/component/mode-toggle.tsx define the global shell and theme behavior.
- app/globals.css, tailwind.config.js, and postcss.config.js support the visual system.
- This indicates the app has a shared top-level layout with persistent theming across all routes.
11. External dependencies that matter to the architecture
- Firebase: primary app data/auth backend.
- Verbwire: external API for NFT/reward functionality.
- 100ms: session/video layer mentioned in the readme, currently a build-risk area.
- The deployment target is Vercel, which fits the Next.js App Router and route-handler structure.
12. How to draw the system
- At the center is a Next.js client app with route-based screens.
- Surrounding it are shared UI components and a small set of lib helpers.
- Firebase forms the persistent data layer for users, profiles, and matching state.
- The /api/verbwire route is a narrow server-side integration for reward minting.
- The session page is the most externally integrated feature, with video/collaboration tooling separated from the rest of the product flow.
Main entry points: firebase.ts Firebase · page.tsx Onboarding · navbar.tsx Navbar · input-form.tsx Survey Form
Components 21
App routes
Next.js route-level screens and server endpoints.
- Home · Landing entry point for the product.
app/page.tsx - Onboarding · Profile and skill-interest form flow.
app/form/page.tsx - Dashboard · Core workspace for matched learning activity.
app/dashboard/page.tsx - Create Match · Dashboard sub-route for creating or starting a match.
app/dashboard/create/page.tsx - Session · Interactive learning session and collaboration surface.
app/session/page.tsx - Leaderboard · Weekly rankings and rewards view.
app/leaderboard/page.tsx - Verbwire API · Backend integration boundary for reward or NFT actions.
app/api/verbwire/route.ts
Shared UI
Reusable shell, survey, and primitive components.
- Navbar · Top-level navigation shell shared across screens.
components/component/navbar.tsx - Profile Icon · User identity and profile access affordance.
components/component/profile-icon.tsx - Theme Toggle · Light/dark mode control for the app shell.
components/component/mode-toggle.tsx - Summary · Dashboard status or progress summary card.
components/component/summary/summary.tsx - Survey Form · Interactive onboarding input form.
components/component/survey/input-form.tsx - Questions · Questionnaire content for skill and interest capture.
components/component/survey/survey-questions.tsx - Survey Done · Completion state for the onboarding flow.
components/component/survey/survey-complete.tsx - Thanks Screen · Post-survey acknowledgement screen.
components/component/survey/thanks-survey.tsx
Lib layer
Authentication, data access, and questionnaire helpers.
- Firebase · Central Firebase configuration and initialization.
lib/firebase.ts - Auth Hook · Shared client auth state accessor.
lib/hooks/use-auth.ts - Sign In/Create · Sign-in and account creation boundary.
lib/sign-in-or-create.ts - User Data · Fetches user profile data for downstream screens.
lib/get-user-data.ts - Questions · Question set used by the onboarding survey.
lib/questions.ts
App infra
Global layout, styling, and theme plumbing.
- Theme Provider · Global theme context for the UI.
components/theme-provider.tsx
Connections 20
- Home → Navbar: uses shell · Landing page is wrapped by the shared navigation shell.
- Home → Theme Provider: uses theme · Landing page participates in global theming.
- Onboarding → Survey Form: renders · Onboarding route hosts the input form.
- Onboarding → Questions: asks · Form is driven by the questionnaire content.
- Onboarding → Sign In/Create: identity flow · Form flow likely creates or authenticates the user.
- Dashboard → Summary: shows · Dashboard surfaces progress and match summary.
- Dashboard → User Data: loads profile · Dashboard needs user-specific data to render.
- Create Match → Dashboard: extends · Create route is a dashboard sub-flow.
- Session → User Data: loads profile · Session view depends on the current user profile.
- Leaderboard → Firebase: reads data · Leaderboard likely consumes persisted rankings/reward data.
- Verbwire API → Firebase: integrates data · Server route likely reads or updates reward state around minting.
- Verbwire API → Leaderboard: rewards flow · Leaderboard culminates in an external reward action.
- Navbar → Profile Icon: includes · Shared navigation includes identity controls.
- Navbar → Theme Toggle: includes · Shared navigation includes theme switching.
- Survey Form → Questions: uses · Input form is driven by question definitions.
- Survey Form → Firebase: persists · Survey responses are stored in Firebase.
- Survey Done → Thanks Screen: flows to · Completion state transitions into the thank-you screen.
- Theme Provider → Theme Toggle: supports · Theme provider enables UI mode switching.
- Auth Hook → Sign In/Create: coordinates · Auth state underpins sign-in and account creation behavior.
- User Data → Firebase: reads · User data helper bridges UI state to Firebase records.