# kavidharshini922/gen-ai-mental-health-journal architecture

> Architecture diagram of the GitHub repository kavidharshini922/gen-ai-mental-health-journal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kavidharshini922/gen-ai-mental-health-journal
- Repository: https://github.com/kavidharshini922/gen-ai-mental-health-journal

## Overview

This is a Flutter app named “demo”; the README does not describe its domain or workflow. The source tree suggests a mental-wellness app with account access, mood/journal features, AI responses, and feedback. Those product paths are represented, but their connections are unverified because their Dart source was not excerpted. The graph also includes the sampled native launch shells and required central platform files; backend and service behavior is otherwise uncertain.

Main entry points: [`lib/ai_solution_screen.dart`](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/ai_solution_screen.dart) (AI solution), [`lib/mental_health_input_screen.dart`](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/mental_health_input_screen.dart) (Mental health input), [`lib/main.dart`](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/main.dart) (Flutter entry), [`lib/welcome_screen.dart`](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/welcome_screen.dart) (Welcome)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_main["Flutter entry<br/>[main.dart]"]
  node_welcome["Welcome"]
  node_authui["Login and register<br/>[login_screen.dart]"]
  node_choice["Choice screen<br/>[choice_screen.dart]"]
  node_input["Mental health input"]
  node_solution["AI solution"]
  node_feelbetter["Feel better"]
  node_feedback["Feedback"]
end

subgraph group_wellness["Wellness tracking"]
  node_mood["Mood tracker"]
  node_journal["Journal history"]
  node_voice["Voice notes"]
end

subgraph group_services["App services"]
  node_auth["Authentication service<br/>[auth_service.dart]"]
  node_firestore["Firestore service"]
  node_openai["OpenAI service"]
  node_cohere["Cohere service"]
  node_worker["AI worker<br/>[index.js]"]
  node_functions["Firebase functions<br/>[index.js]"]
end

subgraph group_platform["Platform runtime"]
  node_linuxmain["Linux launcher<br/>[main.cc]"]
  node_linuxapp["Linux application<br/>[my_application.h]"]
  node_linuxplugins["Linux plugin registry"]
  node_winmain["Windows launcher<br/>[main.cpp]"]
  node_flutterwindow["Flutter window<br/>[flutter_window.h]"]
  node_winwindow["Windows window<br/>[win32_window.h]"]
  node_winplugins["Windows plugin registry"]
  node_macplugins["macOS plugin registration"]
end

node_user(("App user"))

node_user -.->|"opens app"| node_main
node_main -.->|"launches"| node_welcome
node_welcome -.->|"offers access"| node_authui
node_authui -.->|"authenticates"| node_auth
node_choice -.->|"selects input"| node_input
node_input -.->|"requests guidance"| node_solution
node_solution -.->|"requests AI"| node_openai
node_solution -.->|"requests AI"| node_cohere
node_input -.->|"sends request"| node_worker
node_solution -.->|"continues to"| node_feelbetter
node_feelbetter -.->|"offers feedback"| node_feedback
node_user -.->|"tracks mood"| node_mood
node_user -.->|"reviews entries"| node_journal
node_user -.->|"records note"| node_voice
node_journal -.->|"loads history"| node_firestore
node_mood -.->|"stores mood"| node_firestore
node_linuxmain -->|"creates app"| node_linuxapp
node_winmain -->|"creates window"| node_flutterwindow
node_flutterwindow -->|"extends window"| node_winwindow

