A mindful IDE extension that promotes wellbeing during AI coding downtime with guided breathing exercises.
MindfulIDE solves the problem of wasted downtime and mental fatigue during AI-assisted coding. Instead of context-switching to your phone during 1-5 minute inference gaps, MindfulIDE offers guided breathing exercises that help you stay focused, reduce stress, and return to coding with renewed energy.
- Pattern: Two inhales β Long exhale
- Duration: ~6 minutes (6 cycles)
- Purpose: Reduce stress and calm the nervous system
- Research: Based on physiological sigh technique proven to activate parasympathetic response
- Pattern: Rapid deep inhales β Slower exhales
- Duration: ~2 minutes (30 cycles)
- Purpose: Boost energy and mental alertness
- Similar to: Wim Hof breathing method
- Beautiful Animations: Smooth, calming breathing visualizations with Framer Motion
- Session Tracking: Automatic tracking of all mindfulness sessions
- Statistics Dashboard: Track your mindfulness journey with detailed stats
- Total sessions completed
- Total time spent being mindful
- Current and longest streaks
- Sessions by exercise type
- Downtime Detection: Smart idle detection suggests breathing exercises after 2 minutes
- Progress Tracking: Real-time cycle and time tracking during exercises
- React 18 with TypeScript
- Vite for fast development
- Tailwind CSS for styling
- Framer Motion for smooth animations
- Zustand for state management
- Axios for API calls
- Node.js with Express
- TypeScript for type safety
- SQLite with better-sqlite3 for session storage
- RESTful API design
MindfulIDE/
βββ frontend/ # React frontend
β βββ src/
β β βββ components/
β β β βββ BreathingCircle.tsx # Animated breathing visualization
β β β βββ BreathingExercise.tsx # Main exercise component
β β β βββ ExerciseSelector.tsx # Exercise selection UI
β β β βββ StatsDashboard.tsx # Statistics display
β β βββ hooks/
β β β βββ useBreathingCycle.ts # Breathing cycle logic
β β βββ utils/
β β β βββ api.ts # API client
β β βββ App.tsx # Main app component
β βββ package.json
β
βββ backend/ # Express backend
β βββ src/
β β βββ database/
β β β βββ db.ts # SQLite setup
β β βββ models/
β β β βββ Session.ts # Session data model
β β βββ routes/
β β β βββ sessions.ts # Session endpoints
β β β βββ stats.ts # Statistics endpoints
β β βββ index.ts # Express server
β βββ package.json
β
βββ shared/ # Shared types & constants
β βββ types/
β β βββ breathing.ts # TypeScript interfaces
β βββ constants/
β βββ breathingPatterns.ts # Exercise definitions
β
βββ package.json # Monorepo root
- Node.js 18+ and npm
- Git
-
Clone the repository
git clone <your-repo-url> cd MindfulIDE
-
Install dependencies
npm install cd frontend && npm install cd ../backend && npm install cd ..
-
Set up environment variables
cp frontend/.env.example frontend/.env cp backend/.env.example backend/.env
-
Run the application
# From root directory - runs both frontend and backend npm run devOr run separately:
# Terminal 1 - Backend (port 5000) cd backend && npm run dev # Terminal 2 - Frontend (port 3000) cd frontend && npm run dev
-
Open your browser
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000/api
POST /api/sessions- Create a new sessionPATCH /api/sessions/:id- Update a sessionGET /api/sessions/:id- Get session by IDGET /api/sessions- Get all sessions (limit query param)
GET /api/stats- Get aggregated statistics
GET /api/health- Health check endpoint
-
Select an exercise from the home screen
- Choose "Cyclic Sighing" for relaxation
- Choose "Cyclic Hyperventilation" for alertness
-
Click Start when ready
-
Follow the visual cues
- Circle expands during inhale
- Circle contracts during exhale
- Read on-screen instructions
-
Complete the session
- Progress bar shows current cycle
- Timer shows elapsed time
- Can pause/resume anytime
Click "View Stats" to see:
- Total mindfulness sessions completed
- Total time spent in mindfulness
- Current daily streak
- Longest streak achieved
- Breakdown by exercise type
- Average session duration
Pattern: Inhale (2s) β Inhale (2s) β Exhale (6s)
How it works:
- First inhale through nose (fill lungs 80%)
- Quick second inhale through nose (top off to 100%)
- Long, slow exhale through mouth (empty completely)
Benefits:
- Activates parasympathetic nervous system
- Reduces heart rate and blood pressure
- Decreases stress hormones (cortisol)
- Improves emotional regulation
Best for:
- After a stressful debugging session
- Before important code reviews
- When feeling overwhelmed
Pattern: Deep Inhale (1.5s) β Passive Exhale (2.5s)
How it works:
- Deep, rapid inhale through nose or mouth
- Let the exhale happen passively (don't force it)
- Repeat rapidly for 30 cycles
Benefits:
- Increases oxygen in blood
- Boosts adrenaline and energy
- Enhances mental clarity
- Improves focus and alertness
Best for:
- Early morning coding sessions
- After lunch energy dip
- Before tackling complex problems
# Frontend tests
cd frontend && npm test
# Backend tests
cd backend && npm test# Build both frontend and backend
npm run build
# Or separately
npm run build:frontend
npm run build:backendThe SQLite database is stored at backend/data/mindful.db and includes:
- Session history
- Exercise completion data
- Timestamps for streak calculation
- VS Code extension integration
- Real-time AI downtime detection hooks
- Audio cues and ambient sounds
- Custom breathing pattern creator
- Multi-user support with authentication
- Mobile app version
- Integration with other IDEs (JetBrains, Sublime)
- Biometric data integration (Apple Watch, Fitbit)
- Team/workplace mindfulness challenges
- Export data to CSV/JSON
This project was inspired by:
- Whoop: For their excellent breathing exercise implementations
- ChadIDE: For highlighting the downtime problem during AI coding
- Research: Neuroscience studies on breathing and stress reduction
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project however you'd like!
- Research on physiological sighs by Stanford's Huberman Lab
- Wim Hof Method for cyclic hyperventilation technique
- All developers struggling with AI coding downtime
Built with π§ by developers, for developers
Stay mindful, code better! π