[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107658":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":13,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":30,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},107658,"factory-safety-loop","changhaoting1998-star\u002Ffactory-safety-loop","changhaoting1998-star","A privacy-first factory safety hazard closed-loop reference app with React, Express and optional Feishu integration.","",null,"JavaScript",225,4,54,0,41,159,25,80.1,"MIT License",false,"main",true,[25,26,27,28,29],"express","factory-safety","feishu","react","workflow","2026-10-27 02:44:08","2026-11-23 19:45:44","\u003Cdiv align=\"center\">\n\n# Factory Safety Loop\n\n**A privacy-first reference app for closing factory safety hazards—from report to verified resolution.**\n\n[![CI](https:\u002F\u002Fgithub.com\u002Fchanghaoting1998-star\u002Ffactory-safety-loop\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fchanghaoting1998-star\u002Ffactory-safety-loop\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Node.js](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNode.js-20.19%2B-339933?logo=nodedotjs&logoColor=white)](https:\u002F\u002Fnodejs.org\u002F)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](LICENSE)\n[![Privacy](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fprivacy-synthetic%20demo%20data-00a870)](PRIVACY.md)\n\n[Quick start](#quick-start) · [Workflow](#workflow) · [Feishu integration](#feishu-integration) · [中文说明](#中文说明)\n\n\u003C\u002Fdiv>\n\n![Factory Safety Loop dashboard](docs\u002Fassets\u002Fdashboard.png)\n\nFactory Safety Loop turns a commonly scattered process—reporting hazards, assigning owners, rectifying problems, verifying results and closing cases—into one small, inspectable workflow. It includes a runnable React dashboard, an Express API, domain rules, tests and an optional Feishu adapter.\n\nThe repository is a clean-room reference implementation. Every record is synthetic; no production database, chat history, attachment, log, company configuration or real credential is included.\n\n## Why this project\n\n- **A complete loop, not a form demo.** Status transitions make ownership and verification explicit.\n- **Useful without cloud accounts.** Mock mode runs locally and never calls Feishu.\n- **Integration stays optional.** Domain rules do not depend on a collaboration platform.\n- **Privacy checks travel with the code.** `npm run verify` runs tests and a repository privacy scan.\n- **Small enough to learn from.** The monorepo separates the web app, API, domain core and adapter.\n\n## Features\n\n- Hazard registration with location, risk level, description and due date\n- State machine: open → assigned → rectifying → verifying → closed\n- Dashboard metrics for open, overdue, pending verification and closure rate\n- React + Vite dashboard with local fallback data\n- Express REST API backed by an in-memory demonstration store\n- Optional Feishu SSO and group-notification adapter boundaries\n- Synthetic demo fixtures, CI, tests, privacy guidance and threat model\n\n## Quick start\n\nRequirements: Node.js 20.19 or newer.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fchanghaoting1998-star\u002Ffactory-safety-loop.git\ncd factory-safety-loop\ncp .env.example .env\nnpm install\nnpm run dev:api\n```\n\nIn a second terminal:\n\n```bash\nnpm run dev:web\n```\n\nOpen \u003Chttp:\u002F\u002Flocalhost:5173>. The default `FEISHU_MODE=mock` does not access any external service.\n\n## Workflow\n\n```mermaid\nstateDiagram-v2\n    [*] --> OPEN: report\n    OPEN --> ASSIGNED: assign owner\n    ASSIGNED --> RECTIFYING: start work\n    RECTIFYING --> VERIFYING: submit evidence\n    VERIFYING --> CLOSED: approve\n    VERIFYING --> RECTIFYING: request changes\n    CLOSED --> [*]\n```\n\n## Architecture\n\n```mermaid\nflowchart LR\n    Web[React dashboard] --> API[Express API]\n    API --> Core[Workflow core]\n    API --> Demo[(Synthetic demo store)]\n    API -. optional .-> Feishu[Feishu adapter]\n```\n\n```text\napps\u002Fweb                 React + Vite dashboard\napps\u002Fapi                 Express HTTP API\npackages\u002Fcore            Hazard state machine and metrics\npackages\u002Ffeishu-adapter  Mock\u002Freal integration boundary\ndata\u002Fdemo                Synthetic fixtures only\ndocs                     Integration, privacy and threat-model notes\ntests                    Domain and adapter tests\n```\n\n## Verification\n\n```bash\nnpm run verify\nnpm --workspace @factory-safety\u002Fweb run build\n```\n\n`verify` runs the business-rule tests and privacy scanner. Before a public deployment, also run dependency and license audits, review the code manually and follow [the threat model](docs\u002FTHREAT_MODEL.md).\n\n## Feishu integration\n\nMock mode is the safe default. The adapter exposes integration points for SSO and group notifications without coupling the workflow core to Feishu. See [the integration guide](docs\u002FFEISHU_INTEGRATION.md).\n\nReal App IDs, App Secrets, group IDs and callback URLs belong in the deployment environment and must never be committed. Feishu is a third-party product name; this project is not affiliated with or endorsed by Feishu.\n\n## Privacy and production scope\n\nRead [PRIVACY.md](PRIVACY.md), [the desensitization guide](docs\u002FDESENSITIZATION.md) and [the threat model](docs\u002FTHREAT_MODEL.md) before importing organizational data.\n\nThis release is a reference app for local evaluation and secondary development. A production deployment still needs durable storage, authentication, RBAC, rate limits, security headers, safe attachment handling, audit-log controls, backups and an organization-specific legal review.\n\n## Roadmap\n\n- [ ] PostgreSQL persistence example\n- [ ] Role-based permissions and session hardening\n- [ ] Evidence attachment validation\n- [ ] Inspection-plan module\n- [ ] Feishu message-card examples\n- [ ] Docker Compose quick start\n\n## 中文说明\n\n这是一个面向中小工厂的安全隐患闭环管理参考实现，覆盖隐患上报、责任分派、整改、复核和关闭。项目可在纯本地模拟模式运行，也预留了飞书登录与群消息通知适配层。\n\n仓库只含虚构演示数据，不含生产数据库、真实人员、聊天记录、附件、企业配置或凭证。接入真实组织数据前，请先完成合法性评估、权限设计和脱敏检查。\n\n## Contributing\n\nBug reports, workflow examples, documentation improvements and focused pull requests are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and report security issues through [SECURITY.md](SECURITY.md).\n\nIf this reference saves you time, consider starring the repository—it helps more manufacturing teams find it.\n\n## License\n\n[MIT](LICENSE)\n","Factory Safety Loop 是一个面向工厂安全管理的隐患闭环处置参考应用，支持从隐患上报、指派、整改、验证到关闭的全流程跟踪。核心采用 React + Express 架构，内置状态机驱动的五阶段闭环工作流（open→assigned→rectifying→verifying→closed），强调隐私优先设计——所有数据为合成样本，支持纯本地运行（mock 模式）及可选的飞书（Feishu）SSO 与通知集成，不依赖外部云服务。适用于制造业企业内训、EHS 数字化原型验证、安全流程标准化落地等轻量级场景。",2,"2026-11-24 04:32:32","CREATED_QUERY"]