How quantumhash-corporation/quantumhash_ptw works
Drilling Group is a role-scoped electronic Permit to Work system. Users sign in, enter role-specific dashboards and workflows, and manage permits through submission, approval, activation, and closure; supporting capabilities include risk assessment, safety evidence, personnel, schedules, reporting, and audit. The React client calls an Express API, whose controllers enforce workflow rules and use services and database access. README documents the broader product scope; sampled source confirms application routing, PTW handling, authentication, and safety-book retrieval, but not every feature’s implementation links.
Main entry points: App.jsx App routes · ptw.controller.js PTW controller · app.js Express API app · ptw.routes.js PTW routes
Components 22
Web client
- App routes
client/src/App.jsx - Auth context
client/src/context/AuthContext.jsx - Auth client
client/src/services/auth.service.js - API client
client/src/lib/api.js - Role dashboards
client/src/components/dashboard/roles - Personnel management
client/src/pages/personnel - Safety documents
client/src/pages/SafetyDocuments.jsx
API and access
- Express API app
server/src/app.js - Authentication and permissions
server/src/middleware/auth.js - PTW routes
server/src/routes/ptw.routes.js - JSA routes
server/src/routes/jsa.routes.js
Permit workflows
- Permit screens
client/src/pages/ptw - PTW controller
server/src/controllers/ptw.controller.js - PTW lifecycle service
server/src/services/ptw.service.js - Permit documents
server/src/controllers/permitDocuments.controller.js
Safety evidence
- Safety-book retrieval
server/src/services/jsa-safety-book-retrieval.service.js - Embedding generation
server/src/services/embedding.service.js
Persistence and integrations
- Database access
server/src/db/index.js - Authority records
server/src/db/authorities.js - Vector search
server/src/services/qdrant-client.js
Other components
- Role-based user
- Embedding API
Connections 20
- Role-based user → App routes: uses
README.md - App routes → Auth context: checks identity
client/src/App.jsx - Auth context → Auth client: loads session
client/src/context/AuthContext.jsx - Auth client → API client: sends requests
client/src/services/auth.service.js - App routes → Role dashboards: routes by role
client/src/App.jsx - App routes → Permit screens: routes permit work
client/src/App.jsx - Role-based user → Personnel management: manages personnel
README.md - Role-based user → Safety documents: accesses safety docs
- API client → Express API app: calls API
README.md - Express API app → PTW routes: mounts routes
server/src/app.js - Express API app → JSA routes: mounts routes
server/src/app.js - PTW routes → Authentication and permissions: guards requests
server/src/routes/ptw.routes.js - PTW routes → PTW controller: dispatches to
server/src/routes/ptw.routes.js - PTW controller → PTW lifecycle service: uses lifecycle logic
server/src/controllers/ptw.controller.js - PTW controller → Permit documents: coordinates documents
- PTW controller → Database access: queries
server/src/controllers/ptw.controller.js - Authentication and permissions → Authority records: loads authority data
server/src/middleware/auth.js - Safety-book retrieval → Embedding generation: generates vectors
server/src/services/jsa-safety-book-retrieval.service.js - Safety-book retrieval → Vector search: searches vectors
server/src/services/jsa-safety-book-retrieval.service.js - Embedding generation → Embedding API: requests embeddings
server/src/services/embedding.service.js