A comprehensive measurement phase application for the DMAIC (Define, Measure, Analyze, Improve, Control) cycle, specifically designed for petrochemical storage terminal operations while maintaining general applicability.
- AI-Powered Method Suggestions: Live OpenRouter/Claude API integration for personalized recommendations
- Method Customization: Complete 3-step workflow for customizing measurement methods with drag-drop interface
- Advanced Data Collection: Comprehensive forms with validation, auto-save, bulk entry, and import/export
- Analytics Dashboard: Interactive Chart.js visualizations with trend analysis and AI insights
- Comprehensive Method Library: 6 pre-built templates for petrochemical terminal and general manufacturing
- Multi-language Support: English and Dutch translations for international operations
- Real-time AI Guidance: Context-aware chatbot with OpenRouter/Claude integration
- Export Capabilities: JSON, CSV, and chart export for analysis phase integration
- Session Management: Full session tracking with timer, pause/resume, and data persistence
- HTML5 with semantic structure
- Tailwind CSS for responsive styling
- Chart.js for data visualization
- Vanilla JavaScript for application logic
- Context-aware AI chatbot integration
- Node.js/Express server with comprehensive middleware
- RESTful API architecture with full CRUD operations
- OpenRouter/Claude API integration with fallback support
- Advanced AI service layer for recommendations and insights
- In-memory storage (development) / Database ready (production)
- Helmet.js for security headers
- Rate limiting protection
- CORS configuration
- Request validation
- Compression middleware
- Node.js 16+ and npm 8+
- Modern web browser
- OpenRouter API key (optional, for AI features)
-
Clone and setup:
git clone <repository-url> cd dmaic-measurement-app npm install
-
Environment configuration:
copy .env.example .envEdit
.envwith your configuration values. -
Start development server:
npm run dev
-
Serve static files (alternative):
npm run serve
-
Access the application: Open
http://localhost:3001in your browser
# Development
npm run dev # Start with auto-reload
npm run serve # Serve static files only
# Production
npm start # Start production server
# Quality
npm run lint # Check code style
npm run lint:fix # Fix code style issues
npm test # Run tests
npm run build # Build and validate
# Docker
npm run docker:build # Build Docker image
npm run docker:run # Run in containerdmaic-measurement-app/
├── app/lib/ # Frontend JavaScript modules
│ ├── measure.js # Core measurement functionality
│ ├── measurement-methods.js # Method database and management
│ ├── auth.js # Authentication system
│ ├── session-handler.js # Session management
│ └── i18n.js # Internationalization
├── server/ # Backend Express application
│ ├── api/ # API route handlers
│ ├── data/ # Data files and schemas
│ └── index.js # Main server file
├── data/ # Client-side data storage
├── measure.html # Main application page
├── inject-chatbot.js # Chatbot integration
├── package.json # Dependencies and scripts
└── README.md # This file
GET /api/measurement-methods- List all methodsGET /api/measurement-methods/:id- Get specific methodPOST /api/measurement-methods/recommendations- Get AI recommendationsPOST /api/measurement-methods/:id/customize- Customize methodPOST /api/measurement-methods/validate- Validate measurement data
GET /api/measurement-data- Get measurement dataPOST /api/measurement-data- Store new measurementGET /api/measurement-data/:id- Get specific measurementPUT /api/measurement-data/:id- Update measurementDELETE /api/measurement-data/:id- Delete measurementGET /api/measurement-data/export- Export data (CSV/JSON)GET /api/measurement-data/stats- Get statistics
POST /api/chatbot/message- Send message to chatbotGET /api/chatbot/conversations/:id- Get conversation historyPOST /api/chatbot/analyze-context- Analyze project context
GET /api/define/projects- Get Define phase projectsGET /api/define/context- Get current project contextPOST /api/define/projects/:id/transition-to-measure- Transition to Measure
See .env.example for all available configuration options.
Configure OpenRouter API access for Claude AI suggestions:
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MODEL=anthropic/claude-3.5-sonnet
For production deployment, configure database connection:
DATABASE_URL=postgresql://user:password@localhost:5432/dmaic_measurement
DATABASE_TYPE=postgresql
- Tank cleaning time and motion studies
- Equipment utilization tracking
- Product quality and compliance measurements
- Safety and environmental monitoring
- Multi-product handling workflows
- Process cycle time analysis
- Defect rate and quality tracking
- Customer satisfaction measurement
- Statistical process control
- Resource utilization monitoring
- Import project goals and context
- Transition readiness assessment
- Stakeholder information
- Success criteria and constraints
- Structured measurement data export
- Statistical analysis preparation
- Data quality validation
- Baseline and trend data
- Input validation on all endpoints
- Rate limiting to prevent abuse
- CORS configuration for trusted origins
- Session management with timeouts
- Secure headers with Helmet.js
- No sensitive data in client-side code
- Gzip compression enabled
- Static file caching
- Database query optimization ready
- Frontend lazy loading
- Chart.js for efficient visualization
- Minimal JavaScript framework overhead
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
- Modern mobile browsers
- Follow existing code style and patterns
- Add tests for new functionality
- Update documentation for API changes
- Use semantic commit messages
- Test across supported browsers
MIT License - see LICENSE file for details
For technical support or feature requests, please create an issue in the project repository.
Note: This application is part of a larger DMAIC platform. Ensure integration with Define and Analysis phase applications for complete workflow support.