Track ยท Analyze ยท Improve
Features โข Quick Start โข Tech Stack โข Documentation โข Deployment
MindFlow is a modern full-stack web application designed to help individuals and teams track, analyze, and optimize daily productivity. Through intelligent time management, habit tracking, and AI-powered insights, everyone can become a productivity master.
- Data-Driven: Make decisions based on real data, not assumptions
- Habit-First: Achieve long-term goals through continuous small improvements
- Simple & Intuitive: Elegant interface design with zero learning curve
- Privacy-Protected: Your data stays under your control with self-hosting support
One-command start (requires Docker) git clone https://github.com/yourusername/mindflow.git cd mindflow docker-compose up -d
Access the app open http://localhost:5173
text
| Feature | Description | Status |
|---|---|---|
| โฑ๏ธ Time Tracking | Log activity category, duration, and productivity score | โ Complete |
| ๐ฅ Habit Tracking | Build healthy habits, track streaks and completion rates | โ Complete |
| ๐ฏ Goal Management | Set SMART goals with automatic progress tracking | โ Complete |
| ๐ Data Visualization | Multiple charts showing productivity trends and patterns | โ Complete |
| ๐ค AI Insights | OpenAI-powered intelligent analysis and recommendations (optional) | โ Complete |
| ๐ Dark Mode | Eye-friendly dark theme with instant toggle | โ Complete |
| ๐ฑ Responsive Design | Perfect for desktop, tablet, and mobile | โ Complete |
| ๐ Real-time Sync | Auto-save data without manual refresh | โ Complete |
- ๐ค Data Export (PDF/CSV/JSON)
- ๐ Pomodoro Timer Integration
- ๐ Smart Reminders and Notifications
- ๐ฅ Team Collaboration Features
- ๐ Calendar Integration
- ๐ Multi-language Support
- ๐ฒ Mobile App (React Native)
- ๐ User Authentication System
mindflow/ โโโ ๐ backend/ # Backend service โ โโโ main.py # FastAPI main app (259 lines) โ โโโ models.py # Data models & schemas โ โโโ ai_insights.py # AI analysis module โ โโโ requirements.txt # Python dependencies โ โโโ Dockerfile # Backend container config โ โโโ ๐ frontend/ # Frontend application โ โโโ src/ โ โ โโโ App.jsx # Root component โ โ โโโ components/ โ โ โ โโโ Dashboard.jsx # Dashboard (400 lines) โ โ โโโ api.js # API client โ โ โโโ main.jsx # Entry point โ โโโ index.html # HTML template โ โโโ package.json # Node dependencies โ โโโ vite.config.js # Vite config โ โโโ Dockerfile # Frontend container config โ โโโ docker-compose.yml # Docker orchestration โโโ .env.example # Environment variable template โโโ LICENSE # Apache 2.0 license โโโ README.md # Project documentation (this file)
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ UI Layer โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ โ Overview โ โ Activities โ โ Habits โ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ โ Goals โ โ Charts โ โ AI Insights โ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ React + Vite + TailwindCSS โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ API Layer โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ FastAPI RESTful API โ โ โ โ /activities /habits /goals /analytics โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Business Logic Layer โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ โ SQLAlchemy โ โ Pydantic โ โ OpenAI API โ โ โ โ ORM โ โ Validation โ โ AI Analysis โ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Data Persistence Layer โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ SQLite Database (extensible to PostgreSQL) โ โ โ โ activities | habits | goals | analytics โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.12+ | Programming Language |
| FastAPI | 0.122.0 | Web Framework |
| SQLAlchemy | 2.0.36 | ORM |
| Pydantic | 2.10.5 | Data Validation |
| Uvicorn | 0.32.0 | ASGI Server |
| OpenAI | 1.59.5 | AI Integration |
| SQLite | 3.x | Database |
| Technology | Version | Purpose |
|---|---|---|
| React | 18.2.0 | UI Framework |
| Vite | 5.0.0 | Build Tool |
| TailwindCSS | 3.x | CSS Framework |
| Recharts | 2.10.0 | Charting Library |
| Technology | Version | Purpose |
|---|---|---|
| Docker | Latest | Containerization |
| Docker Compose | Latest | Service Orchestration |
Choose your installation method:
- โ Docker >= 20.10
- โ Docker Compose >= 2.0
-
Clone the project git clone https://github.com/yourusername/mindflow.git cd mindflow
-
Configure environment (optional) cp .env.example .env
Edit .env to add your OpenAI API Key (if you want AI features) 3. Start all services docker-compose up -d
-
Check service status docker-compose ps
-
View logs docker-compose logs -f
-
Stop services docker-compose down
text
Backend:
Enter backend directory cd backend
Create virtual environment python -m venv venv
Activate virtual environment Linux/Mac: source venv/bin/activate
Windows: venv\Scripts\activate
Install dependencies pip install -r requirements.txt
Start backend service python main.py
Or use uvicorn uvicorn main:app --reload --host 0.0.0.0 --port 8000
text
Frontend:
New terminal, enter frontend directory cd frontend
Install dependencies npm install
or yarn install
Start dev server npm run dev
or yarn dev
text
Once running, visit:
- ๐ Frontend UI: http://localhost:5173
- ๐ง Backend API: http://localhost:8000
- ๐ API Docs: http://localhost:8000/docs (Swagger UI)
- ๐ Alternative Docs: http://localhost:8000/redoc (ReDoc)
Create activity POST /api/activities Content-Type: application/json
{ "category": "Work", "description": "Write project documentation", "duration": 60, "productivity_score": 8 }
Get activity list GET /api/activities?skip=0&limit=100
Get today's statistics GET /api/activities/today
text
Create habit POST /api/habits Content-Type: application/json
{ "name": "Morning reading", "target_frequency": 7 }
Get habit list GET /api/habits
Mark habit complete POST /api/habits/{habit_id}/complete
text
Create goal POST /api/goals Content-Type: application/json
{ "title": "Learn Python", "description": "Complete FastAPI course", "target_hours": 20, "deadline": "2025-12-31T23:59:59Z" }
Get goal list GET /api/goals
Update goal progress PUT /api/goals/{goal_id}/progress Content-Type: application/json
{ "hours": 2 }
text
Get weekly analytics GET /api/analytics/weekly
text
{ "id": 1, "category": "Work", # Category: Work/Learning/Exercise/Social/Entertainment/Chores "description": "Write code", # Description "duration": 60, # Duration (minutes) "productivity_score": 8.0, # Productivity score (1-10) "start_time": "2025-12-26T10:00:00Z" # Start time }
text
{ "id": 1, "name": "Morning meditation", # Habit name "target_frequency": 7, # Target frequency (times per week) "current_streak": 15, # Current streak (days) "best_streak": 30, # Best streak "last_completed": "2025-12-26T08:00:00Z" # Last completion time }
text
{ "id": 1, "title": "Complete project", # Goal title "description": "...", # Description "target_hours": 50, # Target hours "current_hours": 25, # Current hours logged "progress": 50.0, # Progress percentage "deadline": "2025-12-31T23:59:59Z", # Deadline "completed": false # Completion status }
text
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Log New Activity โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ Category: [Work โผ] โ โ Duration: minutes โ โ Description: [Write project docs] โ โ Productivity: โโโโโโโโโโ 8/10 โ โ โ โ [ Log Activity ] โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
Steps:
- Switch to "Activities" tab
- Select activity category
- Enter description and duration
- Slide to set productivity score (1-10)
- Click "Log Activity"
Tip: Log activities promptly for more accurate analysis.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Morning Reading ๐ฅ 15 โ โ 7x per week Best: 30 โ โ โ โ [โ Mark as Done Today] โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
Steps:
- Go to "Habits" tab
- Create new habit, set target frequency
- Click "Mark as Done Today" after completion each day
- Watch your streak grow
Tip: Consecutive completions earn the "fire" badgeโkeep the streak alive!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Complete Python Course 50% โ โ Master FastAPI 25/50hrs โ โ Due: 2025-12-31 โ โ โโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text
Steps:
- Open "Goals" tab
- Fill in goal title, description, target hours
- Set deadline
- System automatically tracks progress based on logged activities
Tip: Set specific, measurable goals for better results.
๐ Weekly Progress ๐ฅง Today's Distribution
Minutes Work 40% โฒ Learning 30% 120โ โ Exercise 20% 80โ โ โ Other 10% 40โโ โ โโโโโโโโโโโโโโ Mon Tue Wed Thu Fri
text
Features:
- ๐ Weekly time trends
- ๐ Category time distribution
- ๐ฏ Productivity score trends
- ๐ฅ Habit completion status
- ๐ Goal progress overview
Create a .env file and configure:
OpenAI API Configuration (optional - for AI insights) OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Database Configuration DATABASE_URL=sqlite:///./mindflow.db
PostgreSQL example: DATABASE_URL=postgresql://user:password@localhost:5432/mindflow API Server Configuration API_HOST=0.0.0.0 API_PORT=8000 API_RELOAD=true
Frontend Configuration VITE_API_URL=http://localhost:8000
Log Level LOG_LEVEL=INFO
CORS Configuration (restrict in production) CORS_ORIGINS=["http://localhost:5173"]
text
DATABASE_URL=sqlite:///./mindflow.db
text
-
Install PostgreSQL driver pip install psycopg2-binary
-
Update environment variable DATABASE_URL=postgresql://username:password@localhost:5432/mindflow
-
Create database createdb mindflow
text
-
Install MySQL driver pip install pymysql
-
Update environment variable DATABASE_URL=mysql+pymysql://username:password@localhost:3306/mindflow
text
- Visit OpenAI Platform
- Create an API key
- Add to
.envfile:
OPENAI_API_KEY=sk-your-api-key-here
text
Note: AI features are optional. MindFlow works fine without them.
Enter backend directory cd backend
Install test dependencies pip install pytest pytest-cov httpx
Run tests pytest
With coverage report pytest --cov=. --cov-report=html
View coverage report open htmlcov/index.html
text
Enter frontend directory cd frontend
Install test dependencies npm install --save-dev vitest @testing-library/react
Run tests npm test
With coverage npm test -- --coverage
text
Test API with curl Health check curl http://localhost:8000/
Create activity curl -X POST http://localhost:8000/api/activities -H "Content-Type: application/json" -d '{ "category": "Work", "description": "API test", "duration": 30, "productivity_score": 8 }'
Get today's stats curl http://localhost:8000/api/activities/today
text
-
Build production images docker-compose -f docker-compose.prod.yml build
-
Start services docker-compose -f docker-compose.prod.yml up -d
-
View logs docker-compose -f docker-compose.prod.yml logs -f
-
Scale services (load balancing) docker-compose -f docker-compose.prod.yml up -d --scale backend=3
text
/etc/nginx/sites-available/mindflow upstream backend { server localhost:8000; }
server { listen 80; server_name mindflow.example.com;
text
location / { root /var/www/mindflow/frontend/dist; try_files $uri $uri/ /index.html; }
location /api { proxy_pass http://backend; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
location /ws { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
text
/etc/systemd/system/mindflow-backend.service [Unit] Description=MindFlow Backend Service After=network.target
[Service] Type=simple User=www-data WorkingDirectory=/opt/mindflow/backend Environment="PATH=/opt/mindflow/backend/venv/bin" ExecStart=/opt/mindflow/backend/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000 Restart=always
[Install] WantedBy=multi-user.target
text
Install Vercel CLI npm i -g vercel
Deploy frontend cd frontend vercel --prod
text
Install Railway CLI npm i -g @railway/cli
Login and initialize railway login railway init
Deploy railway up
text
Create app heroku create mindflow-app
Add database heroku addons:create heroku-postgresql:hobby-dev
Deploy git push heroku main
text
โ Backend fails to start - ModuleNotFoundError
Cause: Python dependencies not installed correctly
Solution: cd backend pip install -r requirements.txt
If still failing, try upgrading pip pip install --upgrade pip pip install -r requirements.txt --force-reinstall
text
โ Frontend cannot connect to backend - Network Error
Cause: API address misconfigured or backend not running
Solution:
- Confirm backend is running:
curl http://localhost:8000 - Check
VITE_API_URLin.env - Clear browser cache and refresh
- Verify CORS configuration
โ Database error - sqlite3.OperationalError
Cause: Database file corrupted or permission issue
Solution: Delete old database rm backend/mindflow.db
Restart backend, database will be auto-created python backend/main.py
text
โ Docker container won't start
Cause: Port conflict or Docker configuration issue
Solution: Check port usage lsof -i :8000 lsof -i :5173
Stop and clean containers docker-compose down -v
Rebuild and start docker-compose up --build -d
View detailed logs docker-compose logs -f backend docker-compose logs -f frontend
text
โ AI features not working
Cause: OpenAI API key not configured or invalid
Solution:
- Check
OPENAI_API_KEYin.envfile - Verify API key is valid
- Check OpenAI account balance
- View backend logs for detailed error messages
Backend debug mode export LOG_LEVEL=DEBUG python backend/main.py
View detailed SQL queries export SQLALCHEMY_ECHO=True
Frontend debug mode npm run dev -- --debug
Docker log tracking docker-compose logs -f --tail=100
Inspect database contents sqlite3 backend/mindflow.db
.tables SELECT * FROM activities;
text
We welcome all forms of contributions!
- Fork the project
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
Format with Black pip install black black backend/
Sort imports with isort pip install isort isort backend/
Check with flake8 pip install flake8 flake8 backend/ --max-line-length=100
text
Format with Prettier npm install --save-dev prettier npx prettier --write frontend/src/
Check with ESLint npm install --save-dev eslint npx eslint frontend/src/
text
Use Conventional Commits standard:
feat: add new feature fix: fix bug docs: update documentation style: code formatting refactor: code refactoring test: add tests chore: build tools or dependency updates
text
Examples: feat(habits): add habit grouping feature fix(api): fix validation error on activity creation docs(readme): update installation instructions
text
This project is licensed under Apache License 2.0 - see LICENSE file for details
Copyright 2025 MindFlow Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
text http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
text
Thanks to these excellent open source projects:
- FastAPI - Modern, fast Web framework
- React - UI building library
- TailwindCSS - Utility-first CSS framework
- Recharts - React-based charting library
- SQLAlchemy - Python SQL toolkit
- Docker - Container platform
- RescueTime - Time tracking inspiration
- Habitica - Habit gamification
- Notion - Product design inspiration
- Todoist - Goal management patterns
- GitHub: @yourusername
- Email: your.email@example.com
- Twitter: @yourusername
- ๐ฌ GitHub Discussions - Questions and discussions
- ๐ GitHub Issues - Report bugs
- ๐ง Email: support@mindflow.app
- ๐ฌ Discord: Join community
- Basic time tracking
- Habit management
- Goal setting
- Data visualization
- AI insights (optional)
- Dark mode
- Responsive design
- Pomodoro timer
- Data export (PDF/CSV)
- Notification system
- Multi-language support
- Performance optimization
- User authentication system
- Team collaboration features
- Mobile app
- Calendar integration
- Third-party app integration
- Advanced data analytics
View full roadmap: ROADMAP.md
- FastAPI Complete Tutorial
- React Official Documentation
- TailwindCSS Documentation
- Docker Getting Started Guide
- SQLAlchemy ORM
Drive growth with data. Make every day count.
Get Started โข View Documentation โข Join Community
Made with โค๏ธ by MindFlow Contributors
ยฉ 2025 MindFlow. All rights reserved.