MindHaven
Born in engineering dorms to solve real-world burn
Created on 11th April 2026
•
MindHaven
Born in engineering dorms to solve real-world burn
The problem MindHaven solves
Asynchronous AI: Enabled non-blocking journal saves by moving AI analysis to background threads.
API Resilience: Built a regex "Safety Net" to detect crises if the Gemini API fails or lags.
Stateless Auth: Switched from session cookies to JWT for better scalability and security.
Decoupled OAuth2: Bridged Google Login redirects between a Vue.js frontend and Spring backend.
Automated Alerting: Created an autonomous email workflow for emergency contact notifications.
CORS Resolution: Solved complex cross-origin headers between Netlify (Frontend) and Railway (Backend).
Environment Sync: Standardized .env usage to allow one-click switching from Local to Production.
Persistent Theming: Developed a CSS-token-based Dark/Light mode that stays saved on refresh.
Centralized State: Leveraged Pinia to manage user profiles, auth tokens, and global UI settings.
API Efficiency: Used Axios interceptors to automatically attach auth tokens to every request.
Production Monitoring: Integrated Spring Actuator for real-time health and memory tracking.
Gamified Logic: Built a backend algorithm to track and reward daily login streaks.
Responsive UI: Optimized a custom Glassmorphism layout for both mobile and desktop views.
Security Routing: Implemented Vue Router guards to prevent unauthorized access to private pages.
Data Validation: Ensured strict JPA entity mapping for secure storage of sensitive wellness data.
Logging & Debugging: Set up structured SLF4J logging to track AI classifications in production.
Crisis Fallback: Included global help resources for users when the AI detects extreme distress.
Challenges we ran into
Production Redirect URI Mismatch: Google OAuth2 login failed in production because the backend redirect URI registered in Google Console didn't match the new Railway domain.
Netlify vs. Vercel SPA Routing: After deploying the frontend, refreshing the page caused a "404 Not Found" error. We had to implement a netlify.toml / vercel.json rewrite rule to redirect all traffic to index.html.
Vite Environment Variable Prefixing: The production build was failing to connect to the API because Vite ignores all environment variables that don't start with VITE_, leading to "undefined" API URLs.
Case-Sensitivity on Linux Servers: Deployment failed because local Windows development is case-insensitive, but the Linux-based Railway server couldn't find files like authStore.js if the import statement had a lowercase a.
Railway Port Binding: The backend would frequently crash or timeout because it wasn't correctly picking up the dynamic $PORT variable assigned by the Railway environment.
Mismatched Java Versions: The build failed multiple times because the local machine used Java 21 while the deployment pipeline was defaulting to Java 11 or 17.
API Base URL Sanitization: Faced errors where API calls were failing due to double slashes (e.g., .../api//auth/me) caused by inconsistent trailing slashes in the deployment environment variables.
CORS Preflight in Production: Even after setting local CORS, the production environment required a more strict configuration to allow communication between the separate Vercel (frontend) and Railway (backend) domains.
Database Initial Connection Timeout: The Spring Boot backend would sometimes fail to start because the PostgreSQL container on Railway wasn't fully ready when the app tried to connect during the boot sequence.
Secret Management: Migrating secrets from a local .env to the Netlify and Railway dashboards without accidentally committing them to the public GitHub repository required careful audit.
Docker Layer Caching Errors: Rebuilding the Docker images for deployment sometimes failed due to corrupted build caches, requiring a complete "clean and build" cycle.
Technologies used