Architecture

NeuroLab is documented here as a layered system: clients, backend API, AI service, and supporting infrastructure.

Source Of Truth

This page summarizes the architecture model used by the docs site. It does not assert that the service source code lives in this repository.

System Overview

The platform is described as four operational layers:

Client Layer

Client Applications

User-facing web apps

The docs site sits alongside the platform-facing applications and describes the supported workflows, setup, and reference surfaces.

Core Layer

Backend API

Backend service boundary

The backend is the primary HTTP boundary for users, appointments, uploads, reports, billing, notifications, and related workflows.

Inference Layer

AI Service

Analysis and inference service

The AI service covers EEG analysis, voice processing, report generation, and model-related endpoints under a versioned API prefix.

Infrastructure Layer

Supporting Services

Data, queueing, and storage

Supporting services include the datastore, queueing, and object storage layers that the backend and AI service depend on.

Current Service Boundaries

Backend Responsibilities

  • authentication and token issuance
  • application data persistence
  • appointments, uploads, reports, billing, notifications, and chat workflows
  • route groups summarized in the backend API reference

AI Service Responsibilities

  • versioned API routing
  • EEG analysis endpoints
  • voice analysis endpoints
  • report generation and model-related workflows

Integration Patterns

| Mechanism | Current Role | Notes | | :--- | :--- | :--- | | HTTP/REST | Primary application integration | Main client and service API surface | | OpenAPI/Swagger | Backend schema discovery | The backend API page points to the generated schema | | Versioned API routes | AI service contract | The AI service API is documented under a versioned prefix | | Queue-backed jobs | Background processing | Used for asynchronous analysis and report workflows |

Runtime Shape

Client applications
    -> Backend API
    -> AI service for analysis and inference
    -> Data, queueing, and storage services

Architectural Notes

Important Distinction

Keep the architecture page aligned with the routes and pages that exist in this docs repository. Avoid adding directory-level claims unless the source code is actually present here.

What is stable

  • backend route summaries and OpenAPI entrypoints
  • AI service versioned API prefix
  • docs app as a separate Next.js application

What is integration-sensitive

  • queue-backed async jobs
  • deployment assumptions across the documented setup pages