Skip to content

kisi-888-666/MindFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  MindFlow - Personal Productivity Analytics Dashboard

MindFlow Logo

Track ยท Analyze ยท Improve

Python FastAPI React License Docker

Features โ€ข Quick Start โ€ข Tech Stack โ€ข Documentation โ€ข Deployment


๐Ÿ“– Project Overview

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.

๐ŸŽฏ Core Principles

  • 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

โšก Quick Preview

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


โœจ Features

๐ŸŽฏ Core Features

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

๐Ÿš€ Coming Soon

  • ๐Ÿ“ค 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

๐Ÿ—๏ธ Project Architecture

File Structure

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

System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ 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


๐Ÿ’ป Tech Stack

Backend

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

Frontend

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

DevOps

Technology Version Purpose
Docker Latest Containerization
Docker Compose Latest Service Orchestration

๐Ÿš€ Quick Start

Prerequisites

Choose your installation method:

Option 1: Docker (Recommended) โœจ

Option 2: Local Development

Installation

๐Ÿณ Option 1: Docker One-Command Deploy (Recommended)

  1. Clone the project git clone https://github.com/yourusername/mindflow.git cd mindflow

  2. 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

  1. Check service status docker-compose ps

  2. View logs docker-compose logs -f

  3. Stop services docker-compose down

text

๐Ÿ› ๏ธ Option 2: Local Development Setup

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

Access the Application

Once running, visit:


๐Ÿ“– Project Documentation

API Endpoints

Activity Management

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

Habit Management

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

Goal Management

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

Analytics

Get weekly analytics GET /api/analytics/weekly

text

Data Models

Activity

{ "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

Habit

{ "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

Goal

{ "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


๐ŸŽฏ Usage Guide

1. Track Activities

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Log New Activity โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Category: [Work โ–ผ] โ”‚ โ”‚ Duration: minutes โ”‚ โ”‚ Description: [Write project docs] โ”‚ โ”‚ Productivity: โ”โ”โ”โ”โ”โ—โ”โ”โ”โ” 8/10 โ”‚ โ”‚ โ”‚ โ”‚ [ Log Activity ] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

text

Steps:

  1. Switch to "Activities" tab
  2. Select activity category
  3. Enter description and duration
  4. Slide to set productivity score (1-10)
  5. Click "Log Activity"

Tip: Log activities promptly for more accurate analysis.

2. Build Habits

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Morning Reading ๐Ÿ”ฅ 15 โ”‚ โ”‚ 7x per week Best: 30 โ”‚ โ”‚ โ”‚ โ”‚ [โœ“ Mark as Done Today] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

text

Steps:

  1. Go to "Habits" tab
  2. Create new habit, set target frequency
  3. Click "Mark as Done Today" after completion each day
  4. Watch your streak grow

Tip: Consecutive completions earn the "fire" badgeโ€”keep the streak alive!

3. Set Goals

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Complete Python Course 50% โ”‚ โ”‚ Master FastAPI 25/50hrs โ”‚ โ”‚ Due: 2025-12-31 โ”‚ โ”‚ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

text

Steps:

  1. Open "Goals" tab
  2. Fill in goal title, description, target hours
  3. Set deadline
  4. System automatically tracks progress based on logged activities

Tip: Set specific, measurable goals for better results.

4. View Analytics

๐Ÿ“Š 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

๐Ÿ”ง Configuration

Environment Variables

Create a .env file and configure:

=========================================== MindFlow Environment Configuration

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 Configuration

Using SQLite (Default)

DATABASE_URL=sqlite:///./mindflow.db

text

Switch to PostgreSQL

  1. Install PostgreSQL driver pip install psycopg2-binary

  2. Update environment variable DATABASE_URL=postgresql://username:password@localhost:5432/mindflow

  3. Create database createdb mindflow

text

Switch to MySQL

  1. Install MySQL driver pip install pymysql

  2. Update environment variable DATABASE_URL=mysql+pymysql://username:password@localhost:3306/mindflow

text

AI Configuration

  1. Visit OpenAI Platform
  2. Create an API key
  3. Add to .env file:

OPENAI_API_KEY=sk-your-api-key-here

text

Note: AI features are optional. MindFlow works fine without them.


๐Ÿงช Testing

Backend Testing

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

Frontend Testing

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

API Testing

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


๐Ÿšข Production Deployment

Docker Production Deployment

  1. Build production images docker-compose -f docker-compose.prod.yml build

  2. Start services docker-compose -f docker-compose.prod.yml up -d

  3. View logs docker-compose -f docker-compose.prod.yml logs -f

  4. Scale services (load balancing) docker-compose -f docker-compose.prod.yml up -d --scale backend=3

text

Nginx Configuration Example

/etc/nginx/sites-available/mindflow upstream backend { server localhost:8000; }

server { listen 80; server_name mindflow.example.com;

text

Frontend static files

location / { root /var/www/mindflow/frontend/dist; try_files $uri $uri/ /index.html; }

API proxy

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; }

WebSocket support (if needed)

location /ws { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }

text

Systemd Service Configuration

/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

Cloud Platform Deployment

Vercel (Frontend)

Install Vercel CLI npm i -g vercel

Deploy frontend cd frontend vercel --prod

text

Railway (Full Stack)

Install Railway CLI npm i -g @railway/cli

Login and initialize railway login railway init

Deploy railway up

text

Heroku (Full Stack)

Create app heroku create mindflow-app

Add database heroku addons:create heroku-postgresql:hobby-dev

Deploy git push heroku main

text


๐Ÿ› Troubleshooting

Common Issues

โŒ 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:

  1. Confirm backend is running: curl http://localhost:8000
  2. Check VITE_API_URL in .env
  3. Clear browser cache and refresh
  4. 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:

  1. Check OPENAI_API_KEY in .env file
  2. Verify API key is valid
  3. Check OpenAI account balance
  4. View backend logs for detailed error messages

Debugging Tips

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


๐Ÿค Contributing

We welcome all forms of contributions!

How to Contribute

  1. Fork the project
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

Code Standards

Python Code

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

JavaScript Code

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

Commit Message Convention

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


๐Ÿ“„ License

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


๐Ÿ™ Acknowledgments

Open Source Projects

Thanks to these excellent open source projects:

Inspiration Sources


๐Ÿ“ž Contact

Project Maintainer

Get Help

Community


๐Ÿ—บ๏ธ Roadmap

v1.0.0 (Current Version) โœ…

  • Basic time tracking
  • Habit management
  • Goal setting
  • Data visualization
  • AI insights (optional)
  • Dark mode
  • Responsive design

v1.1.0 (Planned) ๐Ÿšง

  • Pomodoro timer
  • Data export (PDF/CSV)
  • Notification system
  • Multi-language support
  • Performance optimization

v2.0.0 (Future) ๐Ÿ”ฎ

  • User authentication system
  • Team collaboration features
  • Mobile app
  • Calendar integration
  • Third-party app integration
  • Advanced data analytics

View full roadmap: ROADMAP.md


๐Ÿ“Š Project Stats

GitHub stars GitHub forks GitHub watchers

GitHub issues GitHub pull requests GitHub contributors GitHub last commit


๐Ÿ“š Related Resources

Learning Resources

Related Projects


โญ If this project helps you, please give us a Star!

Drive growth with data. Make every day count.

Get Started โ€ข View Documentation โ€ข Join Community


Made with โค๏ธ by MindFlow Contributors

ยฉ 2025 MindFlow. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors