Skip to content

About

Self-hosted EHS software for corporate teams: incidents, corrective actions (CAPA), audits and safety reporting. PostgreSQL-backed app with a separate interactive demo.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

172 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Autonomous EHS Management: Self-Hosted Corporate EHS Software

CI Pages demo License: Apache-2.0

Autonomous EHS Management is Apache-2.0 environmental, health and safety (EHS) software for corporate teams coordinating incidents, corrective and preventive actions (CAPA), approvals, and evidence across sites. The full application runs on Next.js, authentication, role-based permissions, and PostgreSQL you control.

Start with a corporate overview, find the work that needs attention, and follow an incident through a corrective action to human verification. “Autonomous” means deterministic workflow automation and optional AI assistance: people retain approval and closure authority.

Explore the live demo · Download a release · Container package · Run locally · Documentation

Public walkthrough and full application

Public GitHub Pages demo Full application package
Purpose Explore navigation, the corporate overview, and the incident-to-corrective-action journey Run the EHS workflows in your own environment
Data Synthetic, read-only examples Your PostgreSQL database and organization records
Access No sign-in; static HTML, CSS, and JavaScript Better Auth sessions and server-enforced permissions
Actions Interactive navigation and example filters; no operational writes Permission-gated mutations, human approvals, and workflow controls
Start Open the walkthrough Local setup or self-hosting guide

The walkthrough is published from demo/ and has its own verification and deployment workflow. It does not exercise backend authorization or prove deployment readiness. The previous Vercel public demo is deprecated; GitHub Pages is the public walkthrough. See demo scope.

The full application is distributed as source releases and a GHCR container: ghcr.io/safetymp/autonomous-ehs-management/ehs-web:<full-git-sha>. Choose a published SHA or image digest and follow the deployment requirements. GitHub release tags identify source releases; this is not an npm package.

Incident and CAPA workflow

Corporate EHS overview showing work that needs attention, site context, and links to incidents and corrective actions.

Full application running locally with synthetic data, captured during corporate redesign verification.

  1. Find the work: use the overview and shared navigation for actions and approvals, incidents and observations, audits and inspections, programs and risks, or reports and evidence.
  2. Understand the incident: review its details and investigation, then follow the linked corrective actions.
  3. Assign and track action: keep ownership, due dates, approval steps, and status visible in the incident-to-CAPA journey.
  4. Verify the outcome: authorized people review evidence and complete the existing workflow transitions.

Navigation is a way into existing workflows; it does not replace server authorization. Start with the EHS console user manual, workflow depth, and CAPA approval rules.

The repository includes additional domains and optional integrations with different levels of maturity. Read the module maturity map before evaluating a use case. This software does not certify compliance or provide official agency filing. Operators remain responsible for their deployment, records, and applicable obligations; see COMPLIANCE.md.

Run the demo

This starts the full application locally with a seeded PostgreSQL database. To explore without installing anything, use the static public walkthrough.

Prerequisites: Node.js 22, npm 10.9.2, and Docker with Compose. The exact toolchain is recorded in package.json and .nvmrc.

git clone https://github.com/SafetyMP/Autonomous-EHS-Management.git
cd Autonomous-EHS-Management
npm ci
cp .env.demo.example .env.local

Before starting, edit .env.local: set a unique BETTER_AUTH_SECRET of at least 32 characters and change DEMO_ADMIN_PASSWORD. Keep the supplied local database URL on 127.0.0.1:5433 and DATABASE_USE_PG=1.

npm run demo:up
npm run dev

demo:up starts PostgreSQL, applies migrations, and seeds the example organization. Open http://localhost:3000/sign-in and choose Try demo admin, or use the demo credentials you set. The health endpoint should return HTTP 200 with {"ok":true,"database":"up"}.

Stop the app with Ctrl+C, then stop the database while keeping its data:

docker compose -f docker-compose.demo.yml stop

If another PostgreSQL instance is on port 5432, an error such as role "ehs" does not exist may mean the URL points to that instance. Use the demo port 5433. Do not enable DEMO_MODE in production. For production configuration, migrations, backups, and optional services, use the self-hosting guide.

TRIR

Total recordable incident rate uses (recordable count × 200,000) / hours worked.

  • A complete grid of 12 months, each with hours, supplies the denominator.
  • A partial grid warns and uses the saved annual total_hours_worked when available.
  • With neither a complete grid nor an annual total, the rate is not computed.

See the user manual for incidence-rate reporting and its limits.

Before a change

Read CONTRIBUTING.md and AGENTS.md. npm run verify runs lint, type checks, and unit tests; ./scripts/verify.sh also installs dependencies and runs audit-matrix and threat-model checks. CI adds browser and security checks. Static demo changes use their separate Playwright configuration.

More

Part of the SafetyMP portfolio: reliable automation needs trustworthy records, assigned ownership, and verified corrective action.

Documentation map

Reader Start here
Corporate EHS user Console user manual
Evaluator Public demo scope, module maturity
Operator Self-hosting quick start, runbooks
Contributor or coding agent AGENTS.md, CONTEXT.md, codebase layout
Reviewer Architecture map, workflow depth, compliance boundaries

Use docs/README.md for the complete documentation index. Current source and release notes take precedence over historical design and verification reports.

About

Self-hosted EHS software for corporate teams: incidents, corrective actions (CAPA), audits and safety reporting. PostgreSQL-backed app with a separate interactive demo.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages