A modern, full-stack project management web application designed for teams and businesses to efficiently track projects, manage clients, complete tasks, and log time. Built with a focus on speed, usability, and clean design.
- Multi-User Workspace: Collaborative environment with role-based access
- Client & Membership Tracking: Comprehensive client relationship management
- Project Organization: Hierarchical project structure with status tracking
- Smart Task System: Intuitive task creation with tagging and assignment
- Time & Cost Logging: Dual-mode logging (quick touch + detailed entries)
- Real-Time Dashboard: Activity feeds and progress tracking
- Advanced Analytics: Task completion trends and project performance metrics
- Responsive Interface: Optimized for desktop and mobile workflows
- Keyboard-Friendly: Streamlined data entry with smart autocomplete
- Backend Framework: Flask with SQLAlchemy ORM for robust data management
- Database: PostgreSQL with timezone support and migration capabilities
- Frontend Stack: Bootstrap 5 + Alpine.js for reactive components
- Design System: Custom CSS with consistent UI patterns
- API Layer: RESTful endpoints for dynamic content and integrations
├── Core Application # Main Flask app with routing and business logic
├── Data Layer # SQLAlchemy models with relationship mapping
├── Template System # Jinja2 templates with component architecture
├── Static Assets # CSS, JavaScript, and design system
├── API Endpoints # RESTful services for dynamic functionality
└── Configuration # Environment-based settings and deployment configs
- Relational Design: Normalized database schema with referential integrity
- Time-Zone Aware: Consistent temporal data handling across regions
- Migration Support: Version-controlled database schema evolution
- Performance Optimized: Efficient queries with proper indexing strategies
-
Clone the repository
git clone <repository-url> cd HubTracker
-
Create a virtual environment
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Database Setup
HubTracker uses PostgreSQL for all environments. You'll need to set up PostgreSQL locally or use a cloud database.
Local PostgreSQL Setup:
# Install PostgreSQL first (see PostgreSQL Setup section below) # Then run migrations: flask db upgrade
Cloud Database (Recommended):
- Use Render PostgreSQL service for production
- Use any PostgreSQL cloud service for development
- Set DATABASE_URL environment variable
- Run migrations: flask db upgrade
If you want sample data to explore features:
python init_db.py # Creates tables AND adds sample users/projects/tasks⚠️ Important: Only useinit_db.pyfor initial exploration. For real usage:- Use
flask db upgradefor first-time setup - Use migrations for all schema changes
- Never use
init_db.pyon a production database
-
Run the application
python app.py
-
Access the application
- Open your browser and go to
http://localhost:5000 - Create your first user account and start using the app
- Open your browser and go to
PostgreSQL is required for HubTracker. You can set it up locally or use a cloud service.
macOS:
brew install postgresql
brew services start postgresqlUbuntu/Debian:
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresqlWindows:
- Download from https://www.postgresql.org/download/windows/
- Install with default settings
-
Create Database User and Setup Database
# Connect to PostgreSQL # On macOS: psql postgres # On Linux: sudo -u postgres psql # Create user with password (replace 'your_password' with a secure password) CREATE USER hubtracker_user WITH PASSWORD 'your_password' CREATEDB; # Create database with proper ownership CREATE DATABASE hubtracker_dev OWNER hubtracker_user; # Grant necessary privileges GRANT ALL PRIVILEGES ON DATABASE hubtracker_dev TO hubtracker_user; # Set default privileges for future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO hubtracker_user; # Exit \q
If you need to reset the database at any point:
psql postgres -c "DROP DATABASE IF EXISTS hubtracker_dev;" psql postgres -c "CREATE DATABASE hubtracker_dev OWNER hubtracker_user;" psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE hubtracker_dev TO hubtracker_user;" psql postgres -c "ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO hubtracker_user;"
-
Create Environment File Create a
.envfile in your project root:FLASK_ENV=development SECRET_KEY=dev-secret-key-change-in-production DATABASE_URL=postgresql+psycopg://hubtracker_user:your_password@localhost:5432/hubtracker_dev
-
Install Dependencies and Initialize Database
pip install -r requirements.txt flask db upgrade # This will create all database tables python app.py
Note: On macOS, if you get connection errors, try removing the -h localhost flag when connecting with psql. If you get permission errors during migrations, make sure you've granted all the necessary privileges as shown in step 1.
HubTracker uses Flask-Migrate to manage database schema changes. Here's how to handle database changes:
-
Making Schema Changes
- Edit the models in
models.py - Generate a new migration:
flask db migrate -m "Description of your changes" - Review the generated migration in
migrations/versions/ - Apply the migration:
flask db upgrade
- Edit the models in
-
Common Migration Commands
flask db migrate -m "message" # Create a new migration flask db upgrade # Apply pending migrations flask db downgrade # Rollback last migration flask db history # View migration history flask db current # Show current revision
-
Best Practices
- Always review generated migrations before applying
- Commit migrations to version control
- Test migrations on development before production
- Back up production database before migrating
- Never delete migration files once they're in use
-
Troubleshooting If you encounter migration issues:
# View current database state flask db current # Force a specific revision flask db stamp <revision_id> # Show migration SQL flask db upgrade --sql
-
Starting Fresh (Clear All Migrations) If you need to completely reset your migration history and database:
# WARNING: This will delete all data and migration history! # 1. Stop the Flask application # 2. Drop and recreate your PostgreSQL database dropdb your_database_name createdb your_database_name # 3. Delete migration history rm -rf migrations/versions/* # 4. Reinitialize migrations (if migrations folder doesn't exist) flask db init # 5. Create initial migration from current models flask db migrate -m "Initial migration" # 6. Apply the migration to create fresh database flask db upgrade
When to use this:
- During development when migration history becomes messy
- When you want to consolidate many migrations into one
- When starting a new development environment
⚠️ NEVER use this in production - you will lose all data!
-
Fork/Clone to your GitHub
git clone <your-repo-url> cd HubTracker git add . git commit -m "Ready for deployment" git push origin main
-
Create Render Web Service
- Connect your GitHub repository
- Set Build Command:
pip install -r requirements.txt - Set Start Command:
python start.py - Set Environment:
python
-
Environment Variables (in Render Dashboard)
FLASK_ENV=production SECRET_KEY=your-secret-key-here DATABASE_URL=postgresql+psycopg://username:password@host:port/databaseNote: PostgreSQL is required for production deployment. Set up a PostgreSQL service in Render and use the provided connection string.
-
Database Setup
- The
start.pyscript automatically:- Creates the
instancedirectory if it doesn't exist - Checks if database migrations are needed
- Runs migrations only when necessary (safe for existing data)
- Starts the web server with gunicorn
- Creates the
- Your database is completely safe - the script never destroys existing data
- Your existing data will be preserved across deployments
- First user should be created through the web interface (only if no users exist)
- The
-
Troubleshooting Render Deployment
- Make sure gunicorn is in your requirements.txt
- Check Render logs for detailed error messages
- Ensure your repository is properly connected and up to date
-
Create PostgreSQL Service in Render
- Go to your Render dashboard
- Click "New" → "PostgreSQL"
- Choose your plan and region
- Note the connection details
-
Update Environment Variables Add the PostgreSQL connection string to your web service:
FLASK_ENV=production SECRET_KEY=your-secret-key-here DATABASE_URL=postgresql+psycopg://username:password@host:port/database -
Deploy
- The
start.pyscript will automatically detect PostgreSQL and use it - Migrations will run automatically on first deployment
- Your data will be persistent and backed up by Render
- The
Heroku:
git push heroku main
heroku run flask db upgrade # Initialize databaseDigitalOcean App Platform:
- Set build command:
pip install -r requirements.txt - Set run command:
python app.py - Add environment variables in dashboard
-
Production Environment
export FLASK_ENV=production export SECRET_KEY=your-secret-key-here export DATABASE_URL=postgresql+psycopg://user:pass@localhost/hubtracker
-
Initialize Database
flask db upgrade # Uses migrations to set up PostgreSQL tables -
Run with Gunicorn
pip install gunicorn gunicorn -w 4 -b 0.0.0.0:5000 app:app
| Variable | Description | Default | Required |
|---|---|---|---|
FLASK_ENV |
Environment mode | development |
No |
SECRET_KEY |
Flask secret key | Random | Yes (Production) |
DATABASE_URL |
PostgreSQL connection string | None | Yes |
PORT |
Server port | 5000 |
No |
For existing deployments with schema changes:
flask db upgrade # Apply new migrationsImportant: Never use python init_db.py in production - it will overwrite your data with sample data!
- Modular Architecture: Clean separation of concerns for easy feature additions
- Component System: Reusable UI components and templates
- API-First Design: Backend services designed for integration and extension
- Configuration Management: Environment-based settings for different deployment contexts
- Hot Reloading: Automatic server restart during development
- Debug Mode: Comprehensive error reporting and interactive debugging
- Migration Support: Database schema versioning and rollback capabilities
- Testing Framework: Unit and integration testing infrastructure
- Session Management: Secure user authentication and authorization
- Data Validation: Input sanitization and validation at multiple layers
- CSRF Protection: Cross-site request forgery prevention
- SQL Injection Prevention: Parameterized queries via SQLAlchemy ORM
- Environment Configuration: Secure credential management
- HTTPS Support: SSL/TLS encryption for data in transit
- Error Handling: Graceful failure modes and user feedback
- Performance Optimization: Efficient database queries and caching strategies
We welcome contributions that improve functionality, performance, or user experience. Please ensure all changes include appropriate testing and documentation.
For technical discussions and feature requests, please use the repository's issue tracking system.