Skip to content

Repository files navigation

Kausap AI πŸ’š

Your Mental Wellness Companion.
Kausap AI is a full-stack mental health platform connecting clients with licensed professionals through AI-powered chatbot support, mood tracking, session booking, and secure messaging β€” built with Flutter and FastAPI.

Flutter FastAPI Neon PostgreSQL License


πŸ“± Project Structure

This is a monorepo containing both the Flutter frontend and FastAPI backend.

kausap-ai/
β”œβ”€β”€ mobile/          # Flutter app (iOS Β· Android Β· Web)
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ screens/       # All feature screens
β”‚   β”‚   β”œβ”€β”€ widgets/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ providers/     # State management (Provider)
β”‚   β”‚   β”œβ”€β”€ services/      # API service layer
β”‚   β”‚   β”œβ”€β”€ utils/         # Helpers (routes, haptics)
β”‚   β”‚   β”œβ”€β”€ theme/         # Design system & app theme
β”‚   β”‚   └── config/        # API config & constants
β”‚   └── pubspec.yaml
└── backend/         # FastAPI REST API (Python 3.12+)
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ routers/       # API route handlers
    β”‚   β”œβ”€β”€ models/        # SQLModel database models
    β”‚   └── main.py
    └── requirements.txt

✨ Features

πŸ‘€ Authentication & Onboarding

  • Role-based access β€” Separate, tailored experiences for Clients (patients) and Professionals (counselors/psychologists)
  • JWT Authentication β€” Secure token-based login with flutter_secure_storage
  • Multi-step signup β€” Guided 3-step registration flows for both client and professional roles
  • Professional verification β€” License upload & admin approval flow with a "Pending" holding screen
  • Animated splash & onboarding β€” Beautiful branded launch screens

πŸ€– AI Chatbot (Kausap AI)

  • Real-time conversation β€” Chat interface connected to the AI session API
  • Typing indicators β€” Animated response indicators for a natural feel
  • Empty states β€” Friendly prompts when no conversation exists
  • Risk-flagging β€” Backend capability to detect at-risk messages

🏠 Client Home Screen

  • 7-day mood streak β€” Gamified daily check-in tracking
  • Quick action cards β€” One-tap access to Check-in, Chatbot, Find a Professional, and Direct Message
  • Upcoming sessions widget β€” Live data from the database with skeleton loading
  • Daily motivational quotes β€” Dynamic quote cards
  • Suggested activities β€” Curated wellness activity recommendations
  • Mood trend chart β€” Weekly mood visualization using fl_chart
  • Pull-to-Refresh β€” Branded Kausap AI refresh indicator

πŸ“… Session Booking (Availability & Booking UI)

  • Horizontal scrolling date picker β€” Calendar-style date selection
  • Time slot grid β€” Visual, selectable session time slots (e.g., 9:00 AM, 10:30 AM)
  • Booking conflict detection β€” Backend prevents double-booking
  • Upcoming sessions tracker β€” Home screen widget showing next scheduled session
  • Booking Confirmed screen β€” Animated success screen after booking
  • Cancel session β€” One-tap cancel with a confirmation dialog

πŸ” Discover Professionals

  • Professional cards β€” Browse verified therapists and counselors
  • Search & specialty filters β€” Filter by specialization (Anxiety, Depression, ADHD, Trauma, etc.)
  • Professional profile screen β€” Full bio, stats, location, and specialization details
  • Hero animations β€” Avatars fly smoothly from the list into the detail screen
  • Skeleton loading β€” Shimmer effect card placeholders during data fetch
  • Empty states β€” Clear UI when no results match the filter

πŸ’¬ Messaging

  • Direct messaging β€” Real-time 1-on-1 chat with professionals
  • Chat history β€” Full message thread with timestamps
  • Empty state β€” Friendly prompt when no messages exist yet

