How mshazilkhan7/autimate-frontend works
Purpose and Runtime
Autimate is a Vite-served React/TypeScript single-page application for child speech therapy, social-skills practice, onboarding assessment, progress dashboards, and reports. The browser bootstrap is src/main.tsx; application composition and likely route selection begin in src/App.tsx. Styling combines global CSS and Tailwind/shadcn UI primitives (src/index.css, src/components/ui/).
Application Shell and Navigation
Pages represent the major product surfaces: authentication, child profile, onboarding, dashboard, therapy, social practice, speech-space gamification, reports, and settings. Shared authenticated and unauthenticated shells establish layout boundaries:
• src/pages/Auth.tsx
• src/components/Layout/AuthLayout.tsx
• src/components/Layout/Layout.tsx
• src/components/Layout/AppSidebar.tsx
Control flow is page-driven: the shell/sidebar selects a feature page, which assembles domain components and calls its feature hooks/APIs.
Identity and Session Boundary
Authentication and current-user/session state are isolated behind dedicated API modules and hooks rather than embedded in views:
• src/api/auth.ts
• src/api/session.ts
• src/hooks/useAuth.ts
• src/hooks/useSession.ts
Type contracts for these flows are centralized in src/types/auth.ts and src/types/session.ts. The exact backend/provider is not identifiable from the supplied tree; API-facing behavior is abstracted through src/utils/api.ts.
Onboarding and Child Assessment
Onboarding is a multi-step assessment and profile-capture flow. Question content is static data, while step components render the progression, calculate/display results, and persist through the onboarding boundary:
• src/pages/Onboarding.tsx
• src/components/Onboarding/steps/questionSection.tsx
• src/components/Onboarding/steps/result.tsx
• src/hooks/useOnboarding.ts
• src/api/onboarding.ts
• src/data/onboardingQuestions.json
src/pages/ChildInfo.tsx is the adjacent child-information surface. This separates assessment UI/state from backend persistence.
Speech Therapy Sessions
The therapy feature presents guided word/phoneme exercises, child recording controls, playback, and feedback. Session orchestration is componentized around an exercise shell and API/session state:
• src/pages/SpeechTherapy.tsx
• src/components/Therapy/exercises/sessionShell.tsx
• src/components/Therapy/ChildRecordingPanel.tsx
• src/components/Therapy/SpeechFeedback.tsx
• src/api/therapy.ts
Therapy vocabulary/content is local (src/data/speechTherapyWords.ts). Speech evaluation integrates through src/hooks/useSpeechAce.ts, with external-service response shapes modeled in src/types/speechace.ts; this is a material browser-to-speech-analysis boundary.
Practice and Gamified Learning
Social-skills practice is task-driven from local content, with pages separating catalog and individual practice:
• src/pages/SocialSkills.tsx
• src/pages/SocialSkillsPractice.tsx
• src/components/Social/TaskCard.tsx
• src/data/socialTasks.json
• src/api/social.ts
Speech Space is a distinct gamified progression mode with levels, rewards, feedback, and 3D/character presentation:
• src/pages/SpeechSpace.tsx
• src/components/SpeechSpace/LevelSelector.tsx
• src/components/SpeechSpace/AICharacter3D.tsx
• src/data/speechSpaceLevels.json
• src/api/space.ts
Progress, Feedback, and Reporting
Dashboard and report views consume persisted user/session outcomes to expose progress and summaries:
• src/pages/Dashboard.tsx
• src/components/Dashboard/ProgressCircle.tsx
• src/pages/Reports.tsx
• src/hooks/useReport.tsx
• src/api/report.ts
AI feedback is separately encapsulated in src/hooks/useAIFeedback.tsx, allowing therapy/practice views to consume generated feedback without owning its service interaction.
Deployment
The frontend is built by Vite and deployable as a static SPA; Vercel configuration exists in vercel.json. The README also identifies Lovable as the managed editing/publishing environment. Dependencies are managed via npm (package.json, package-lock.json), with a Bun lockfile also present.
Main entry points: AppSidebar.tsx Feature navigation · api.ts API transport · SocialSkillsPractice.tsx Social skills practice · App.tsx Application composition
Components 22
SPA Runtime
- Vite static build · Builds and serves the static SPA.
vercel.json - Browser bootstrap
src/main.tsx - Application composition · Composes the SPA and selects product surfaces.
src/App.tsx - Auth and app shells · Separates unauthenticated and authenticated layouts.
src/components/Layout/Layout.tsx - Feature navigation
src/components/Layout/AppSidebar.tsx - API transport · Shared abstraction for backend-facing behavior.
src/utils/api.ts
Identity
- Auth and session · Owns authentication and current-session state.
src/hooks/useAuth.ts - Authentication
src/pages/Auth.tsx
Assessment & Learning
- Onboarding assessment · Multi-step assessment and profile capture.
src/pages/Onboarding.tsx - Assessment steps · Renders questions and assessment results.
src/components/Onboarding/steps/questionSection.tsx - Assessment questions
src/data/onboardingQuestions.json - Child information
src/pages/ChildInfo.tsx - Speech therapy · Guided phoneme and word exercise sessions.
src/pages/SpeechTherapy.tsx - Exercise session shell · Orchestrates exercises, recording, playback, and feedback.
src/components/Therapy/exercises/sessionShell.tsx - Speech analysis · Browser boundary for speech evaluation.
src/hooks/useSpeechAce.ts - Social skills practice · Task-driven social-skills activities.
src/pages/SocialSkillsPractice.tsx - Social tasks
src/data/socialTasks.json - Speech Space · Levels, rewards, feedback, and character presentation.
src/pages/SpeechSpace.tsx - Speech Space levels
src/data/speechSpaceLevels.json
Progress & Reporting
- Dashboard
src/pages/Dashboard.tsx - Reports · Builds persisted progress summaries.
src/hooks/useReport.tsx - AI feedback · Encapsulates generated-feedback service interaction.
src/hooks/useAIFeedback.tsx
Connections 29
- Vite static build → Browser bootstrap: serves build
- Browser bootstrap → Application composition: mounts
- Application composition → Auth and app shells: composes
- Application composition → Authentication: shows when signed out
- Auth and app shells → Feature navigation: contains
- Feature navigation → Onboarding assessment: navigates
- Feature navigation → Speech therapy: navigates
- Feature navigation → Social skills practice: navigates
- Feature navigation → Speech Space: navigates
- Feature navigation → Dashboard: navigates
- Feature navigation → Reports: navigates
- Authentication → Auth and session: uses
- Auth and app shells → Auth and session: guards session
- Auth and session → API transport: calls
- Onboarding assessment → Assessment steps: renders
- Assessment steps → Assessment questions: loads
- Onboarding assessment → API transport: persists assessment
- Child information → API transport: persists profile
- Speech therapy → Exercise session shell: renders
- Exercise session shell → Speech analysis: evaluates recording
- Speech therapy → API transport: stores outcomes
- Exercise session shell → AI feedback: requests feedback
- Social skills practice → Social tasks: loads tasks
- Social skills practice → API transport: stores practice
- Social skills practice → AI feedback: requests feedback
- Speech Space → Speech Space levels: loads levels
- Speech Space → API transport: stores progression
- Dashboard → API transport: loads progress
- Reports → API transport: loads summaries