🛡️ Digital HSE is a comprehensive Health, Safety, and Environment management system built for educational institutions, specifically designed for The British School Jakarta. This system provides a complete platform for managing incidents, risk assessments, permits, compliance, and training records.
- Incident Management: Report, track, and investigate safety incidents
- Risk Assessment: Identify and evaluate workplace hazards
- Permit to Work: Manage work permits for high-risk activities
- Compliance Tracking: Monitor regulatory compliance requirements
- Training Records: Track safety training and certifications
- Modern Architecture: Clean Architecture with Domain-Driven Design (DDD)
- Full-Stack Solution: .NET 8 backend with React TypeScript frontend
- Database: PostgreSQL 17 with Entity Framework Core
- Authentication: JWT-based authentication with role-based access
- Real-time Updates: SignalR for live notifications
- Multi-language: Support for English and Bahasa Indonesia
- Responsive UI: CoreUI React framework for modern, mobile-friendly interface
- .NET 8 SDK
- Node.js 18+ and npm
- Docker and Docker Compose
- PostgreSQL 17 (or use Docker)
- Clone the repository:
git clone https://github.com/yourusername/digital-hse.git
cd digital-hse- Start all services with Docker Compose:
docker-compose up -d- Run database migrations:
dotnet ef database update --project DigitalHSE.Infrastructure --startup-project DigitalHSE.Web- Access the application:
- Web Application: http://localhost:5228
- React Dev Server: http://localhost:3000 (for development)
- PgAdmin: http://localhost:5050
- Swagger API: http://localhost:5228/swagger
If you're running the application in WSL2 and need to access it from other devices on your network, you'll need to set up port forwarding:
# Forward port 5000 from host to WSL2 instance
netsh interface portproxy add v4tov4 listenport=5000 listenaddress=0.0.0.0 connectport=5000 connectaddress=172.18.214.238Purpose: This command creates a port proxy that forwards traffic from port 5000 on all network interfaces (0.0.0.0) of your Windows host to port 5000 on the WSL2 virtual machine (IP: 172.18.214.238). This allows:
- External Access: Other devices on your network can access the application using your Windows machine's IP address
- Mobile Testing: Test the responsive UI on mobile devices connected to the same network
- Team Development: Allow team members to access your development instance for testing
Note: Replace 172.18.214.238 with your actual WSL2 IP address. You can find it by running ip addr show eth0 in WSL2 or wsl hostname -I in Windows PowerShell.
To remove the port forwarding when no longer needed:
netsh interface portproxy delete v4tov4 listenport=5000 listenaddress=0.0.0.0- Open your browser and navigate to http://localhost:5050
- Login with:
- Email:
[email protected] - Password:
admin123
- Email:
- To connect to the PostgreSQL database:
- Click "Add New Server"
- General Tab:
- Name:
DigitalHSE(or any name you prefer)
- Name:
- Connection Tab:
- Host:
digitalhse.db(Docker service name) - Port:
5432 - Maintenance database:
postgres - Username:
postgres - Password:
postgres
- Host:
- Click "Save"
- Install frontend dependencies:
cd DigitalHSE.Web/ClientApp
npm install- Run the application (multiple options):
Option A: Default Development (auto-builds React)
cd DigitalHSE.Web
dotnet run
# React app automatically built and served at http://localhost:5000Option B: Fast Development (skip React build for faster startup)
cd DigitalHSE.Web
dotnet run -p:BuildReactApp=false
# API only at http://localhost:5000/swaggerOption C: Separate Frontend/Backend Development (best for active UI development)
# Terminal 1: Run .NET backend (API only)
cd DigitalHSE.Web
dotnet run -p:BuildReactApp=false
# Terminal 2: Run React dev server with hot reload
cd DigitalHSE.Web/ClientApp
npm start
# React app with hot reload at http://localhost:3000Option D: Force React Build (even in Release mode)
cd DigitalHSE.Web
dotnet run -c Release -p:BuildReactApp=true- Seed test users:
curl -X POST http://localhost:5000/api/seed/users| Mode | React Build | Startup Speed | Use Case |
|---|---|---|---|
Default (dotnet run) |
✅ Auto | Medium | General development |
Fast (-p:BuildReactApp=false) |
❌ Skip | Fast | Backend-only changes |
Separate (npm start + backend) |
❌ Skip | Fast | Active UI development |
Force (-p:BuildReactApp=true) |
✅ Always | Medium | Testing production build |
- Admin: admin / admin123
- HSE Manager: hsemanager / hse123
- HSE Officer: hseofficer / hse123
- Teacher: teacher / teacher123
- Student: student / student123
- Domain Layer: Core business entities and interfaces
- Application Layer: Use cases, CQRS commands/queries, business logic
- Infrastructure Layer: Data access, external services, persistence
- Web Layer: REST API endpoints and React SPA
- Backend: .NET 8, Entity Framework Core, Dapper
- Frontend: React 18, TypeScript, CoreUI
- Database: PostgreSQL 17
- Caching: Redis
- Message Queue: RabbitMQ
- Logging: Elasticsearch + Kibana
- Monitoring: Prometheus + Grafana
- Containerization: Docker & Docker Compose
- API Documentation: Available at
/swaggerwhen running the application - Architecture Guide: See
CLAUDE.mdfor detailed architecture documentation - Database Schema: Check migrations in
DigitalHSE.Infrastructure/Migrations
The complete stack includes:
- PostgreSQL: Primary database (port 5432)
- PgAdmin: Database management UI (port 5050)
- Redis: Caching and session storage (port 6379)
- RabbitMQ: Message queue (ports 5672, 15672)
- Elasticsearch: Log aggregation (port 9200)
- Kibana: Log visualization (port 5601)
- Prometheus: Metrics collection (port 9090)
- Grafana: Monitoring dashboards (port 3000)
We welcome contributions! Please feel free to submit pull requests or create issues for bugs and feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Project Lead: The British School Jakarta HSE Department
- Technical Support: IT Department