🧘 Daily Check-in & Mood Tracking

  • 3-step mood logging β€” Guided emoji + slider-based mood entry UI
  • Mood history β€” Past mood entries stored and tracked over time
  • Activity library β€” Wellness exercises (breathing, journaling, etc.)
  • Activity session screen β€” In-session guided activity experience

πŸ”” Notifications

  • Notification feed β€” All app alerts in a scrollable list
  • Unread badge β€” Real-time badge counter on the notification icon
  • Mark-all-as-read β€” One-tap clear action
  • Empty state β€” "You're all caught up!" screen

πŸ‘¨β€βš•οΈ Professional Dashboard

  • Role-protected routing β€” Verified professionals are automatically directed here
  • Responsive layout β€” BottomNavigationBar on mobile, Sidebar on tablet/desktop
  • Triage & Alerts card β€” Scoped strictly to the professional's own clients
  • Client management β€” Data table with search and filter
  • Appointment calendar β€” View and manage scheduled sessions
  • AI Insights panel β€” Flagged queue and AI-generated client reports
  • Outcome tracking reports β€” fl_chart grouped bar chart for PHQ-9 & GAD-7
  • Crisis Intervention Log β€” Modal-based log for compliance
  • RA 11036 Compliance card β€” Philippine mental health law compliance tracking

βš™οΈ Profile & Settings

  • Edit profile β€” Update personal info and display picture
  • Dark Mode β€” Full dark color palette with ThemeMode toggle via Provider
  • Notification settings β€” Granular notification preference toggles
  • Privacy screen β€” Data privacy controls and policy links

πŸ” Security Features

  • Privacy Screen β€” Blurs app content in the iOS/Android recent apps switcher
  • Session Timeout β€” Auto-lock after 15 minutes of background inactivity
  • Change Password β€” With real-time password strength meter (progress bar)
  • Active Devices / Login History β€” Shows all active sessions across devices dynamically
  • Log out all other devices β€” Secure confirmation dialog
  • Two-Factor Authentication (2FA) β€” 4-step setup flow with mock QR code and 6-digit PIN entry
  • Data Export UI β€” Request a download of chat history and mood data (privacy compliance)

🎨 UI/UX & Polish

  • Custom page transitions β€” Smooth 320ms slide and fade PageRoute animations (no abrupt screen cuts)
  • Shimmer skeleton loaders β€” Replace spinners with content-shaped loading placeholders on Home and Discover
  • Generic Empty State widget β€” Reusable component with icon, title, description, and CTA button across all screens
  • Haptic feedback β€” Subtle vibrations on button taps, toggle switches, success, and error events
  • Rate App dialog β€” 5-star rating modal that appears after successful key actions
  • Help & FAQ screen β€” Expandable accordion tiles with support contact button
  • Branded pull-to-refresh β€” Custom Kausap AI indicator on Home and Discover screens
  • Admin moderation panel β€” User management and content moderation tools

πŸ›  Tech Stack

Frontend (Mobile & Web)

Technology Purpose
Flutter (Dart) Cross-platform UI framework
provider State management
http REST API networking
flutter_secure_storage Encrypted token storage
google_fonts Poppins / Urbanist typography
fl_chart Mood trend & outcome charts
shimmer Skeleton loading effects
image_picker Profile photo upload
vibration Haptic feedback patterns
intl Date/time formatting

Backend (API)

Technology Purpose
FastAPI (Python 3.12+) REST API framework
SQLModel Database ORM
Neon PostgreSQL Serverless PostgreSQL database
passlib + bcrypt Password hashing
python-jose (JWT) Token authentication
python-dotenv Environment variable management

πŸš€ Getting Started

Prerequisites

  • Flutter SDK 3.x+
  • Python 3.12+
  • A Neon PostgreSQL project (free tier is fine)

1. Clone the Repository

git clone https://github.com/devbalbuena/Kausap-AI.git
cd Kausap-AI

2. Set Up the Backend

cd backend
python -m venv venv

# Windows
.\\venv\\Scripts\\activate
# Mac/Linux
source venv/bin/activate

