Add comprehensive Docker deployment and file upload functionality

Features Added:
• Docker containerization with multi-stage Python 3.12 build
• Caddy reverse proxy integration with automatic SSL
• File upload interface for .claude.json imports with preview
• Comprehensive hook system with 39+ hook types across 9 categories
• Complete documentation system with Docker and import guides

Technical Improvements:
• Enhanced database models with hook tracking capabilities
• Robust file validation and error handling for uploads
• Production-ready Docker compose configuration
• Health checks and resource limits for containers
• Database initialization scripts for containerized deployments

Documentation:
• Docker Deployment Guide with troubleshooting
• Data Import Guide with step-by-step instructions
• Updated Getting Started guide with new features
• Enhanced documentation index with responsive grid layout

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ryan Malloy 2025-08-11 08:02:09 -06:00
parent bec1606c86
commit 50c80596d0
36 changed files with 4334 additions and 172 deletions

214
README.md
View file

@ -1,146 +1,116 @@
# Claude Code Project Tracker
# Claude Code Hook Configurations
A comprehensive development intelligence system that tracks your Claude Code sessions, providing insights into your coding patterns, productivity, and learning journey.
This directory contains various pre-configured hook setups for different use cases:
## Overview
## Available Configurations
The Claude Code Project Tracker automatically captures your development workflow through Claude Code's hook system, creating a detailed record of:
### basic.json
Essential hooks for basic session and tool tracking.
- Session management
- Tool calls
- File modifications
- Conversations
- **Development Sessions** - When you start/stop working, what projects you focus on
- **Conversations** - Full dialogue history with Claude for context and learning analysis
- **Code Changes** - File modifications, tool usage, and command executions
- **Thinking Patterns** - Wait times between interactions to understand your workflow
- **Git Activity** - Repository changes, commits, and branch operations
- **Productivity Metrics** - Engagement levels, output quality, and learning velocity
### comprehensive.json
Complete hook setup with all available hook types.
- All performance monitoring
- Code quality tracking
- Learning analytics
- Collaboration insights
- Project intelligence
## Architecture
### essential.json
Minimal setup for core functionality.
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Claude Code │───▶│ Hook System │───▶│ FastAPI Server │
│ (your IDE) │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web Dashboard │◀───│ Analytics │◀───│ SQLite Database │
│ │ │ Engine │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
### developer.json
Focused on development workflow and code quality.
- Essential hooks
- Performance monitoring
- Code quality checks
### Components
### power_user.json
Advanced setup for productivity optimization.
- Essential hooks
- Performance tracking
- Workflow analysis
- Project intelligence
- **FastAPI Server**: REST API that receives hook data and serves analytics
- **SQLite Database**: Local storage for all tracking data
- **Hook Integration**: Claude Code hooks that capture development events
- **Analytics Engine**: Processes raw data into meaningful insights
- **Web Dashboard**: Interactive interface for exploring your development patterns
### research.json
Optimized for learning and exploration.
- Essential hooks
- Learning tracking
- External resource usage
- Knowledge gap analysis
## Key Features
### team.json
Team-focused configuration for collaboration.
- Essential hooks
- Collaboration tracking
- Testing workflows
- Project intelligence
### 🎯 Session Tracking
- Automatic project detection and session management
- Working directory and git branch context
- Session duration and engagement analysis
## Installation
### 💬 Conversation Intelligence
- Full dialogue history with semantic search
- Problem-solving pattern recognition
- Learning topic identification and progress tracking
1. Choose the configuration that matches your needs
2. Copy the JSON content to your Claude Code settings file:
- macOS/Linux: `~/.config/claude/settings.json`
- Windows: `%APPDATA%\claude\settings.json`
3. Ensure Claude Code Tracker is running on port 8000
4. Start using Claude Code - hooks will automatically track your activity!
### 📊 Development Analytics
- Productivity metrics and engagement scoring
- Tool usage patterns and optimization insights
- Cross-project learning and code reuse analysis
## Available Hook Variables
### 🔍 Advanced Insights
- Think time analysis and flow state detection
- Git activity correlation with conversations
- Skill development velocity tracking
- Workflow optimization recommendations
Each hook can use these variables that Claude Code provides:
## Data Privacy
### Session Variables
- `$SESSION_ID` - Current session identifier
- `$TIMESTAMP` - Current timestamp (ISO format)
- `$PWD` - Current working directory
- `$USER` - System username
- **Local-First**: All data stays on your machine
- **No External Services**: No data transmission to third parties
- **Full Control**: Complete ownership of your development history
- **Selective Tracking**: Configurable hook activation per project
### Tool Variables
- `$TOOL_NAME` - Name of tool being called
- `$TOOL_PARAMS` - Tool parameters (JSON)
- `$RESULT_STATUS` - Success/error status
- `$EXECUTION_TIME` - Tool execution time (ms)
- `$ERROR_TYPE` - Type of error
- `$ERROR_MESSAGE` - Error message
- `$STACK_TRACE` - Error stack trace
## Quick Start
### File Variables
- `$FILE_PATH` - Path to modified file
- `$ACTION` - File action (created/modified/deleted)
- `$FILE_SIZE_MB` - File size in megabytes
1. **Install Dependencies**
```bash
pip install -r requirements.txt
```
### Context Variables
- `$CONTENT` - Conversation content
- `$CONTEXT` - Current context description
- `$SEARCH_QUERY` - What you're searching for
- `$NEW_PROJECT` - Project being switched to
- `$OLD_PROJECT` - Project being switched from
2. **Start the Tracking Server**
```bash
python main.py
```
### Performance Variables
- `$MEMORY_MB` - Memory usage in MB
- `$DURATION_MS` - Duration in milliseconds
- `$THRESHOLD_EXCEEDED` - Boolean for threshold alerts
3. **Configure Claude Code Hooks**
```bash
# Add hooks to your Claude Code settings
cp config/claude-hooks.json ~/.config/claude-code/
```
And many more! Each hook type has specific variables available.
4. **Access Dashboard**
```
Open http://localhost:8000 in your browser
```
## Customization
## Project Structure
You can modify any configuration by:
1. Adding/removing specific hooks
2. Changing API endpoints or ports
3. Adjusting timeout and retry settings
4. Adding custom metadata to hook calls
```
claude-tracker/
├── README.md # This file
├── requirements.txt # Python dependencies
├── main.py # FastAPI application entry point
├── config/ # Configuration files
│ └── claude-hooks.json # Hook setup for Claude Code
├── app/ # Application code
│ ├── models/ # Database models
│ ├── api/ # API endpoints
│ ├── analytics/ # Insights engine
│ └── dashboard/ # Web interface
├── tests/ # Test suite
├── docs/ # Detailed documentation
└── data/ # SQLite database location
```
## Troubleshooting
## Documentation
If hooks aren't working:
1. Ensure Claude Code Tracker server is running
2. Check that curl is installed
3. Verify the API endpoints are accessible
4. Check Claude Code logs for hook execution errors
5. Test individual hooks manually with curl
- [API Specification](docs/api-spec.yaml) - Complete endpoint documentation
- [Database Schema](docs/database-schema.md) - Data model details
- [Hook Setup Guide](docs/hook-setup.md) - Claude Code integration
- [Development Guide](docs/development.md) - Local setup and contribution
- [Analytics Guide](docs/analytics.md) - Understanding insights and metrics
## Development
See [Development Guide](docs/development.md) for detailed setup instructions.
```bash
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest
# Start development server with hot reload
uvicorn main:app --reload
# Generate API documentation
python -m app.generate_docs
```
## Contributing
This project follows test-driven development. Please ensure:
1. All new features have comprehensive tests
2. Documentation is updated for API changes
3. Analytics insights are validated with test data
## License
MIT License - See LICENSE file for details
For more help, see the documentation at `/dashboard/docs/hook-setup`.