**Motivations :** * Allow associating administrative procedures to module components with status tracking * Centralize regulation characteristics configuration for better data consistency * Link regulation characteristics to wastes, regulators, ecosystems, and module components **Root causes :** * Need to track administrative procedures per module component * Regulation characteristics were hardcoded in multiple places, causing inconsistency * No centralized way to manage and reference regulation characteristics **Correctifs :** * Added ModuleComponentProcedureAssociation interface with procedureId, status, and notes * Created RegulationCharacteristic entity with name, code, category, description, unit, isBoolean, minValue, maxValue * Added regulationCharacteristicIds field to Waste, NaturalRegulator, Ecosystem, and ModuleComponent * Updated all configuration pages to use regulation characteristics from centralized configuration * Created RegulationCharacteristicsConfigurationPage for managing characteristics * Added seeds for regulation characteristics (31 characteristics covering all categories) * Added seeds for companies (4NK Water & Waste default company) **Evolutions :** * Module components can now have associated administrative procedures with status (toDo, done, na) * Regulation characteristics are now centralized and can be referenced by multiple entities * All regulation needs and characteristics are now managed through a single configuration page * Business plans can be added to all entities (already implemented, documented in data_schemas.md) * Updated data_schemas.md with complete documentation of all entities, relations, and validation rules **Page affectées :** * src/pages/configuration/ModuleComponentsConfigurationPage.tsx - Added administrative procedures section * src/pages/configuration/RegulationCharacteristicsConfigurationPage.tsx - New page for managing characteristics * src/pages/configuration/WasteConfigurationPage.tsx - Updated to use regulation characteristics * src/pages/configuration/RegulatorsConfigurationPage.tsx - Updated to use regulation characteristics * src/pages/configuration/EcosystemsConfigurationPage.tsx - Updated to use regulation characteristics * src/types/index.ts - Added new interfaces and fields * src/utils/storage.ts - Added regulation characteristics and companies to storage * data_schemas.md - Complete documentation update * data/seeds/regulation-characteristics-seeds.json - New seed file * data/seeds/companies-seeds.json - New seed file
4NK Waste & Water - Simulator
Modular waste treatment infrastructure simulator for 4NK Waste & Water.
Technology Stack
- React (latest version)
- TypeScript
- React Router (for routing)
- Vite (development server only, no build tool for production)
- No state management library (use React useState, useContext)
Development
Prerequisites
- Node.js (latest LTS version)
- npm, yarn, or pnpm
Installation
npm install
# or
yarn install
# or
pnpm install
Run Development Server
npm run dev
# or
yarn dev
# or
pnpm dev
The application will be available at http://localhost:3000
Important: The application can only be accessed from localhost (127.0.0.1). Access from other hosts will be blocked.
Project Structure
/src
/components
/base # Base reusable components
/composite # Composite components
/layout # Layout components (Header, Sidebar)
/shared # Shared business logic components
/pages # Page components
/hooks # Custom React hooks
/utils
/calculations # Calculation functions
/formatters # Data formatting
/validators # Validation functions
/constants # Constants and default values
/types # TypeScript type definitions
/data # Seed data (optional)
Features
- Waste configuration
- Natural regulators configuration
- Services configuration
- Project management
- Treatment sites management
- Waste sites management
- Investors management
- Administrative procedures
- Yields calculation and display
- Business plan with 10-year projections
- Data export/import (JSON)
Data Storage
All data is stored locally in the browser using localStorage. No backend is required.
- Storage key:
4nkwaste_simulator_data - User session:
4nkwaste_simulator_user - Data format: JSON
Documentation
- Specification:
specification.md - Data Schemas:
data_schemas.md - Formulas Reference:
formulas_reference.md - User Workflow:
user_workflow.md - Constants:
constants.ts
License
Private project - 4NK Waste & Water
Description
Languages
TypeScript
88.3%
CSS
10.6%
Python
1%