A warm, supportive digital mental health platform designed with love for students. Here, your mental health matters, your feelings are valid, and you're never alone on this journey.
Features β’ Installation β’ Documentation β’ Deployment β’ Contributing
- About
- Features
- Tech Stack
- Getting Started
- Project Structure
- API Documentation
- Usage Guide
- Deployment
- Security & Privacy
- Contributing
- License
- Support
Solace is a comprehensive digital mental health platform specifically designed for students. In a world where 60% of students feel overwhelmed by anxiety and 80% hesitate to seek help due to stigma, Solace provides a safe, judgment-free space for mental wellness support.
To provide accessible, empathetic, and effective mental health support to students worldwide, breaking down barriers and reducing stigma associated with seeking help.
- π 60% of students feel overwhelmed by anxiety
- π 40% experience feelings of sadness
- π« 80% hesitate to seek help due to stigma
- β 95% of users report feeling better after using Solace
- 24/7 Availability: Like having a caring friend available around the clock
- Instant Support: Get immediate responses to mental health concerns
- Coping Strategies: Receive personalized guidance and techniques
- Gentle Guidance: Empathetic AI-powered conversations powered by OpenAI GPT-3.5
- Professional Counselors: Connect with licensed mental health professionals
- Complete Privacy: Your conversations are protected and confidential
- Easy Scheduling: Simple appointment booking system
- Secure Sessions: End-to-end privacy protection
- Peer Support Groups: Find your tribe in moderated support communities
- Judgment-Free Environment: Share, listen, and grow together
- Moderated Discussions: Safe spaces with community guidelines
- Shared Experiences: Connect with others on similar journeys
- Digital Journal: Private space for thoughts and reflections
- Mood Tracking: Visualize your emotional journey over time
- Progress Insights: Track your mental wellness progress
- Personal Growth: Identify patterns and celebrate improvements
- Curated Content: Carefully selected wellness materials
- Breathing Exercises: Guided relaxation techniques
- Meditation Guides: Mindfulness and meditation resources
- Multilingual Support: Content in your preferred language
- 24/7 Helplines: Instant access to crisis support services
- Emergency Resources: Quick access to emergency contacts
- Safety Protocols: Immediate support when you need it most
- India-Specific: Includes Indian mental health helplines (AASRA, iCALL, YourDOST)
- Institutional Analytics: Insights for educational institutions
- Student Wellness Metrics: Aggregate data (privacy-preserving)
- Resource Management: Manage content and resources
- User Support Tools: Administrative tools for platform management
- Modern UI/UX: Beautiful, intuitive interface design
- Dark/Light Mode: Theme toggle for comfortable viewing
- Responsive Design: Works seamlessly on desktop and mobile
- Accessibility: Built with accessibility best practices
- HTML5 - Semantic markup and structure
- CSS3 - Modern styling with animations and responsive design
- Vanilla JavaScript - Interactive functionality and DOM manipulation
- Firebase SDK (v10.7.1) - Authentication and database services
- Node.js (β₯18.0.0) - Runtime environment
- Express.js (v4.18.2) - Web application framework
- Axios (v1.6.0) - HTTP client for API requests
- CORS (v2.8.5) - Cross-origin resource sharing
- dotenv (v16.3.1) - Environment variable management
- Firebase Authentication - User authentication and authorization
- Cloud Firestore - NoSQL database for user data
- OpenAI GPT-3.5 - AI-powered chat companion
- Render/Railway/Vercel - Deployment platforms
- Nodemon (v3.0.1) - Development server auto-reload
- http-server (v14.1.1) - Local static file serving
Before you begin, ensure you have the following installed:
- Node.js (version 18.0.0 or higher)
- npm (comes with Node.js) or yarn
- Git (for version control)
- Firebase Account (for authentication and database)
- OpenAI API Key (for AI chat functionality)
-
Clone the repository
git clone https://github.com/yourusername/solace-main.git cd solace-main -
Install dependencies
# Install root dependencies npm install # Install backend dependencies cd backend npm install cd ..
-
Set up Firebase
- Create a Firebase project at Firebase Console
- Enable Authentication (Email/Password and Google Sign-In)
- Create a Firestore database
- Copy your Firebase configuration
- Update
scripts/firebase-config.jswith your credentials
-
Configure environment variables
Create a
.envfile in the root directory:# Server Configuration PORT=3000 CORS_ORIGIN=* # OpenAI Configuration OPENAI_API_KEY=your-openai-api-key-here # Firebase Configuration (optional, can be in firebase-config.js) # FIREBASE_API_KEY=your-firebase-api-key # FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com # FIREBASE_PROJECT_ID=your-project-id
-
Start the development server
# Development mode (with auto-reload) npm run dev # Production mode npm start # Or serve static files only npm run serve
-
Access the application
- Open your browser and navigate to
http://localhost:3000 - The landing page should load successfully
- Open your browser and navigate to
-
Create Firebase Project
- Go to Firebase Console
- Click "Add project"
- Follow the setup wizard
-
Enable Authentication
- Navigate to Authentication β Sign-in method
- Enable Email/Password
- Enable Google Sign-In (optional but recommended)
-
Create Firestore Database
- Go to Firestore Database
- Click "Create database"
- Start in test mode (or configure security rules)
- Choose your preferred location
-
Get Configuration
- Go to Project Settings β General
- Scroll to "Your apps" section
- Click the web icon (</>)
- Copy the configuration object
-
Update Configuration
- Open
scripts/firebase-config.js - Replace the
firebaseConfigobject with your values
- Open
-
Create OpenAI Account
- Sign up at OpenAI Platform
- Add billing information (pay-as-you-go)
-
Generate API Key
- Go to API Keys section
- Click "Create new secret key"
- Copy the key immediately (it won't be shown again)
-
Set Environment Variable
- Add
OPENAI_API_KEYto your.envfile - Or set it in your deployment platform's environment variables
- Add
solace-main/
β
βββ π index.html # Landing page
βββ π dashboard.html # Main user dashboard
βββ π auth.html # Authentication page (login/signup)
βββ π ai-chat.html # AI chat interface
βββ π appointments.html # Counselor booking page
βββ π journal.html # Journaling interface
βββ π mood-tracker.html # Mood tracking dashboard
βββ π community.html # Community support page
βββ π resources.html # Wellness resources
βββ π admin-dashboard.html # Admin analytics dashboard
βββ π onboarding.html # User onboarding flow
βββ π profile.html # User profile page
βββ π contact.html # Contact page
βββ π help.html # Help and support
βββ π privacy.html # Privacy policy
βββ π terms.html # Terms of service
β
βββ π scripts/ # JavaScript files
β βββ firebase-config.js # Firebase configuration
β βββ landing.js # Landing page logic
β βββ auth.js # Authentication logic
β βββ dashboard.js # Dashboard functionality
β βββ ai-chat.js # AI chat interface logic
β βββ onboarding.js # Onboarding flow
β βββ profile.js # Profile management
β βββ admin-dashboard.js # Admin dashboard logic
β βββ pages.js # Shared page utilities
β
βββ π styles/ # CSS stylesheets
β βββ landing.css # Landing page styles
β βββ dashboard.css # Dashboard styles
β βββ auth.css # Authentication styles
β βββ ai-chat.css # Chat interface styles
β βββ onboarding.css # Onboarding styles
β βββ profile.css # Profile styles
β βββ admin-dashboard.css # Admin dashboard styles
β βββ pages.css # Shared page styles
β
βββ π backend/ # Backend server
β βββ server.js # Express server with AI chat API
β βββ package.json # Backend dependencies
β βββ setup.sh # Setup script
β
βββ π server.js # Root server file
βββ π package.json # Root package configuration
βββ π render.yaml # Render deployment config
βββ π deploy.sh # Deployment script
β
βββ π README.md # This file
βββ π DEPLOYMENT.md # Detailed deployment guide
βββ π QUICK_DEPLOY.md # Quick deployment reference
Development: http://localhost:3001
Production: https://your-domain.com
Check if the API server is running.
GET /healthResponse:
{
"status": "ok",
"timestamp": "2025-01-XX",
"service": "Solace AI Backend"
}Send a message to the AI companion and receive a response.
POST /api/chatHeaders:
{
"Content-Type": "application/json"
}Request Body:
{
"message": "I'm feeling anxious about my exams",
"userId": "user-id-123",
"conversationHistory": [
{
"role": "user",
"content": "Hello"
},
{
"role": "assistant",
"content": "Hello! How can I help you today?"
}
]
}Response:
{
"response": "I understand that exam anxiety can be really challenging...",
"timestamp": "2025-01-XXT12:00:00Z"
}Error Responses:
400 Bad Request
{
"error": "Missing required field: message"
}429 Too Many Requests
{
"error": "Rate limit exceeded",
"message": "Too many requests. Please try again later.",
"retryAfter": 45
}500 Internal Server Error
{
"error": "Internal server error",
"message": "Failed to process chat request"
}- Limit: 10 requests per minute per IP address
- Window: 60 seconds (1 minute)
- Headers:
Retry-Afterheader included in 429 responses
Currently, the API uses simple rate limiting by IP address. For production, consider implementing:
- JWT token authentication
- User-based rate limiting
- API key authentication for admin endpoints
-
Getting Started
- Visit the landing page
- Click "Get Started" or "Begin Your Journey"
- Sign up with email/password or Google account
- Complete the onboarding process
-
Using AI Chat
- Navigate to the AI Chat section
- Type your message and press Enter
- The AI companion will respond with empathetic guidance
- Conversation history is maintained during your session
-
Booking Appointments
- Go to the Appointments page
- Browse available counselors
- Select a date and time
- Confirm your booking
-
Journaling
- Access the Journal section
- Write your thoughts and feelings
- Entries are saved automatically
- View your journal history
-
Mood Tracking
- Use the Mood Tracker to log your daily mood
- View weekly and monthly trends
- Identify patterns in your emotional well-being
-
Local Development
# Start development server with auto-reload npm run dev # Start production server npm start
-
Testing API Endpoints
# Health check curl http://localhost:3001/health # Chat endpoint (example) curl -X POST http://localhost:3001/api/chat \ -H "Content-Type: application/json" \ -d '{"message": "Hello", "userId": "test-user"}'
-
Building for Production
# Install production dependencies npm ci --production # Start server npm start
Solace can be deployed on various platforms. We provide detailed guides for multiple options:
- Render (Recommended) - Free Node.js hosting
- Railway - Alternative free hosting
- Vercel - Static + serverless functions
- π DEPLOYMENT.md - Comprehensive deployment guide
- β‘ QUICK_DEPLOY.md - Quick deployment reference
Make sure to set these in your deployment platform:
PORT=3000
OPENAI_API_KEY=your-production-api-key
CORS_ORIGIN=https://your-domain.com
NODE_ENV=production- Firebase project configured
- Environment variables set
- OpenAI API key configured
- CORS origin set correctly
- Database security rules configured
- Custom domain configured (optional)
- SSL certificate enabled
- Error tracking set up (optional)
- Encryption: All data transmitted over HTTPS
- Firebase Security: Firestore security rules protect user data
- API Security: Rate limiting prevents abuse
- Privacy-First: User data is not shared with third parties
- MoHFW Compliant: Aligns with Indian Ministry of Health guidelines
- Privacy Policy: Comprehensive privacy policy available
- Terms of Service: Clear terms and conditions
- Data Retention: User data retention policies in place
- Never commit API keys or secrets to version control
- Use environment variables for sensitive configuration
- Regularly update dependencies for security patches
- Implement proper authentication and authorization
- Monitor API usage for suspicious activity
If you discover a security vulnerability, please email security@solace.com (or create a private security advisory on GitHub). Do not open a public issue.
We welcome contributions to Solace! Here's how you can help:
-
Fork the repository
# Click the Fork button on GitHub # Then clone your fork git clone https://github.com/yourusername/solace-main.git
-
Create a branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes
- Write clean, readable code
- Follow existing code style
- Add comments where necessary
- Update documentation if needed
-
Test your changes
- Test locally before submitting
- Ensure no breaking changes
- Test edge cases
-
Commit your changes
git add . git commit -m "feat: Add new feature description" # Use conventional commit messages: # feat: New feature # fix: Bug fix # docs: Documentation changes # style: Code style changes # refactor: Code refactoring # test: Adding tests # chore: Maintenance tasks
-
Push and create Pull Request
git push origin feature/your-feature-name # Then create a PR on GitHub
- β Follow the existing code style
- β Write meaningful commit messages
- β Update documentation for new features
- β Add comments for complex logic
- β Test your changes thoroughly
- β Keep PRs focused and small
- β Respond to code review feedback
- π Localization: Add support for more languages
- π¨ UI/UX Improvements: Enhance user interface and experience
- π§ͺ Testing: Add unit and integration tests
- π Documentation: Improve docs and add examples
- π Bug Fixes: Fix reported issues
- β¨ Features: Suggest and implement new features
- π§ Performance: Optimize code and improve performance
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Solace AI Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
If you're experiencing a mental health crisis, please reach out to:
- AASRA (24/7): π 9152987821
- iCALL Mental Health: π 9820466726
- National Health Helpline: π 104
- YourDOST (Students): π 8448440632
Note: Solace is not a replacement for emergency medical or mental health services. If you're in immediate danger, please contact your local emergency services.
Q: Is Solace free to use?
A: Yes, the basic features are free. Some premium features like 1-on-1 counseling may have associated costs.
Q: Is my data private?
A: Absolutely. We use industry-standard encryption and follow strict privacy policies. Your data is never shared with third parties.
Q: Can I use Solace anonymously?
A: Some features require an account, but you can use minimal information to sign up. We prioritize your privacy.
Q: Is Solace available in languages other than English?
A: We're working on multilingual support. Currently, resources are available in multiple languages.
Q: How accurate is the AI companion?
A: The AI is designed to provide empathetic support and general guidance, but it's not a replacement for professional therapy.
- OpenAI - For providing the GPT-3.5 API that powers our AI companion
- Firebase - For authentication and database services
- Express.js Community - For the robust web framework
- Mental Health Advocates - For inspiration and guidance
- Open Source Community - For the amazing tools and libraries
- Students Worldwide - For trusting us with your mental wellness journey
Current Version: 1.0.0
Status: β
Active Development
Last Updated: January 2026
- Mobile app (iOS/Android)
- Advanced analytics dashboard
- Video counseling sessions
- Group therapy sessions
- Multilingual AI support
- Integration with university systems
- Gamification and wellness challenges
- Peer mentoring program
Solace - Because your mental health matters.
β Star this repo if you find it helpful! β