How aossie-org/neurotrack works
Project Type & Purpose
• Neurotrack is a full-stack, multi-platform Flutter solution comprising two client apps (“patient” and “therapist”) and a Supabase back end.
• The patient app automates screening assessments, connects clients to therapists, tracks daily activities, and displays progress.
• The therapist app manages consultations, therapy plans, session outcomes, and assigns daily activities.
• Supabase provides authentication (including Google OAuth), a Postgres database, edge functions for AI-driven assessment evaluation, and helper scripts for schema management and seeding.
File Structure Highlights
• Top-level folders:
• patient/ – Flutter project for end-users
• therapist/ – Flutter project for professionals
• supabase/ – Database schema, cloud functions, seed scripts
• scripts/ – Automation helpers (e.g., assigning GitHub issues)
• Each Flutter project follows a layered pattern under lib/:
• core/ (entities, repositories, utils, result types, theming)
• model/ (data models + mappers)
• repository/ (Supabase client wrappers)
• provider/ (state management)
• presentation/ (UI screens, widgets)
• Supabase/ contains:
• schemas/schema.sql – table definitions
• functions/evaluate-assessments – Deno-based function for AI scoring
• scripts/seed_assessments.js – Node script to populate assessment templates
a. Main Components
1. Patient Flutter App (mobile/web/desktop)
2. Therapist Flutter App (mobile/web/desktop)
3. Supabase Auth Service (Postgres + Auth)
4. Supabase Database (tables: users, assessments, consultations, therapy_plans, activities, etc.)
5. Supabase Edge Function: Evaluate-Assessments (Deno)
6. Google OAuth (external identity provider)
7. Seed & Maintenance Scripts (optional)
b. Relationships & Data Flow
• Both Flutter apps use the Supabase Dart SDK to:
• Authenticate users via Supabase Auth ←→ Google OAuth
• Read/write data to Postgres tables
• Invoke the Evaluate-Assessments edge function for AI scoring
• Evaluate-Assessments function:
• Triggered by patient app after assessment submission
• Reads raw responses, runs AI logic, writes result back to a result table
• Therapist app queries assessment results, creates consultations, therapy plans, daily activities
• Daily activities updates (completion, notes) flow back to DB and surface on both apps
c. Architectural Patterns & Principles
• Layered (core/model/repository/provider/presentation) within each client
• Client-Driven state management using Provider
• Backend as a Service (BaaS) using Supabase for Auth, DB, and serverless functions
• Separation of concerns: UI, business logic, data access
d. Key Technologies & Libraries
• Flutter & Dart (UI + business logic)
• Provider (state management)
• Supabase Dart client (auth & data access)
• Deno / TypeScript (edge function)
• Postgres (database)
• Google OAuth via Supabase