How thanavreddy/labmind-assistant works
LabMind is a client-side React single-page application built with Vite and TypeScript. There is no backend or API service in this repository, so the architecture is primarily a presentation layer with route-based feature pages, shared UI infrastructure, and a few cross-cutting state/behavior utilities.
At the top level, the app is bootstrapped from src/main.tsx, which mounts the React tree into index.html and pulls in the global styles from src/index.css and src/App.css. The app shell is composed in src/App.tsx, where client-side routing determines which page is shown. The route set maps directly to the product workflow described in the README: Landing, AIAssistant, ConceptCheck, LabRecordEditor, StudentDashboard, ProfessorDashboard, plus NotFound for fallback and Index as the default entry path.
The application is organized around a clear feature boundary:
• src/pages/* contains route-level screens.
• src/components/* contains reusable application-level UI such as AppLayout, AppSidebar, NavLink, ProgressRing, StatusChip, and ThemeToggle.
• src/components/ui/* is a large shadcn/ui-based design system layer wrapping Radix-style primitives with Tailwind styling.
• src/contexts/* holds global state providers, currently centered on theming.
• src/hooks/* contains behavior hooks for responsiveness, animation, and feedback.
• src/lib/utils.ts provides shared utility functions used across components.
The main product flow is the three-step educational loop:
1. AIAssistant handles the “Learn” step with a conversational UI.
2. ConceptCheck handles the “Verify” step with a short comprehension quiz and paste-restriction UX.
3. LabRecordEditor handles the “Record” step with a structured lab template.
These pages are feature screens rather than independent sub-apps. They likely share the same shell and styling system, but each one owns its own local interaction state and content structure. The dashboards are separate views on top of the same underlying completion model:
• StudentDashboard visualizes experiment status using StatusChip and ProgressRing.
• ProfessorDashboard presents tabular oversight and management controls for instructors.
A notable architectural boundary is the app shell. AppLayout and AppSidebar define the navigational frame for the internal experience, while Landing appears to function as the public entry/marketing page. NavLink is the navigation abstraction used to keep route links visually consistent across the sidebar and other navigation surfaces. This suggests the app has two UX modes: a public guest-facing surface and an internal workflow surface, even though there is no separate auth system in the repository.
Theme management is the main global state concern. ThemeContext provides dark/light mode state and ThemeToggle is the user-facing control. This is a true cross-cutting concern because it affects the whole application, not just one page. The README’s “Dark Academic meets Modern SaaS” design language is implemented through this theme layer plus Tailwind-driven tokens and component styling.
The hooks directory supports behavior that is orthogonal to the core business screens:
• use-mobile provides responsive branching for layout decisions.
• useCountUp supports animated statistics.
• useScrollReveal supports scroll-triggered entrance animations.
• use-toast integrates transient notifications, backed by the toast UI primitives in src/components/ui.
The UI subsystem is strongly layered. The src/components/ui/* directory contains the low-level primitives such as buttons, dialogs, cards, tables, tabs, forms, sheets, tooltips, and so on. These are infrastructure components rather than business logic. Higher up, the app-specific components compose those primitives into domain-facing widgets like progress indicators, status chips, and layout containers. This separation is important: route pages should depend on app components, which in turn depend on UI primitives.
Data visualization appears in the dashboard layer, likely using Recharts as noted in the README and reflected by the presence of src/components/ui/chart.tsx. That makes charts a presentation concern within the dashboard pages, not a standalone subsystem.
There is no evidence of server-side rendering, database access, file storage, or external AI integration code in the repository tree. Even though the product narrative mentions AI assistance, the architecture in this repo is a frontend-only implementation; any real model calls, persistence, authentication, or professor/student data sync would have to be added through an external backend or service layer not present here. As a result, most “data flow” in this codebase is local: user interactions update component state, page components derive UI from that state, and global concerns like theme and notifications are handled through context/hooks.
In practical diagram terms, the repository should be drawn as:
• a Vite/React client application at the center,
• a route layer of feature pages on top,
• a shared shell/navigation layer around the workflow pages,
• a global theme/behavior layer spanning the app,
• and a reusable design-system layer underneath everything.
Main entry points: App.tsx App · StudentDashboard.tsx Student dashboard · AppLayout.tsx App layout · AppSidebar.tsx Sidebar
Components 23
Bootstrap
Vite entrypoint and global app wiring.
Shared shell
Reusable navigation, theme, and app-level widgets.
- Theme · Global dark/light theme state and provider.
src/contexts/ThemeContext.tsx - App layout · Primary frame for the internal experience.
src/components/AppLayout.tsx - Sidebar · In-app navigation frame for workflow screens.
src/components/AppSidebar.tsx - Nav link · Consistent route link styling and behavior.
src/components/NavLink.tsx - Theme toggle · User control for switching app theme.
src/components/ThemeToggle.tsx - Progress ring · Circular progress indicator used in dashboards.
src/components/ProgressRing.tsx - Status chip · Compact state badge used in dashboard views.
src/components/StatusChip.tsx
Feature pages
Route-level screens for the product workflow and dashboards.
- Landing · Public entry and marketing-oriented screen.
src/pages/Landing.tsx - AI assistant · Learn step with a conversational UI.
src/pages/AIAssistant.tsx - Concept check · Verify step with a short comprehension quiz.
src/pages/ConceptCheck.tsx - Lab record · Record step with a structured lab template.
src/pages/LabRecordEditor.tsx - Student dashboard · Student-facing status and progress overview.
src/pages/StudentDashboard.tsx - Professor dashboard · Instructor-facing oversight and management view.
src/pages/ProfessorDashboard.tsx - Index · Default landing route for the app.
src/pages/Index.tsx - Not found · Route fallback for unmatched paths.
src/pages/NotFound.tsx
Infrastructure
Design system, hooks, utilities, and styling foundations.
- UI kit · Reusable shadcn/radix-style primitives and app-wide UI building blocks.
- Utils · Shared utility functions used across the component tree.
src/lib/utils.ts - useMobile · Responsive branching for layout decisions.
src/hooks/use-mobile.tsx - useCountUp · Animated numeric counters for dashboard stats.
src/hooks/useCountUp.ts - useScrollReveal · Scroll-triggered entrance animation behavior.
src/hooks/useScrollReveal.ts - useToast · Transient notification state and helpers.
src/hooks/use-toast.ts
Connections 31
- Main → App: mounts · Bootstraps the React tree into the page.
- Main → Theme: wraps · Provides theme context at the app boundary.
- App → App layout: uses · Composes internal workflow screens inside the shell.
- App → Landing: routes to · Public entry screen.
- App → AI assistant: routes to · Learn step screen.
- App → Concept check: routes to · Verify step screen.
- App → Lab record: routes to · Record step screen.
- App → Student dashboard: routes to · Student dashboard route.
- App → Professor dashboard: routes to · Professor dashboard route.
- App → Index: defaults to · Default entry route.
- App → Not found: falls back to · Fallback for unknown routes.
- App layout → Sidebar: includes · Shell frame includes navigation.
- Sidebar → Nav link: renders · Uses shared link abstraction for routes.
- Theme toggle → Theme: reads/writes · Controls global theme state.
- Student dashboard → Progress ring: uses · Shows completion progress.
- Student dashboard → Status chip: uses · Displays experiment status.
- Student dashboard → useCountUp: animates · Supports animated metrics.
- AI assistant → useScrollReveal: animates · Supports reveal interactions.
- Concept check → useToast: notifies · Surfaces validation or feedback messages.
- Lab record → useMobile: adapts · Adjusts layout behavior on smaller screens.
- AI assistant → UI kit: builds on · Composes the shared component primitives.
- Concept check → UI kit: builds on · Composes the shared component primitives.
- Lab record → UI kit: builds on · Composes the shared component primitives.
- Student dashboard → UI kit: builds on · Composes the shared component primitives.
- Professor dashboard → UI kit: builds on · Composes the shared component primitives.
- UI kit → Utils: depends on · Shared primitives reuse common helpers.
- Theme toggle → UI kit: builds on · Rendered with shared UI primitives.
- Progress ring → UI kit: builds on · Rendered with shared UI primitives.
- Status chip → UI kit: builds on · Rendered with shared UI primitives.
- App layout → UI kit: builds on · Shell composition uses the shared design system.
- Sidebar → useMobile: adapts · Responsive navigation behavior.