MindBloom is a production-ready, gamified mental health tracking application that helps users maintain their mental well-being through journaling, challenges, and achievements.
- Daily Logs and Habit Tracking: Guided journaling interface with mood tracking and customizable tags
- Real-time Challenge Rooms: Public or private daily wellness challenges with Socket.io
- Visual Progress Dashboard: Interactive charts and mood/habit trends
- XP & Levelling System: Earn points through engagement and streaks
- Achievements and Badges: Unlock milestones for streaks and gratitude practice
- Responsive Design: Clean, consistent UI that works on all devices
- Production Ready: Comprehensive error handling, authentication, and data validation
- Frontend: React 18, Vite, React Router, Context API
- Backend: Node.js, Express.js, Socket.io
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Styling: Custom CSS with CSS variables and responsive design
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn
-
Clone and setup the project:
git clone https://github.com/yourusername/mindbloom.git cd mindbloom npm run setup # Installs dependencies for both frontend and backend
-
Configure environment variables:
Create
.envin the root directory:# Frontend API URL VITE_API_URL=http://localhost:5000/api # JWT Secret (use a strong secret in production) JWT_SECRET=your_super_secret_jwt_key_here # MongoDB Connection MONGODB_URI=mongodb://localhost:27017/mindbloom # Server Configuration PORT=5000 NODE_ENV=development
Create
server/.env:# MongoDB Connection (can be Atlas URI) MONGODB_URI=mongodb://localhost:27017/mindbloom # JWT Secret JWT_SECRET=your_super_secret_jwt_key_here # Server Configuration PORT=5000 NODE_ENV=development
-
Start the application:
# Start both frontend and backend concurrently npm run dev:full # OR start them separately: # Terminal 1 - Backend npm run server:dev # Terminal 2 - Frontend npm run dev
-
Open your browser: Navigate to
http://localhost:5173
Test the server functionality:
npm run test:serverThis will run automated tests to verify:
- Database connection
- User registration and authentication
- API endpoints
- Journal functionality
- Achievement system
mindbloom/
├── public/ # Static assets
├── server/ # Backend application
│ ├── middleware/ # Auth and other middleware
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API route handlers
│ ├── sockets/ # Socket.io configuration
│ └── index.js # Server entry point
├── src/ # Frontend application
│ ├── components/ # Reusable UI components
│ │ └── layout/ # Layout components
│ ├── contexts/ # React Context providers
│ ├── pages/ # Page components
│ ├── services/ # API service layer
│ ├── styles/ # Global styles and components
│ ├── App.jsx # Main App component
│ └── main.jsx # React entry point
├── .env # Frontend environment variables
├── test-server.js # Server testing script
└── package.json # Project dependencies and scripts
# Development
npm run dev # Start frontend development server
npm run server:dev # Start backend with nodemon
npm run dev:full # Start both frontend and backend
# Production
npm run build # Build frontend for production
npm run start # Build and start production server
npm run server # Start production backend server
# Testing & Utilities
npm run test:server # Test server functionality
npm run lint # Run ESLint
npm run setup # Install all dependenciesPOST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current userPUT /api/auth/profile- Update user profileGET /api/auth/stats- Get user statistics
POST /api/journal- Create journal entryGET /api/journal- Get user's journal entriesGET /api/journal/stats/mood- Get mood statisticsGET /api/journal/stats/streak- Get journaling streak
GET /api/achievements- Get user achievementsPOST /api/achievements/initialize- Initialize default achievementsPOST /api/achievements/:id/claim-reward- Claim achievement reward
GET /api/challenges- Get challenges (with filters)POST /api/challenges- Create new challengePOST /api/challenges/:id/join- Join a challengeGET /api/challenges/user/active- Get user's active challenges
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Accessibility: WCAG compliant with proper focus management and screen reader support
- Dark Mode Support: Respects user's system preference
- Consistent Styling: Unified design system with CSS variables
- Loading States: Proper loading indicators and error handling
- Optimistic Updates: Immediate UI feedback for better user experience
- JWT-based authentication with secure token handling
- Password hashing with bcrypt
- Input validation and sanitization
- CORS configuration for production
- Environment variable protection
- Error handling without sensitive data exposure
-
Environment Setup:
- Set
NODE_ENV=production - Use strong JWT secrets
- Configure MongoDB Atlas or production database
- Set up proper CORS origins
- Set
-
Build and Deploy:
npm run build npm run start
-
Recommended Production Setup:
- Use PM2 for process management
- Set up reverse proxy with Nginx
- Enable HTTPS with SSL certificates
- Configure database backups
- Set up monitoring and logging
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with modern web technologies and best practices
- Designed for scalability and maintainability
- Focused on user experience and accessibility
- Production-ready with comprehensive testing