The inspiration for SafeHouse stems from the "clinical fatigue" experienced by today's youth. Most mental health apps feel like medical tools or sterile chatbots. We noticed that people are most honest when they feel they are in a non-judgmental, anonymous space. We wanted to build a "digital sanctuary" that combines the raw honesty of anonymous forums with the immediate safety of AI-driven moderation, a place where no cry for help goes unanswered in a void of silence.

SafeHouse is a web-based PWA that provides a secure, anonymous environment for mental health support. Anonymous Feed: Users post "Vents" or "Thoughts" using an alias, ensuring total privacy. Seamless Chat: Each post can evolve into a dedicated anonymous chatroom for peer-to-peer connection. The Guardian Peer: A "Hidden AI" (powered by Gemini) acts as a community member. It doesn't identify as a bot; instead, it provides empathetic, casual support and steps in with crisis resources the moment it detects high-distress language. Shadow-Moderation: Toxic or hateful content is filtered out instantly using a "shadow-ban" technique where the sender sees the post, but the community is protected from the harm.

We utilized a high-performance, modern stack to ensure the platform feels organic and fast: Frontend: Next.js 14 with Tailwind CSS. Backend/Database: Supabase (PostgreSQL). We implemented a custom SQL trigger to handle anonymous profile creation upon sign-up. AI Logic: Gemini 2.5 Flash. We chose Gemini for its low latency and high context window. We developed a specialized system prompt that allows the model to maintain a "peer persona." Security: Row Level Security (RLS) ensures that user data is encrypted and only accessible to the authorized alias.

The "Hidden AI" Paradox: It was difficult to tune the AI to sound like a supportive peer without it sounding like a clinical assistant. We had to iterate on the prompt to include "human" traits like casual capitalization and empathetic validation.Real-time Synchronization: Implementing Socket.io within Next.js to handle anonymous chat rooms across multiple users required careful handling of server-side states.

Shadow-Blocking Logic: Creating a database architecture that could "hide" messages from some users while showing them to others (to prevent trolls from realizing they were blocked) required complex filtering logic in our Supabase queries.

Believable Empathy: We successfully created an AI agent that feels like a real friend. In testing, the AI was able to identify distress and offer help without breaking the "safe space" immersion. Secure Anonymity: We built a system where even if the database were compromised, a user's real identity is disconnected from their anonymous alias through our "Shadow Profile" trigger. Design Language: Achieving a UI/UX that feels like a "safe house"—calm, green, and inviting—rather than a scary medical app.

Ethics of AI: We learned about the deep responsibility of using "Hidden AI" and the importance of including ethical guardrails to ensure resources are always provided in crisis. Nuance in Language: We learned that AI is much better at detecting "cry-for-help" nuances than traditional keyword-based filters. Technical Scalability: We gained experience in building real-time applications using Next.js API routes and Supabase's real-time listeners.

Multimodal Support: We plan to use Gemini’s multimodal capabilities to allow users to share art or voice notes for mood analysis. Gamified Healing: Introducing "Seeds" that grow into digital plants as users provide support to others in the community. Localized Context: Training the AI to understand cultural nuances and slang in different regions to make the "SafeHouse" experience feel local to every user worldwide.

Built With

Share this project:

Updates