click node_main "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/main.dart"
click node_welcome "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/welcome_screen.dart"
click node_authui "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/login_screen.dart"
click node_choice "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/choice_screen.dart"
click node_input "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/mental_health_input_screen.dart"
click node_solution "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/ai_solution_screen.dart"
click node_feelbetter "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/feel_better_screen.dart"
click node_feedback "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/feedback_screen.dart"
click node_mood "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/mood_tracker_screen.dart"
click node_journal "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/history_screen.dart"
click node_voice "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/voice_note_screen.dart"
click node_auth "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/auth_service.dart"
click node_firestore "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/firestore_service.dart"
click node_openai "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/openai_service.dart"
click node_cohere "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/cohere_service.dart"
click node_worker "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/mental-health-ai-worker2/src/index.js"
click node_functions "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/functions/index.js"
click node_linuxmain "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/runner/main.cc"
click node_linuxapp "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/runner/my_application.h"
click node_linuxplugins "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/flutter/generated_plugin_registrant.h"
click node_winmain "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/main.cpp"
click node_flutterwindow "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/flutter_window.h"
click node_winwindow "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/win32_window.h"
click node_winplugins "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/flutter/generated_plugin_registrant.h"
click node_macplugins "https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_welcome,node_authui,node_choice,node_input,node_solution,node_feelbetter,node_feedback,node_user toneBlue
class node_mood,node_journal,node_voice toneAmber
class node_auth,node_firestore,node_openai,node_cohere,node_worker,node_functions toneMint
class node_linuxmain,node_linuxapp,node_linuxplugins,node_winmain,node_flutterwindow,node_winwindow,node_winplugins,node_macplugins toneRose
```

## Components

### App experience

- [Flutter entry](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/main.dart): `lib/main.dart`
- [Welcome](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/welcome_screen.dart): `lib/welcome_screen.dart`
- [Login and register](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/login_screen.dart): `lib/login_screen.dart`
- [Choice screen](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/choice_screen.dart): `lib/choice_screen.dart`
- [Mental health input](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/mental_health_input_screen.dart): `lib/mental_health_input_screen.dart`
- [AI solution](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/ai_solution_screen.dart): `lib/ai_solution_screen.dart`
- [Feel better](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/feel_better_screen.dart): `lib/feel_better_screen.dart`
- [Feedback](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/feedback_screen.dart): `lib/feedback_screen.dart`

### Wellness tracking

- [Mood tracker](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/mood_tracker_screen.dart): `lib/mood_tracker_screen.dart`
- [Journal history](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/history_screen.dart): `lib/history_screen.dart`
- [Voice notes](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/voice_note_screen.dart): `lib/voice_note_screen.dart`

### App services

- [Authentication service](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/auth_service.dart): `lib/auth_service.dart`
- [Firestore service](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/firestore_service.dart): `lib/firestore_service.dart`
- [OpenAI service](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/openai_service.dart): `lib/openai_service.dart`
- [Cohere service](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/lib/cohere_service.dart): `lib/cohere_service.dart`
- [AI worker](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/mental-health-ai-worker2/src/index.js): `mental-health-ai-worker2/src/index.js`
- [Firebase functions](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/functions/index.js): `functions/index.js`

### Platform runtime

- [Linux launcher](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux application](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/runner/my_application.h): `linux/runner/my_application.h`
- [Linux plugin registry](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/linux/flutter/generated_plugin_registrant.h): `linux/flutter/generated_plugin_registrant.h`
- [Windows launcher](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Windows window](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/runner/win32_window.h): `windows/runner/win32_window.h`
- [Windows plugin registry](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/windows/flutter/generated_plugin_registrant.h): `windows/flutter/generated_plugin_registrant.h`
- [macOS plugin registration](https://github.com/kavidharshini922/gen-ai-mental-health-journal/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`

### Other components

- **App user**

## Connections

- App user → Flutter entry: opens app
- Flutter entry → Welcome: launches
- Welcome → Login and register: offers access
- Login and register → Authentication service: authenticates
- Choice screen → Mental health input: selects input
- Mental health input → AI solution: requests guidance
- AI solution → OpenAI service: requests AI
- AI solution → Cohere service: requests AI
- Mental health input → AI worker: sends request
- AI solution → Feel better: continues to
- Feel better → Feedback: offers feedback
- App user → Mood tracker: tracks mood
- App user → Journal history: reviews entries
- App user → Voice notes: records note
- Journal history → Firestore service: loads history
- Mood tracker → Firestore service: stores mood
- Linux launcher → Linux application: creates app (evidence: `linux/runner/main.cc`)
- Windows launcher → Flutter window: creates window (evidence: `windows/runner/main.cpp`)
- Flutter window → Windows window: extends window (evidence: `windows/runner/flutter_window.h`)
