Bachelor Project · Full-stack MVP

TAS

A full-stack prototype with separate patient and therapist experiences, structured journal analysis, and local AI inference.

Year
2026
Responsibilities
Product design · Full-stack engineering · Data architecture · Local AI integration
  • Next.js
  • React
  • TypeScript
  • FastAPI
  • PostgreSQL
  • Ollama
  • Gemma 3
TAS therapist dashboard showing patient activity and mood indicators

Technology

Technology stack

The prototype uses one shared Next.js frontend, a FastAPI core API, PostgreSQL persistence, and a separate service for local analysis.

Frontend
Next.js, React, TypeScript, Tailwind CSS, React Hook Form, Recharts
UI
shadcn/ui, Radix UI, Base UI, Lucide
Backend
FastAPI, Pydantic
Data
PostgreSQL, SQLAlchemy (async), asyncpg, Alembic
Authentication and security
JWT, python-jose, argon2-cffi, cryptography
Local analysis
FastAPI, HTTPX, uvicorn, Ollama, Gemma 3
Infrastructure
Docker

Project scope

Scope of work

I designed the interaction model and the patient and therapist interfaces, then implemented the authentication flow, API integration, backend endpoints, database models, persistence, structured analysis output, local model integration, and application architecture.

Product overview

Between-session journal data for therapist review

Patients can record mood, energy, experiences, and an optional written reflection between therapy sessions. Therapists receive a structured overview of recent activity, mood development, recurring topics, and risk-related indicators.

TAS is a decision-support prototype. It supports preparation and orientation, but it does not replace therapeutic judgment.

Patient input
Structured mood and energy values with an optional reflection.
Therapist review
Activity, longitudinal values, topics, and indicators in one view.
Clinical boundary
Interpretation and clinical decisions remain with the therapist.

Product interfaces

Patient and therapist areas

I implemented both role-separated areas in one shared Next.js frontend. Navigation, workflows, and available data change with the authenticated role.

For patients

Patients record mood and energy, with space for an optional written reflection. Their journal brings past entries and mood history together, with the same workflow available on mobile.

Complete TAS patient dashboard with journal activity and mood history

For therapists

Therapists start with an overview of their patients and recent journal activity. Opening a patient record brings mood changes, recurring topics, and analysis indicators into one view for review before a session.

Complete TAS therapist patient-detail view with activity and mood information

Journaling and local analysis

Structured local journal analysis

Journal entries contain structured mood and energy values plus optional reflection text. After the core API stores an entry, a separate stateless service sends the relevant data to Gemma 3 through a local Ollama runtime. The service returns typed JSON, which is validated before the core API stores mood values, topics, and risk-related indicators.

  1. Journal entry
  2. Core API
  3. Analysis service
  4. Local Gemma 3
  5. Validated metadata
Complete TAS journal analysis view with mood, topic, and risk-related metadata

Consent and privacy

Patient-controlled reflection visibility

Narrative journal content is not automatically visible to therapists. Patients control whether their reflection text is shared. Without consent, therapist views are limited to permitted structured indicators and non-sensitive activity data.

Supporting excerpts appear only when reflection visibility has been granted. Derived indicators do not expose private reflection text.

  1. Journal entry
  2. Structured indicators (and supporting excerpts)
  3. Therapist overview

Therapist dashboard

Activity, mood, and analysis overview

The dashboard combines recent activity, mood development, and analysis indicators so therapists can identify patient records that may need closer review. Patient detail pages add longitudinal context. The dashboard supports session preparation and orientation rather than continuous real-time monitoring.

Complete TAS therapist dashboard with patient activity, mood, and risk-related indicators

Engineering

Application architecture

One Next.js frontend contains separate patient and therapist areas. The core API is the authoritative gateway for authentication, roles, access rules, persistence, and calls to the analysis service.

Patient area
Therapist area
Single Next.js frontend
FastAPI core API

Persistence path

PostgreSQL

Analysis path

Separate analysis service
Local Ollama runtime
Gemma 3
Core API
Handles authentication, role checks, consent rules, and data shaping.
PostgreSQL
Stores canonical journal entries and validated analysis results.
Analysis service
Processes inference requests without making access-control decisions or retaining request data.
Docker
Runs the local backend, database, and analysis environment.

Frontend

Frontend implementation

I implemented the role-separated navigation and workflows in one responsive frontend and connected the interface to authentication, form state, validation, and API data.

Role-separated workflows
Patient and therapist routes use different navigation and available actions.
Responsive layouts
Journal, dashboard, and patient-detail views adapt across desktop and mobile.
Timelines and charts
Recharts and summary values present longitudinal journal and mood data.
Forms and validation
React Hook Form manages journal input, validation, and submission state.
Authentication and API
Server-managed authentication and typed data contracts connect the frontend to the core API.
Interface states
Loading, empty, feedback, and disabled states cover routine interface conditions.
TAS mobile journaling experience
Complete TAS patient dashboard demonstrating the responsive frontend