Project Info
Inspiration
We started ChatRealm because we saw too many people suffering in silence. In online support groups, we watched quiet voices get drowned out. In therapy sessions, we saw people struggling to share their deepest fears. In recovery communities, we noticed how one person's courage to speak could inspire a whole room, but only if someone was there to hold space for them. Our north star was simple: uplift the people who are scared to speak up. We wanted to build something that amplifies voices that might otherwise go unheard, keeps the room engaged and supportive, and most importantly, keeps people calm and safe when they're sharing the things that frighten them most. Because everyone deserves to be heard, and no one should face their darkest moments alone.
What it does
ChatRealm is a safe space where AI doesn't replace human connection, it protects and nurtures it. Think of it as having a thoughtful friend in every conversation who notices when someone needs encouragement, steps in when things get heated, and celebrates every small victory. We built three specialized rooms where people need this support most: Dungeons & Dragons rooms aren't just about rolling dice. They're about shy players finding their voice through their characters, building confidence in a world where they can be heroes. Our AI Dungeon Master makes sure everyone gets their moment to shine. Alcoholics Anonymous rooms are sacred spaces where people share their struggles with addiction. Our AI recognizes when someone's celebrating "day one sober" and rallies the room to support them. When someone's struggling with temptation at 2 AM, it's there with resources and encouragement, buying time until human support arrives. Group Therapy rooms are where people work through trauma, anxiety, and depression. Our AI creates the calm, non-judgmental presence that helps people open up. It recognizes when someone's triggered and gently guides the conversation to safer ground, all while making sure quieter voices get heard. Here's what makes us different: our AI learns from your LinkedIn profile (if you choose to share it) to understand who you really are. It's not about stalking, it's about context. When you share your story, the AI knows whether you're a college student facing finals stress or a veteran dealing with PTSD. It tailors its support to meet you where you are.
How we built it
We knew from day one that this couldn't be a typical chatbot. People's mental health and recovery are too important to trust to a single AI making snap judgments. So we built something different: five specialized AI agents working together like a support team. The Response Coordinator is the team leader, deciding when to speak up and when to stay quiet. Sometimes the best support is silent presence. The Context Manager remembers everything. Not just what you said five minutes ago, but patterns over weeks. It knows if you're improving, struggling, or stuck. The Wellness Guardian is our safety net. It watches for crisis signals, words that suggest someone's in danger, and quietly alerts the system to provide immediate resources. The Emotion Tracker reads the room. It notices when someone's message seems cheerful but their word choice suggests they're masking pain. It picks up on the subtle cries for help. The Toxicity Detector is our bouncer. It keeps the space safe by catching harmful content before it derails someone's healing journey. Tech we used: FastAPI and Python for the backend brain React and TypeScript for the interface people see Socket.IO because conversations happen in real-time, not in turns Anthropic Claude for the AI that actually understands nuance and empathy Fetch.ai's uagents for coordinating our five-agent support team PostgreSQL and Redis for remembering every conversation and context BrightData API for optional LinkedIn profile understanding Docker to keep everything running smoothly We gave ChatRealm a retro pixel-art look on purpose. When you're about to share your deepest fear, a friendly pixel avatar feels less intimidating than a corporate interface. It's approachable while still taking your story seriously. Challenges we ran through Making AI actually empathetic was harder than we thought. Getting five AI agents to work together without tripping over each other required us to completely rethink our architecture. We failed. A lot. Our first version would timeout, crash, or give tone-deaf responses. We learned that real empathy comes from context, so we spent weeks teaching our AI to understand the difference between someone saying "I'm struggling" in a D&D game versus in an AA meeting. Building trust is everything. When someone's sharing that they relapsed, or that they had suicidal thoughts, the AI can't just spit out a generic response. It needs to understand the weight of that moment. We built a sophisticated context system that reads not just words, but the person behind them. LinkedIn integration helps, but so does remembering every interaction and learning from the community's patterns. Knowing when to intervene is an art, not a science. We wanted our AI to feel like a supportive friend, not a surveillance system. Too quiet and people feel abandoned. Too chatty and it drowns out human voices. We're still tuning this, but we built an intelligent intervention system that considers conversation flow, room energy, and individual needs. Sometimes the most supportive thing is silence. Real-time everything, always. Mental health crises don't wait for page refreshes. Someone saying "I can't do this anymore" needs immediate response. We built WebSocket connections, Redis caching, and background processing to ensure the AI is always listening and ready to help within milliseconds.
Accomplishments we're proud of
Honestly? We're most proud of the moments our AI gets it right. When it notices someone's been quiet for 20 messages and gently asks, "Hey [name], what do you think?" That's amplifying a voice. When someone shares they hit 30 days sober and the AI celebrates with genuine warmth while encouraging others to share their own milestones. That's building community. When it detects crisis language and immediately provides suicide prevention resources while keeping the person engaged until human help arrives. That's saving lives. We built a five-agent AI system that actually works in production. We made it smart enough to know that "let's play" means something completely different in a D&D room versus a therapy session. We created an interface that feels like a game but holds space for the most serious conversations. But the real accomplishment? We built something that makes people feel safe enough to speak up.
What we learned
Technology is easy. Empathy is hard. We spent months on the technical architecture, but the real challenge was teaching AI to understand human pain and respond with genuine compassion. We learned that more context always beats smarter algorithms. Knowing someone's background, reading conversation history, and understanding room dynamics matters more than any fancy model. Silent support is still support. Our early versions talked too much. We learned that sometimes the AI's job is to just be present, ready to help, while humans connect with humans. The best moderation is invisible until it's needed. People want to be seen. The LinkedIn integration isn't about fancy tech. It's about making someone feel recognized. When the AI understands you're a nurse dealing with burnout, or a student facing academic pressure, its support becomes real instead of generic. Recovery isn't linear, and neither is conversation. Building room-specific AI taught us that every community has its own rhythm, vocabulary, and needs. One size fits nobody when it comes to supporting mental health and recovery.
What's next
We want to keep building safe spaces: More communities that need support: Veterans with PTSD, LGBTQ+ youth, chronic pain sufferers, grief support groups, neurodivergent communities finding their people. Voice channels where people can talk instead of type, because sometimes speaking your truth out loud is what healing requires. Peer matching that connects you with others who've walked your path. Not random strangers, but people whose stories resonate with yours. Crisis response network that connects to real counselors when AI support isn't enough. We never want to replace human help, just make sure you have support while waiting for it. Long-term progress tracking so you can see how far you've come, even on days when it doesn't feel like it. Community building tools that help natural leaders emerge and peer support flourish. Most importantly, we want to keep listening. To the quiet voices, the scared voices, the voices that have been told to be silent. Because at ChatRealm, everyone gets heard.
ChatRealm - Multiplayer AI Chat Arena
ChatRealm is a gamified, real-time multiplayer chat platform where users enter virtual "rooms" as avatars, interact with an AI character that maintains individual user context, group dynamics, and conversation flow across diverse scenarios (study groups, support groups, casual hangouts).
🌟 Core Features
- Spatial Chat UI - Users "walk" into rooms like a 2D game using Phaser.js
- Context-Aware AI - Tracks each user's emotional state, participation level, and conversation history
- Universal Adaptability - AI persona adapts to room type (study TA, support counselor, casual bartender)
- Real-time Multiplayer - WebSocket-based communication for instant updates
- Gamified Experience - Avatar customization, room exploration, and engagement tracking
🏗️ Architecture
Frontend
- React 18 + TypeScript - Modern UI framework
- Phaser.js 3 - 2D game engine for avatar movement
- Socket.io-client - Real-time WebSocket communication
- Zustand - Lightweight state management
- TailwindCSS + Framer Motion - Styling and animations
Backend
- FastAPI - High-performance async Python API
- Socket.io - Bidirectional real-time communication
- PostgreSQL - Persistent data storage
- Redis - Hot state cache for user/room context
- SQLAlchemy 2.0 - Database ORM
AI Integration
- Janitor AI API - Primary AI inference (25K token context)
- Anthropic Claude - Fallback and validation using Claude 3.5 Sonnet (200K token context)
Infrastructure
- Docker + Docker Compose - Containerized services
- Nginx - Reverse proxy and load balancing
🚀 Quick Start
Prerequisites
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.11+ (for local development)
- Janitor AI API Key
- Anthropic API Key (for Claude)
Installation
- Clone the repository
git clone <repository-url>
cd hackathon-cal
- Set up environment variables
cp .env.example .env
Edit .env and add your API keys:
JANITOR_AI_API_KEY=your-janitor-ai-key
ANTHROPIC_API_KEY=your-anthropic-api-key
SECRET_KEY=your-secret-key-generate-with-openssl
Get your Anthropic API key from: https://console.anthropic.com/
- Start the application with Docker Compose
docker-compose up -d
This will start:
- Frontend on http://localhost:3000
- Backend on http://localhost:8000
- Nginx on http://localhost:80
- PostgreSQL on localhost:5432
- Redis on localhost:6379
- Initialize default rooms (first time only)
Visit http://localhost:8000/docs and use the Swagger UI to call:
POST /api/rooms/initialize-defaults
Or use curl:
curl -X POST http://localhost:8000/api/rooms/initialize-defaults \
-H "Authorization: Bearer YOUR_TOKEN"
- Access the application
Open http://localhost:80 in your browser
🎮 User Flow
- Landing Page - Welcome screen with animated preview
- Avatar Creation - Customize your character (style, color, mood, bio)
- Tutorial Hallway - Interactive guide showing how to navigate
- Room Selection - Choose from:
- 🎓 Study Group - Collaborative learning with Dr. Chen (AI)
- 🤝 Support Circle - Safe space with Sam (AI counselor)
- 🎮 Casual Lounge - Hang out with Rex (AI bartender)
- 🏠 Private Room - Solo chat with AI
- Room Experience - Chat, move around, interact with AI and users
🛠️ Development
Frontend Development
cd frontend
npm install
npm run dev
Frontend will be available at http://localhost:3000
Backend Development
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
Backend will be available at http://localhost:8000
Running Tests
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test
📁 Project Structure
chatrealm/
├── docker-compose.yml
├── .env.example
├── README.md
├── plan.md # Technical design document
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── game/ # Phaser.js game engine
│ │ ├── services/ # API & Socket services
│ │ ├── store/ # Zustand state management
│ │ └── types/ # TypeScript types
│ ├── Dockerfile
│ └── package.json
│
├── backend/
│ ├── app/
│ │ ├── api/ # REST API routes & WebSocket
│ │ ├── core/ # Database, Redis, Security
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── services/ # Business logic
│ │ └── utils/ # Helper functions
│ ├── Dockerfile
│ └── requirements.txt
│
└── nginx/
├── Dockerfile
└── nginx.conf
🔑 Key Components
AI Context Management
The system tracks:
- User Context: Sentiment, participation, conversation history
- Room Context: Active users, conversation flow, group dynamics
- AI Triggers: Direct mentions, confusion detection, silence thresholds
AI Persona System
Each room type has a unique AI personality:
- Dr. Chen (Study Group) - Patient teacher, uses analogies
- Sam (Support Circle) - Empathetic counselor, validates emotions
- Rex (Casual Lounge) - Charismatic storyteller, social facilitator
- Atlas (Tutorial) - Helpful guide, clear instructions
Real-time Features
- Avatar movement synchronized across clients
- Instant message delivery with typing indicators
- Speech bubbles appear above avatars
- Dynamic user presence tracking
🔧 Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
POSTGRES_DB | PostgreSQL database name | chatrealm |
POSTGRES_USER | PostgreSQL username | chatrealm |
POSTGRES_PASSWORD | PostgreSQL password | chatrealm_password |
REDIS_URL | Redis connection URL | redis://redis:6379/0 |
SECRET_KEY | JWT secret key | (generate with openssl) |
JANITOR_AI_API_KEY | Janitor AI API key | (required) |
ANTHROPIC_API_KEY | Anthropic Claude API key | (required) |
CORS_ORIGINS | Allowed CORS origins | http://localhost:3000,http://localhost:80 |
API Endpoints
GET /health- Health checkPOST /api/auth/register- Register new userPOST /api/auth/login- User loginPOST /api/auth/guest- Guest loginGET /api/rooms/- List all roomsPOST /api/rooms/- Create roomGET /api/users/me- Get current userPATCH /api/users/me- Update user
Full API documentation: http://localhost:8000/docs
🐛 Troubleshooting
Docker Issues
# Rebuild containers
docker-compose down
docker-compose build --no-cache
docker-compose up -d
# View logs
docker-compose logs -f backend
docker-compose logs -f frontend
# Reset database
docker-compose down -v
docker-compose up -d
Connection Issues
- Ensure all services are running:
docker-compose ps - Check backend health:
curl http://localhost:8000/health - Verify Redis:
docker-compose exec redis redis-cli ping - Check PostgreSQL:
docker-compose exec postgres psql -U chatrealm -d chatrealm -c "SELECT 1"
WebSocket Issues
- Check browser console for Socket.io errors
- Verify backend WebSocket endpoint:
ws://localhost:8000/socket.io - Ensure CORS is properly configured
📝 License
This project is developed for the hackathon.
🙏 Acknowledgments
- Fetch AI for the AI inference API
- Anthropic for Claude 3.5 Sonnet AI capabilities
- Phaser.js for the excellent game engine
- FastAPI for the modern Python framework
📧 Support
For issues and questions:
- Check the plan.md for detailed technical documentation
- Review Docker logs:
docker-compose logs - Open an issue in the repository
Built with ❤️ for the hackathon
Analysis
View
Metric
- 6
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
- RedisIn code
- SQLIn code
- Tailwind CSSIn code
- TypeScriptIn code
- DockerClaimed
- PostgreSQLClaimed
11 of 13 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
465 KB
Source files
81
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
saurabh98s/calhacks24
96 files · 644 KB · @ 1f983a9
Structure
Interface
40 files · 42%Screens, components and styles rendered to the user.
API & routing
6 files · 6%Request entry points: routes, handlers and controllers.
Application logic
22 files · 23%Domain rules, services and shared utilities.
Data & schema
11 files · 11%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python58%
- TypeScript30%
- Markdown8%
- CSS2%
- YAML1%
- Shell0%
- Other (3)1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/requirements.txt
pypi · 22- aioredis
- alembic
- anthropic
- asyncpg
- celery
- email-validator
- fastapi
- httpx
- passlib[bcrypt]
- psycopg2-binary
- pydantic
- pydantic-settings
- pydantic[email]
- python-dotenv
- python-jose[cryptography]
- python-multipart
- python-socketio
- redis
- +4 more
frontend/package.json
npm · 22- axios
- framer-motion
- lucide-react
- phaser
- react
- react-dom
- react-router-dom
- socket.io-client
- zustand
- +13 more
backend/pyproject.toml
pypi · 6- fastapi
- pydantic
- python-socketio
- redis
- sqlalchemy
- uvicorn
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
Anthropic Claude integration for empathetic AI responsesVerified
Anthropic Claude is used for AI that understands nuance and empathy
Claimed on Devposthigh confidencebackend/app/services/ai_service.py:150— AsyncAnthropic client calls model claude-sonnet-4-5-20250929 for response generation, with Claude also used as a response-quality judge
D&D, AA, and Group Therapy specialized rooms with distinct AI personasVerified
Specialized rooms for D&D (Dungeon Master), AA (Sponsor), and Group Therapy (Dr. Chen) with tailored moderation and prompts
Claimed on Devposthigh confidencebackend/app/core/init_rooms.py:17— Default rooms created for dnd, alcoholics_anonymous, and group_therapy with distinct personas (Dungeon Master Thaldrin, Sponsor Morgan, Dr. Sarah Chen)backend/app/services/room_context_builder.py:11— Room-type-specific system prompts with distinct personas, tone, and interpretation rules (e.g. 'let's play' meaning in D&D vs AA)backend/app/api/websocket.py:574— Per-room-type temperature/max_tokens tuning and fallback responses for dnd, alcoholics_anonymous, group_therapyfrontend/src/pages/TutorialHallway.tsx:126— Frontend room selection UI lists D&D, AA, and Group Therapy as distinct doors/rooms
LinkedIn profile scraping via BrightData for AI persona contextVerified
AI learns from a user's LinkedIn profile (via BrightData API) to tailor support to their background
Claimed on Devposthigh confidencebackend/app/services/linkedin_scraper.py:26— scrape_linkedin_profile() calls BrightData's web unlocker API, parses profile HTML, and generates a persona stringbackend/app/api/routes/auth.py:147— Registration flow calls scrape_linkedin_profile and stores the resulting persona on user_data.persona
Pixel-art 2D spatial chat UI (Phaser.js)Verified
Retro pixel-art look with a friendly pixel avatar interface, less intimidating than a corporate UI
Claimed on Devposthigh confidencefrontend/src/game/config.ts:1— Phaser game engine configured for the spatial UIfrontend/src/game/GameScene.ts:437— GameScene defines room doors and pixel-art styled room types (D&D, AA, Therapy, Private) with icons/colorsfrontend/src/pages/AvatarCreation.tsx:1— Dedicated avatar creation page referencing pixel-art assets
Real-time chat via Socket.IO/WebSocketVerified
Conversations happen in real-time via Socket.IO, not in turns
Claimed on Devposthigh confidencebackend/app/api/websocket.py:1— Dedicated websocket route module handling live message flowfrontend/src/services/socketService.ts:1— Frontend socket.io-client service for real-time communicationbackend/app/main.py:1— Socket.IO server mounted in backend main app
ASI:One / Fetch.ai inference integrationCode-supported
Fetch.ai's asi-one used as an AI inference/coordination layer
Claimed on Devpostmedium confidencebackend/app/services/ai_service.py:19— AIService configured with ASI_ONE_API_KEY and asi1.ai base URL, with a _call_fetchai path attempted before falling back to Claude
Context Manager tracking user patterns over time (participation, sentiment, topics)Code-supported
Context Manager remembers patterns over weeks, tracking if a user is improving, struggling, or stuck
Claimed on Devpostmedium confidencebackend/app/services/context_manager.py:1— Service tracks user/room context state (participation, topics, activity) in Redis, consumed by _extract_context_data in the aggregatorbackend/app/services/enhanced_memory_manager.py:1— Separate long-term/enhanced memory manager exists for conversation history beyond immediate context
Crisis detection and wellness alertsCode-supported
Wellness Guardian watches for crisis signals and alerts the system to provide immediate resources
Claimed on Devpostlow confidencebackend/app/services/multiagent_service.py:270— Aggregation logic checks wellness_guardian.analysis.crisis and returns an 'alert' action with severity/indicators, but the actual crisis-detection logic runs in an externally-deployed Agentverse agent not present in this repobackend/app/schemas/agent_schemas.py:115— WellnessResponse schema defines crisis, severity, indicators, action_required fields consumed by the aggregator
Docker Compose based deployment (frontend, backend, nginx, Postgres, Redis)Code-supported
Docker Compose starts frontend, backend, nginx, Postgres, and Redis together
Claimed on readmemedium confidencenginx— Dedicated nginx directory exists for the reverse proxy service described in docker-compose; a docker-compose.yml was not directly inspected in this pass
Five-agent AI bureau (Response Coordinator, Context Manager, Wellness Guardian, Emotion Tracker, Toxicity Detector) via Fetch.ai uagentsCode-supported
Five specialized AI agents (Response Coordinator, Context Manager, Wellness Guardian, Emotion Tracker, Toxicity Detector) coordinate via Fetch.ai uagents
Claimed on Devpostmedium confidencebackend/app/services/multiagent_service.py:12— Imports uagents Agent/Bureau, defines MultiAgentService with 5 named agent roles, hardcoded Agentverse addresses, and message handlers per agent typebackend/app/api/websocket.py:340— websocket handler calls get_multiagent_service().process_message(), confirming the 5-agent flow is wired into live chat
Toxicity detection and moderation actions (warn/ban)Code-supported
Toxicity Detector is a bouncer that catches harmful content before it derails someone's healing journey
Claimed on Devpostmedium confidencebackend/app/services/multiagent_service.py:295— Toxicity score thresholds (>=8 ban, >=5 warn) drive concrete moderation actions in the aggregation logic
Janitor AI as primary inference engine with Claude fallbackClaimed only
README states Janitor AI API is the primary AI inference (25K token context), with Anthropic Claude as fallback/validation
Claimed on readmehigh confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.