Skip to content
ayushunhale10-codePublic

About

Private on-device AI mental wellness web app (React + TypeScript + WebAssembly)

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

10 Commits

Folders and files

Repository files navigation

Serenio β€” Your Private Mental Wellness Companion

🌐 Live Demo

πŸ‘‰ https://serenio-eosin.vercel.app

A voice-first mental health companion web app built with React + TypeScript, powered by on-device AI using the @runanywhere/web SDK. All AI inference runs locally in the browser via WebAssembly β€” no server, no API key, 100% private.

"Would you share your deepest feelings with an app that sends everything to a server? Serenio keeps it all on your device. Always."


🌟 Features

Page What it does
Voice Speak naturally β€” Serenio listens, understands, and responds like a caring friend. Full STT β†’ LLM β†’ TTS pipeline runs on-device.
Chat Type your thoughts and get warm, casual responses from Serenio β€” no cloud, no data leaving your device.
Mood Log your daily mood, get 15 personalized activity suggestions with quotes, and track your 7-day mood history.
History Your private journal β€” every voice and chat session saved locally on your device only.

πŸ“Έ Screenshots

🏠 Home

home

πŸ’¬ Chat

chat

🧠 Venting Space

venting

🌿 Wellness Hub

wellness

🎯 Goals Hub

goals

😊 Mood Tracker

mood

πŸ“œ History

history

πŸ”’ Privacy by Design

  • Zero cloud costs β€” all inference runs on your device
  • True privacy β€” your voice, thoughts and feelings never leave your browser
  • Works offline β€” airplane mode? No problem
  • Instant responses β€” no network latency, sub-100ms time to first token
  • Crisis detection β€” immediate helpline shown for sensitive situations

πŸ†˜ Crisis Support

Serenio automatically detects crisis situations and immediately shows verified Indian mental health helplines:

Helpline Number Hours
iCall 9152987821 Mon–Sat, 8am–10pm
Vandrevala Foundation 1860-2662-345 24/7
AASRA 9820466627 24/7
Snehi 044-24640050 Mon–Sat, 8am–10pm

πŸš€ Quick Start

npm install
npm run dev

Run locally, then open:

http://localhost:5173. Models download on first use and are cached in the browser's Origin Private File System (OPFS) β€” subsequent visits load instantly.


πŸ€– AI Models Used

Model Purpose Size
LFM2 350M (LiquidAI) LLM β€” conversation responses ~250MB
Whisper Tiny STT β€” speech to text ~105MB
Piper TTS (Lessac) TTS β€” text to speech ~65MB
Silero VAD v5 Voice activity detection ~5MB

πŸ—οΈ How It Works

@runanywhere/web (npm package)
  β”œβ”€β”€ WASM engine (llama.cpp, whisper.cpp, sherpa-onnx)
  β”œβ”€β”€ Model management (download, OPFS cache, load/unload)
  └── TypeScript API (TextGeneration, STT, TTS, VAD, VoicePipeline)

Voice pipeline flow:

User speaks β†’ VAD detects speech β†’ Whisper transcribes β†’ LFM2 responds β†’ Piper speaks back
     ↓
Everything runs locally. Nothing sent to any server.

πŸ“ Project Structure

src/
β”œβ”€β”€ main.tsx                  # React root + SDK preload + SOS button
β”œβ”€β”€ App.tsx                   # Tab navigation fallback
β”œβ”€β”€ runanywhere.ts            # SDK init + model catalog
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ Landing.tsx           # Splash / welcome screen
β”‚   β”œβ”€β”€ Home.tsx              # Voice orb β€” main experience
β”‚   β”œβ”€β”€ Session.tsx           # Chat interface
β”‚   β”œβ”€β”€ Mood.tsx              # Mood check-in + activity suggestions
β”‚   └── History.tsx           # Journal / session history
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Sidebar.tsx           # Navigation sidebar
β”‚   β”œβ”€β”€ SOSButton.tsx         # Always-visible crisis help button
β”‚   β”œβ”€β”€ VoiceTab.tsx          # Voice pipeline (fallback)
β”‚   └── ChatTab.tsx           # Chat (fallback)
β”œβ”€β”€ context/
β”‚   β”œβ”€β”€ ThemeContext.tsx       # Light/dark mode
β”‚   └── HistoryContext.tsx     # Session + mood persistence (localStorage)
β”œβ”€β”€ workers/
β”‚   └── vlm-worker.ts         # VLM Web Worker
β”œβ”€β”€ hooks/
β”‚   └── useModelLoader.ts     # Model download/load hook
└── styles/
    └── index.css             # Global styles + Tailwind

🎨 Design

  • Color palette β€” Warm cream #FDF6EC, Soft peach #F4A261, Sage green #84A98C
  • Typography β€” Nunito (calm, friendly, readable)
  • Theme β€” Light mode default, dark mode supported
  • Feel β€” Like a warm hug in app form. Not clinical, not scary.

🚒 Deployment

Vercel

npm run build
npx vercel --prod

The included vercel.json sets the required Cross-Origin-Isolation headers.

Netlify

Add a _headers file:

/*
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Embedder-Policy: credentialless

Any static host

Serve the dist/ folder with these HTTP headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentialless

🌐 Browser Requirements

  • Chrome 96+ or Edge 96+ (recommended: 120+)
  • WebAssembly (required)
  • SharedArrayBuffer (requires Cross-Origin Isolation headers)
  • OPFS (for persistent model cache)
  • Microphone access (for voice features)

πŸ‘¨β€πŸ’» My Contributions

  • Led and developed the complete frontend architecture
  • Designed and implemented full UI/UX across all major features
  • Built reusable and scalable React components
  • Integrated on-device AI pipelines (STT, LLM, TTS) with frontend
  • Developed core features like Voice, Chat, Mood tracking, and History
  • Improved responsiveness and overall user experience
  • Contributed to feature planning and product design

🀝 Acknowledgment

This project was originally developed collaboratively during a hackathon.

This repository is a personal reconstruction created to showcase my contributions and work.


πŸ“š Resources


πŸ“„ License

MIT

About

Private on-device AI mental wellness web app (React + TypeScript + WebAssembly)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages