A comprehensive full-stack workload management tool designed for RAMS (Reliability, Availability, Maintainability, and Safety) Engineering teams in the railway industry.
No manual setup required! The application automatically:
- Waits for database to be ready
- Creates all database tables and triggers
- Seeds with realistic mock data
- Starts all services in the correct order
git clone https://github.com/LuisPuertollano/openhands2.git; cd openhands2; docker compose up -d --buildgit clone https://github.com/LuisPuertollano/openhands2.git && cd openhands2 && docker compose up -d --buildThen open: http://localhost:45679
β
Fully Automated Setup - no manual intervention needed!
β
Database is persistent - your data survives container restarts!
β
Intelligent Startup - automatic service orchestration and dependency management!
π Windows Guide: WINDOWS_DOCKER_DESKTOP.md
π Full Install Guide: INSTALL.md
π Port Configuration: PORT_CONFIGURATION.md
This system helps engineering teams manage and track resource allocation across safety-critical projects, ensuring optimal capacity utilization and compliance with RAMS standards.
- π Capacity Management: Real-time tracking of resource utilization with automatic capacity calculations
- π Budget Benchmarking: Compare planned vs. standard effort hours for work packages
- π³ Project Hierarchy: Intuitive tree-view navigation from Projects β Work Packages β Activities
- βοΈ Full CRUD Operations: Add, edit, and manage Resources, Projects, Work Packages, and Activities
- π Gantt Chart: Visual timeline of projects, work packages, and activities with multiple view modes
- πΌ Workload Report: Detailed breakdown of workload per resource per month per project with CSV export
- π Audit Trail: Automatic logging of all changes to work packages and resource assignments
- π Export Reports: Generate PDF, Excel, and CSV reports for capacity, budget, and workload analysis
β οΈ Intelligent Warnings: Automatic alerts for over-capacity resources and budget overruns
Backend:
- Node.js + Express
- PostgreSQL with advanced triggers and views
- RESTful API design
Frontend:
- React 18
- Recharts for data visualization
- React Router for navigation
- Axios for API communication
rams-workload-management/
βββ backend/
β βββ src/
β β βββ config/ # Database configuration
β β βββ models/ # Data models (Resource, Project, WorkPackage, Activity)
β β βββ controllers/ # Request handlers
β β βββ routes/ # API routes
β β βββ services/ # Business logic (Capacity calculations, Reports)
β β βββ server.js # Express server entry point
β βββ scripts/
β β βββ setup_database.js # Database initialization
β β βββ seed_database.js # Mock data generator
β β βββ test_capacity.js # Capacity validation script
β βββ schema.sql # PostgreSQL schema with triggers
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ dashboard/ # Capacity overview with heatmap
β β β βββ benchmarking/ # Budget comparison view
β β β βββ hierarchy/ # Project tree navigator
β β βββ services/ # API client
β β βββ utils/ # Helper functions
β β βββ styles/ # CSS styling
β βββ public/
β βββ package.json
βββ README.md
resources
- Stores engineering resources with contract hours (35h or 40h)
- Supports monthly availability overrides (JSONB for vacations)
projects
- Top-level project information with date ranges
work_packages
- Linked to projects
- Includes RAMS tags (FMECA, Hazard Log, SIL, etc.)
- Tracks standard effort hours
activities
- Links resources to work packages
- Tracks planned hours and date ranges
change_logs
- Automatic audit trail via PostgreSQL triggers
- Tracks changes to work packages and resource assignments
monthly_resource_utilization: Aggregates resource capacity usagework_package_budget_status: Real-time budget vs. actual comparison
Only Docker is required! No need to install Node.js or PostgreSQL.
- Docker Desktop (Download)
Linux/Mac:
./start.shWindows:
start.batThat's it! The script will:
- β Build all containers (PostgreSQL, Backend, Frontend)
- β Wait for PostgreSQL to be ready (automatic startup synchronization)
- β Initialize database automatically (no manual intervention required)
- β Seed with mock data (15 resources, 3 projects, 45+ activities)
- β Start all services
- β Open http://localhost:45679 in your browser
Zero Configuration Required! The setup is fully automated with intelligent startup orchestration.
# Start everything
docker compose up --build
# Run in background
docker compose up -d
# Stop everything
docker compose down
# Clean reset (removes all data)
docker compose down -vIf you prefer to work without Docker:
Prerequisites: Node.js 16+, PostgreSQL 14+
-
Backend:
cd backend npm install cp .env.example .env npm run db:setup npm run db:seed npm start -
Frontend:
cd frontend npm install npm start -
Access: http://localhost:45679
Monthly Capacity = (Contract Hours / 5) Γ Working Days in MonthExample:
- 40-hour contract, 22 working days in month
- Capacity = (40 / 5) Γ 22 = 176 hours
Utilization % = (Planned Hours / Monthly Capacity) Γ 100Status Thresholds:
- Over Capacity: > 100%
- At Capacity: 90-100%
- High Utilization: 70-90%
- Moderate Utilization: 40-70%
- Low Utilization: < 40%
Budget Status = Compare(SUM(Activity.planned_hours), WorkPackage.standard_effort_hours)Statuses:
- OVER_BUDGET: Planned > Standard
- AT_BUDGET: Planned = Standard
- UNDER_BUDGET: Planned < Standard
cd backend
npm run test:capacityThis script:
- Calculates capacity for all 15 mock resources
- Validates that planned hours don't exceed capacity
- Generates warnings for over-capacity situations
- Provides monthly utilization statistics
=======================================================================
Month: 2024-01
=======================================================================
β
Alice Johnson | Contract: 35h | Capacity: 154h | Planned: 120h | Utilization: 77.9% | Status: HIGH_UTILIZATION
β Bob Smith | Contract: 40h | Capacity: 176h | Planned: 185h | Utilization: 105.1% | Status: OVER_CAPACITY
GET /api/resources- List all resourcesGET /api/resources/:id- Get resource by IDGET /api/resources/capacity?year=2024&month=1- Get all resource capacity for monthPOST /api/resources- Create resourcePUT /api/resources/:id- Update resourceDELETE /api/resources/:id- Delete resource
GET /api/projects- List all projectsGET /api/projects/:id?include_work_packages=true- Get project with work packagesPOST /api/projects- Create projectPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete project
GET /api/work-packages- List all work packagesGET /api/work-packages/:id?include_activities=true- Get work package with activitiesGET /api/work-packages/budget-status- Get budget status for all WPsPOST /api/work-packages- Create work packagePUT /api/work-packages/:id- Update work package (triggers audit log)DELETE /api/work-packages/:id- Delete work package
GET /api/activities- List all activitiesGET /api/activities/resource/:resourceId- Get activities by resourceGET /api/activities/work-package/:wpId- Get activities by work packagePOST /api/activities- Create activityPUT /api/activities/:id- Update activity (triggers audit log)DELETE /api/activities/:id- Delete activity
GET /api/change-logs?limit=100- Get recent change logsGET /api/change-logs/:entityType/:entityId- Get logs for specific entityGET /api/change-logs/date-range?start_date=X&end_date=Y- Get logs by date range
GET /api/reports/capacity/excel?year=2024&month=1- Export capacity report (Excel)GET /api/reports/capacity/pdf?year=2024&month=1- Export capacity report (PDF)GET /api/reports/budget/excel- Export budget report (Excel)GET /api/reports/budget/pdf- Export budget report (PDF)GET /api/reports/rams-distribution/excel- Export RAMS distribution (Excel)
- Interactive Bar Chart: Visual comparison of capacity vs. planned hours
- Color-coded Status: Red (over), Orange (at), Yellow (high), Green (moderate/low)
- Monthly Selection: Navigate through different months
- Export Functions: Download Excel/PDF reports
- Capacity Warnings: Automatic alerts for over-capacity resources
- Edit Resources: Direct edit functionality with inline buttons
- Summary Cards: Quick stats on budget status
- Comparison Chart: Standard effort vs. planned hours
- Filterable Table: Filter by project and RAMS tag
- Variance Calculation: Shows over/under budget amounts and percentages
- Real-time Updates: Live tracking of budget status
- Tree View: Expandable project β work package β activity hierarchy
- Lazy Loading: Load work packages and activities on demand
- Visual Icons: Clear distinction between hierarchy levels
- Detail Display: Shows dates, effort hours, and RAMS tags
- Expand/Collapse All: Quick navigation controls
- Full Edit Capability: Edit projects, work packages, and activities directly from the tree view
- Timeline View: Visual representation of project schedules
- Multiple Views: Switch between Projects, Work Packages, and Activities views
- Interactive Bars: Hover to see detailed date ranges
- Color-coded Items: Easy visual distinction between different entity types
- Automatic Scaling: Timeline adjusts to fit all data
- Summary Statistics: Quick overview of projects and timeline range
- Matrix View: Resource Γ Month Γ Project breakdown
- Filterable: Filter by year, resource, or project
- Monthly Totals: Aggregated hours per month
- Resource Summaries: Total workload per resource
- Project Summaries: Total workload per project
- CSV Export: Download detailed workload data for external analysis
- Automatic logging of all modifications via PostgreSQL triggers
- Tracks changes to:
- Work package standard effort hours
- Work package RAMS tags
- Resource assignments
- Activity planned hours
{
"entity_type": "work_package",
"entity_id": 5,
"field_name": "standard_effort_hours",
"old_value": "150.00",
"new_value": "180.00",
"changed_at": "2024-01-15T10:30:00Z"
}- PDF Reports: Official workload statements
- Excel Reports: Detailed capacity and budget analysis
- RAMS Distribution: Resource allocation by discipline
- Time-stamped: All exports include generation date
The seeding script creates realistic test data:
- 15 Resources: Mix of 35h and 40h contracts
- 3 Projects: Multi-month railway projects
- 15 Work Packages: 5 per project with varied RAMS tags
- 45+ Activities: Random assignments to test capacity logic
- FMECA (Failure Mode, Effects, and Criticality Analysis)
- Hazard Log
- SIL (Safety Integrity Level)
- Risk Assessment
- Safety Case
# View logs
docker compose logs -f
# View specific service logs
docker compose logs -f backend
docker compose logs -f postgres
# Execute commands in containers
docker compose exec backend npm run test:capacity
docker compose exec postgres psql -U postgres -d rams_workload
# Restart a service
docker compose restart backend
# Rebuild after code changes
docker compose up --buildUsing Docker:
# Reset database
docker compose down -v
docker compose up --buildWithout Docker:
# Drop and recreate database
npm run db:setup
# Reseed data
npm run db:seed# Health check
curl http://localhost:45678/api/health
# Get all resources
curl http://localhost:45678/api/resources
# Get capacity data
curl "http://localhost:45678/api/resources/capacity?year=2024&month=1"
# Run capacity validation test
docker compose exec backend npm run test:capacity # Docker
# OR
cd backend && npm run test:capacity # TraditionalPORT=3000 # Internal container port (mapped to 45678 externally)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=rams_workload
DB_USER=postgres
DB_PASSWORD=postgresREACT_APP_API_URL=http://localhost:45678/api
PORT=3001 # Internal container port (mapped to 45679 externally)Note: The internal container ports (3000, 3001) are mapped to external ports (45678, 45679) to avoid conflicts.
This system follows best practices:
- Snake case for database naming
- Camel case for JavaScript/React
- RESTful API design
- Normalized database schema
- Component-based React architecture
MIT License - Built for RAMS Engineering Teams
For issues or questions:
- Check the API documentation above
- Review database schema in
backend/schema.sql - Run capacity validation:
npm run test:capacity - Check browser console and server logs
Built with β€οΈ for Railway Safety Engineering Teams