Files
open-safetylog-ehs/docs/ROADMAP.md
T
jayjennings 3f6dff5f24
CI / Lint, typecheck, test, build (push) Canceled after 0s
CI / End-to-end tests (push) Canceled after 0s
feat: implement permissions and actions management
- Add permissions logic for status options in corrective actions.
- Create tests for permissions functionality.
- Implement queries for user authentication and actions management.
- Develop Actions page to display and manage corrective actions.
- Create authentication pages for login, setup, and password reset.
- Add IncidentDetail page to view incident details and associated actions.
- Implement Settings page for user management and password changes.
2026-10-06 11:20:44 -07:00

91 lines
5.4 KiB
Markdown

# Open SafetyLog EHS Roadmap
A free, open-source (AGPL-3.0) accident and safety tracking system for manufacturing.
This is a living document. Update it as decisions are made or scope changes.
## Decisions
| Topic | Decision | Status |
| --- | --- | --- |
| License | AGPL-3.0-only | Decided |
| Frontend | React + Vite + TypeScript, Tailwind CSS v4 | Decided |
| Backend | Node + Hono, PostgreSQL via Drizzle ORM, Zod schemas shared with the web app (`shared/`). Node runs the TypeScript directly (no build step for the server) | Decided |
| Database | PostgreSQL in production; embedded PGlite for local development, tests and very small installs | Decided |
| Auth | Email + password (scrypt), server-side sessions in an http-only cookie, four roles: reporter < supervisor < safety manager < admin | Decided |
| Deployment | Self-hosted, single `docker compose up` (app + Postgres); file storage added with photo upload | Decided |
| Compliance scope | US OSHA first; data model kept extensible for other regions (e.g. RIDDOR) | Proposed |
| Incident PDFs | Browser print-to-PDF from a print stylesheet; server-side PDF deferred (see TODO) | Decided |
| Email | SMTP via `SMTP_URL`; without it, logged in development and dropped in production. Delivery setup deferred (see TODO) | Decided |
| CI | Gitea Actions (`.gitea/workflows`): lint, typecheck, unit tests, build, e2e | Decided |
| Product name | Open SafetyLog EHS (replaced placeholder "IA Tracker" and the prototype's "Safesite" branding) | Decided |
## Phase 0: Foundation
- [x] AGPL-3.0 LICENSE
- [x] Convert to TypeScript
- [x] Split `App.jsx` into `pages/`, `components/`, `lib/`
- [x] Convert styling to Tailwind (remove hand-written `App.css`)
- [x] Remove unused template files
- [x] Bundle fonts locally (no Google Fonts dependency for offline/locked-down plant networks)
- [x] CI: lint, typecheck, unit tests (Vitest), build, e2e (Playwright)
- [x] Replace template README
- [x] CONTRIBUTING.md and CODE_OF_CONDUCT.md
- [x] About page with source-code link (AGPL section 13)
- [ ] Remaining setup items (name, CoC contact, final source URL, CI runner): see [TODO.md](TODO.md)
## Phase 1: Backend and data model
- [x] Database schema and first migration for all entities: Organization, Site → Area (location tree), User, Session, Incident, InjuredPerson, Attachment, Investigation, RootCause, CorrectiveAction, Comment, AuditLog, HoursWorked
- [x] First-run setup (creates the organization and first admin)
- [x] Email/password sign-in, sessions, change password, login rate limiting
- [x] Role-based permissions (reporters see only their own reports)
- [x] REST API: users, sites/areas, incidents with pagination, search, filters and gap-free sequential numbers (`INC-0001`); see [API.md](API.md)
- [x] Audit log of every change
- [x] Server tests (Vitest + in-memory PostgreSQL), demo seed data
- [x] Dockerfile and `docker-compose.yml`
- Moved to Phase 2: magic-link sign-in and password reset by email (both need the email sending built for notifications). SSO/OIDC stays "later".
## Phase 2: Core workflow (MVP)
- [x] Web app connected to the API: sign-in, first-run setup, every page on live data (demo data removed from the frontend)
- [x] Photo and PDF upload, checked by file content (not name), size-limited, served with a sandboxing security policy
- [x] Magic-link sign-in, password reset by email, email invitations for new users (admins can also set passwords when there's no email)
- [x] Incident detail page: details editing, activity log (comments + audit trail), investigation with 5 Whys and fishbone (6M) views, corrective actions (CAPA)
- [x] Status workflow Reported → Triage → Investigation → Corrective actions → Verification → Closed, with role rules and guards (e.g. high severity can't skip investigation; closing needs every action verified), shared between API and UI
- [x] "My actions" and "All actions" lists with overdue tracking; assignees can update progress on their own actions
- [x] Email notifications: high/critical alerts to safety managers, action assignment, daily due/overdue digest
- [x] CSV export of the filtered register (protected against spreadsheet formula injection); print-friendly incident page for PDF via the browser
- [x] Overview dashboard and Analytics computed from real data; Locations and Settings (people, roles, passwords) pages
- [x] End-to-end tests run against the real server: full three-role lifecycle, sign-in, visibility rules, mobile reporting
## Phase 3: Shop-floor reporting
- Installable PWA with offline queue (sync when connection returns)
- Printable QR codes per area that pre-fill the location
- Kiosk mode and anonymous reporting
- Multi-language support, Spanish first
## Phase 4: Compliance (US OSHA)
- Recordability wizard; days away / restricted / transferred tracking
- OSHA 300, 300A and 301 form generation; privacy-case handling
- ITA (Injury Tracking Application) CSV export
- Hours worked per site per month; TRIR, DART and lost-time rates
## Phase 5: Analytics
- Trends, location breakdown, top root causes, corrective-action closure time
- Leading vs lagging indicators; filters and saved dashboards
## Phase 6: Release v1.0
- Docker images, backup and restore
- Demo instance with seed data
- Documentation site and upgrade guide
## Later
Inspections and audit checklists, job safety analysis (JSA), training and certification records, management of change, SDS links, public API and webhooks.