pip install -r requirements.txt

Create a .env file inside /backend:

DATABASE_URL=postgresql+psycopg2://your_neon_connection_string
SECRET_KEY=your_super_secret_key

Start the API server:

uvicorn app.main:app --reload

The API will be available at http://127.0.0.1:8000. Swagger docs at http://127.0.0.1:8000/docs.

3. Set Up the Frontend

cd mobile
flutter pub get

Update the base URL in lib/config/api_config.dart to point to your backend:

static const String baseUrl = 'http://127.0.0.1:8000';

Run the app:

# Web (browser)
flutter run -d chrome

# Android/iOS (requires emulator/device)
flutter run

πŸ“ˆ Development History (Phase Tracker)

Phase Description Status
1–6 Backend: FastAPI models, auth routes, Neon PostgreSQL setup βœ… Done
7–8 Client Signup: 3-step registration UI & API integration βœ… Done
9 Professional Signup: License upload, pending verification screen βœ… Done
10 Client Home Screen: Streak, quick actions, sessions, mood trends βœ… Done
11 Daily Check-in: 3-step mood logging UI & API integration βœ… Done
12 Client Chatbot: Real-time AI chat with typing indicators βœ… Done
13 Session Booking: Calendar, time slots, conflict check, cancel βœ… Done
14 Client Activity: Activity library & session start screens βœ… Done
15 Client Profile: Account info, settings, support, logout βœ… Done
16 Professional Dashboard: Responsive layout, triage, stats βœ… Done
17 Professional Clients, Appointments & AI Insights βœ… Done
18 Professional Reports & Settings: Charts, compliance, crisis log βœ… Done
19 Availability & Booking UI: Horizontal calendar, time slots, animated booking confirmed βœ… Done
20 Dark Mode: Full dark palette, ThemeMode toggle, Provider state βœ… Done
21 Device Privacy & App Lock: Privacy screen, session timeout, data export UI βœ… Done
22 Account Security: Change password (strength meter), active devices, 2FA setup βœ… Done
23 Enhanced Onboarding & Empty States: Empty states, shimmer loaders, FAQ, Rate App dialog βœ… Done
24 Micro-Interactions & Delight: Custom page transitions, Hero animations, haptics, branded PTR βœ… Done

πŸ”’ Environment Variables

Variable Location Purpose
DATABASE_URL backend/.env Neon PostgreSQL connection string
SECRET_KEY backend/.env JWT signing secret
baseUrl mobile/lib/config/api_config.dart Backend API base URL

πŸ“ Key Files & Architecture

mobile/lib/
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ app_routes.dart          # Custom slide/fade PageRoute transitions
β”‚   └── haptic_service.dart      # Centralized haptic feedback patterns
β”œβ”€β”€ widgets/
β”‚   β”œβ”€β”€ empty_state_widget.dart       # Reusable empty state component
β”‚   β”œβ”€β”€ skeleton_loading_widget.dart  # Shimmer loading placeholders
β”‚   β”œβ”€β”€ branded_refresh_indicator.dart# Custom pull-to-refresh
β”‚   β”œβ”€β”€ rate_app_dialog.dart          # Star rating feedback dialog
β”‚   └── privacy_wrapper.dart          # App content blurring for privacy screen
β”œβ”€β”€ providers/
β”‚   β”œβ”€β”€ auth_provider.dart        # JWT auth state
β”‚   └── theme_provider.dart       # Dark/light mode state
└── theme/
    └── app_theme.dart            # Full design system (light + dark palettes)

🀝 Contributing

This project is a portfolio piece. Feel free to fork and use it as a reference. PRs are welcome for bug fixes.


Β© 2026 Kausap AI β€” Your Mental Clarity, Our Priority.

About

Kausap AI is a comprehensive mental health companion app built with Flutter and Python. It features AI-driven therapeutic conversations, daily mood tracking, professional session booking, and dynamic analytics to empower users on their wellness journey.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages