PathCraft is an intelligent productivity platform that leverages AI and machine learning to help users break down complex goals into manageable tasks, optimize scheduling, and maintain motivation through adaptive reminders. Built with a modern Python backend and featuring advanced ML algorithms for personalized productivity optimization.
- AI-Powered Decomposition: Automatically break down large goals into actionable sub-goals and tasks
- Hierarchical Organization: Multi-level goal structure with parent-child relationships
- Progress Tracking: Visual progress indicators and milestone management
- ML-Based Optimization: Machine learning algorithms analyze user behavior patterns
- Adaptive Scheduling: Learn from productivity patterns to suggest optimal time slots
- Conflict Resolution: Smart conflict detection and resolution with existing calendar events
- Priority-Based Allocation: Automatically prioritize tasks based on deadlines and importance
- Behavioral Learning: Adapts reminder timing based on user response patterns
- Multi-Channel Delivery: Email, push notifications, and calendar integration
- Context-Aware: Sends reminders when users are most likely to be productive
- OKR Management: Set and track team objectives and key results
- Role-Based Access: Granular permissions for team members
- Progress Sharing: Real-time updates and collaborative goal tracking
- Productivity Metrics: Track completion rates, focus time, and efficiency
- Pattern Recognition: Identify optimal working hours and productivity windows
- Performance Reports: Detailed analytics for continuous improvement
PathCraft/
βββ backend/ # FastAPI Backend Server
β βββ api/ # REST API Endpoints
β βββ core/ # Core Business Logic
β βββ ml/ # Machine Learning Models
β βββ models/ # Database Models & Schemas
β βββ database.py # Database Configuration
βββ frontend/ # Frontend Components (Flutter/Dart)
βββ ml/ # ML Training & Models
βββ prototype/ # HTML/CSS/JS Prototype
βββ tests/ # Test Suite
βββ database/ # Database Migrations
- FastAPI: High-performance async web framework
- SQLAlchemy: ORM for database operations
- Pydantic: Data validation and serialization
- WebSocket: Real-time communication for live updates
- Enhanced Scheduler: Random Forest-based scheduling optimization
- Reminder Optimizer: Behavioral pattern learning for optimal notification timing
- Slot Optimizer: Time slot recommendation engine
- User Behavior Analysis: Pattern recognition for productivity optimization
git clone https://github.com/your-username/pathcraft.git
cd pathcraft
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install backend dependencies
pip install -r backend/requirements.txt
# Install development dependencies
pip install pytest pytest-asyncio httpx
# The application will automatically create SQLite database
# For production, you can configure PostgreSQL in database.py
# Start the FastAPI server
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
Your API will be available at:
- API Documentation: http://localhost:8000/docs
- Alternative Docs: http://localhost:8000/redoc
- Health Check: http://localhost:8000/health
# Open prototype/index.html in your browser
# Or serve it with a simple HTTP server:
python -m http.server 8080
# Then visit: http://localhost:8080/prototype/
# Run all tests
pytest
# Run tests with coverage
pytest --cov=backend
# Run specific test file
pytest tests/test_backend.py
# Run tests with verbose output
pytest -v
Endpoint | Method | Description |
---|---|---|
/api/users/ |
POST | User registration |
/api/token |
POST | User authentication |
/api/goals/ |
GET/POST | Goal management |
/api/sub_goals/ |
GET/POST | Sub-goal management |
/api/tasks/ |
GET/POST | Task management |
/api/teams/ |
GET/POST | Team management |
/api/notifications/ |
GET/POST | Notification system |
All protected endpoints require Bearer Token authentication:
curl -H "Authorization: Bearer <your_token>" \
http://localhost:8000/api/goals/
# Create a new user
curl -X POST "http://localhost:8000/api/users/" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "securepassword"}'
# Login and get token
curl -X POST "http://localhost:8000/api/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected]&password=securepassword"
# Create a goal
curl -X POST "http://localhost:8000/api/goals/" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{"title": "Learn Machine Learning", "target_date": "2024-12-31", "methodology": "Online courses and projects"}'
Create a .env
file in the project root:
# Database Configuration
DATABASE_URL=sqlite:///./pathcraft.db
# For PostgreSQL: postgresql://user:password@localhost/pathcraft
# Security
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
# ML Model Paths
SCHEDULER_MODEL_PATH=enhanced_scheduler_model.pkl
REMINDER_MODEL_PATH=reminder_optimizer_model.pkl
# External Services
CALENDAR_API_KEY=your-calendar-api-key
SLACK_WEBHOOK_URL=your-slack-webhook-url
The application supports both SQLite (development) and PostgreSQL (production):
# backend/database.py
SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./pathcraft.db")
-
Install Production Dependencies
pip install gunicorn uvicorn[standard]
-
Configure Environment Variables
export DATABASE_URL="postgresql://user:password@localhost/pathcraft" export SECRET_KEY="your-production-secret-key"
-
Run with Gunicorn
gunicorn backend.main:app -w 4 -k uvicorn.workers.UvicornWorker
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
We welcome contributions! Please follow these steps:
- 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
- Follow PEP 8 style guidelines
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
api/
: REST API endpoints for all featurescore/
: Core business logic and algorithmsml/
: Machine learning models and training scriptsmodels/
: Database models and Pydantic schemasdatabase.py
: Database connection and session management
frontend/lib/widgets/
: Flutter/Dart UI componentsprototype/
: HTML/CSS/JS prototype for rapid testing
ml/enhanced_scheduler.py
: AI-powered scheduling optimizationml/reminder_optimizer.py
: Smart reminder timingml/slot_optimizer.py
: Time slot recommendation engine
-
Database Connection Error
- Ensure SQLite file has write permissions
- Check database path in
database.py
-
Import Errors
- Verify virtual environment is activated
- Check Python path and dependencies
-
Port Already in Use
- Change port:
uvicorn backend.main:app --port 8001
- Kill existing process:
lsof -ti:8000 | xargs kill -9
- Change port:
- Check the API Reference
- Review test files for usage examples
- Open an issue on GitHub with detailed error information
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI community for the excellent web framework
- SQLAlchemy for robust database operations
- Scikit-learn for machine learning capabilities
- All contributors who help improve PathCraft
Ready to transform your productivity? Start with PathCraft today! π
For questions, support, or contributions, please open an issue or reach out to our team.