A secure, anonymous mental health support platform built with Next.js and Supabase, featuring AI-powered conversations and community support tools.
Safe Space is a comprehensive mental health support application that provides users with a safe, anonymous environment to connect with others, access AI-powered support, and participate in moderated discussions. The platform emphasizes user privacy, security, and accessibility.
- Anonymous User System: Users can participate without revealing personal information
- Real-time Chat Rooms: Community discussions with WebSocket support
- AI Companion (Serene): Google Gemini-powered conversational AI for mental health support
- Post and Comment System: Structured discussions with nested comments
- Reaction System: Emotional support through likes, hearts, and hugs
- Moderation Tools: Admin and moderator capabilities for content management
- Progressive Web App (PWA): Offline-capable with service worker caching
- Responsive Design: Mobile-first approach with adaptive layouts
- Real-time Updates: Live notifications and chat updates
- Offline Support: Core functionality works without internet connection
- Accessibility: WCAG-compliant design with screen reader support
- Next.js 15: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Radix UI: Accessible component primitives
- Framer Motion: Smooth animations and transitions
- Supabase: PostgreSQL database with real-time subscriptions
- Row Level Security (RLS): Database-level access control
- Supabase Auth: Secure authentication system
- Google Gemini AI: Conversational AI companion
- Crisis Detection: Automated safety monitoring
- Content Moderation: AI-assisted moderation tools
- Vercel/Netlify: Serverless deployment
- Progressive Web App: Service worker caching
- WebSocket: Real-time communication
- Node.js 18+
- npm or yarn
- Supabase account
-
Clone the repository
git clone https://github.com/Demiserular/SAFESPACE.git cd SAFESPACE -
Install dependencies
npm install
-
Environment Setup Create a
.env.localfile with the following variables:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key GEMINI_API_KEY=your_gemini_api_key
-
Database Setup
- Create a new Supabase project
- Run the database setup script located in
docs/QUICK-START.md - Update your environment variables with the Supabase credentials
-
Development Server
npm run dev
Open http://localhost:3000 in your browser.
The application uses a PostgreSQL database with the following main tables:
posts: User-generated content and discussionscomments: Nested comment systemreactions: Emotional support reactionsreports: Content moderation systemuser_roles: Administrative permissions
All tables implement Row Level Security (RLS) policies for data protection.
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── admin/ # Admin dashboard
│ ├── chat/ # Chat room functionality
│ └── posts/ # Post and comment system
├── components/ # Reusable React components
│ ├── ui/ # UI component library
│ └── comments/ # Comment system components
├── lib/ # Utility functions and configurations
├── hooks/ # Custom React hooks
├── styles/ # Global styles and themes
├── public/ # Static assets
└── supabase/ # Database migrations and configuration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Safe Space prioritizes user privacy and security:
- Anonymous Participation: No personal information required
- End-to-End Security: Encrypted data transmission
- Crisis Detection: Automated monitoring for safety
- Content Moderation: Human and AI-assisted moderation
- Data Protection: GDPR-compliant data handling
This project is private and proprietary.
For technical support or questions:
- Create an issue in the GitHub repository
- Contact me