# NGO ERP — System documentation

This folder is the **canonical high-level system reference** for the NGO ERP product: multi-tenant SaaS (Laravel API + Next.js), grant-centric operations, and supporting domains. Each document includes **Mermaid** diagrams (GitHub, GitLab, and many Markdown previewers render these).

Staff signed into the workspace can open a shorter in-app mirror (same diagrams rendered in the browser) from the sidebar: **`/workspace-docs`** in the Next.js app.

## Contents

| Doc | What it covers |
|-----|----------------|
| [00-system-context](./00-system-context.md) | Actors, major systems, C4-style context |
| [01-deployment-and-runtime](./01-deployment-and-runtime.md) | Request path, environments, storage |
| [02-multi-tenancy-and-modules](./02-multi-tenancy-and-modules.md) | Organisations, module flags, dependency graph |
| [03-authentication-and-authorization](./03-authentication-and-authorization.md) | Staff Sanctum, 2FA, RBAC, vendor portal tokens |
| [04-grants-budgets-procurement](./04-grants-budgets-procurement.md) | Grant hub → budgets → spend → procurement |
| [05-vendor-hub-and-portal](./05-vendor-hub-and-portal.md) | Public registration, supplier login, RFQs |
| [06-hr-me-travel-attendance](./06-hr-me-travel-attendance.md) | HR workspace, `/me` portal, travel, attendance |
| [07-hiring-domain](./07-hiring-domain.md) | Hiring module entities and lifecycle |
| [08-frontend-route-map](./08-frontend-route-map.md) | Next.js app router map (conceptual) |

## Related docs (outside `system/`)

- [Procurement operator guide](../guides/procurement-operator-guide.md) — step-by-step staff usage for all procurement screens (PR, RFQ, PO, receiving, payment, vendors, exports).
- [Grant Management System — architecture & roadmap](../architecture/gms.md) — deeper grant-hub narrative and file pointers.
- [Design system colours](../design-system-colors.md) — UI tokens.

## Conventions

- **Organisation** = tenant workspace (`organisation_id` on most domain rows).
- **User** = staff member (`users.organisation_id`); **Vendor portal account** = external supplier login (`vendor_portal_accounts`), separate Sanctum tokenable.
- API base path prefix: **`/api`** (see `routes/api.php`).

When you add a major subsystem, add or extend a page here and keep at least one Mermaid diagram per document for consistency.
