Deliver role-aware shell (sidebar, breadcrumbs, quick search, tables, detail/create layouts), locale-ready pages, shared backend/feature docs, and Vercel project config so HR, finance, and members can demo against typed mocks. Co-authored-by: Cursor <cursoragent@cursor.com>
99 lines
3.1 KiB
Markdown
99 lines
3.1 KiB
Markdown
# Gishen B2B
|
|
|
|
Institutional portal for Gishen corporate medical benefits clients (Feature Requirements §3).
|
|
|
|
Organisations hold the contract and credit limit. HR enrols people and configures packages. Finance sees covered spend and statements (no clinical detail). Members use their allowance, orders, and prescriptions.
|
|
|
|
## Stack
|
|
|
|
- Next.js 16 (App Router) + React 19 + TypeScript
|
|
- Tailwind CSS 4 + shadcn/ui
|
|
- next-intl (`en` / `am`)
|
|
- TanStack Query + typed mock API adapters
|
|
- Hosting: Vercel
|
|
|
|
## Run locally
|
|
|
|
```bash
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Open [http://localhost:3000](http://localhost:3000) — you will be redirected to `/en/login`.
|
|
|
|
### Demo login
|
|
|
|
On `/login`, pick a persona:
|
|
|
|
| Role | Access |
|
|
|------|--------|
|
|
| **SUPER_USER** | Full portal (including clinical/Rx for support) |
|
|
| **HR_ADMIN** | Org, departments, members, packages, migration — no clinical |
|
|
| **FINANCE** | Spend, statements, approvals — no clinical |
|
|
| **MEMBER** | Own benefits, orders, prescriptions |
|
|
|
|
Use **Switch demo user** in the topbar profile menu to return to the role selector.
|
|
|
|
Language switcher is on login and in the topbar (English / አማርኛ).
|
|
|
|
## Routes
|
|
|
|
| Area | Paths |
|
|
|------|--------|
|
|
| Auth / signup | `/login`, `/register/organisation`, `/register/request`, `/join`, `/invite/[token]` |
|
|
| Org | `/organisation`, `/departments`, `/settings/verification` |
|
|
| People | `/members`, `/members/import`, `/members/[id]` |
|
|
| Packages | `/packages`, `/packages/[id]` |
|
|
| Migration | `/migration`, `/migration/new`, `/migration/[jobId]` |
|
|
| Finance | `/finance`, `/finance/approvals`, `/statements` |
|
|
| Member | `/me`, `/me/orders`, `/prescriptions`, `/prescriptions/new` |
|
|
|
|
All app routes are locale-prefixed (`/en/...`, `/am/...`).
|
|
|
|
## Backend specs (standing rule)
|
|
|
|
This frontend ships against mocks typed to a living shared-backend spec:
|
|
|
|
- `docs/README.md` — how to extend specs
|
|
- `docs/backend/` — entities, endpoints, events, OVERVIEW
|
|
- `docs/features/INDEX.md` — feature → pages → entities → endpoints
|
|
- `docs/coordination/` — Admin / Ecom / open items
|
|
|
|
**Whenever UI changes, update `docs/backend/` and `docs/features/INDEX.md` in the same change.**
|
|
|
|
## Environment
|
|
|
|
Copy `.env.example` to `.env.local`:
|
|
|
|
```bash
|
|
cp .env.example .env.local
|
|
```
|
|
|
|
| Variable | Purpose |
|
|
|----------|---------|
|
|
| `NEXT_PUBLIC_APP_URL` | Public URL |
|
|
| `NEXT_PUBLIC_API_BASE_URL` | Shared API (unused while mocks are on) |
|
|
| `NEXT_PUBLIC_USE_MOCKS` | Keep `true` until shared backend exists |
|
|
|
|
## Deploy (Vercel)
|
|
|
|
1. Install and authenticate CLI: `npm i -g vercel && vercel login`
|
|
2. From this repo: `vercel link` (project name e.g. `gishen-b2b`)
|
|
3. `vercel env pull` (optional)
|
|
4. Preview: `vercel` · Production: `vercel --prod`
|
|
|
|
Config: `vercel.json`. Connect the Gitea remote via Vercel Git integration when available.
|
|
|
|
## Scripts
|
|
|
|
```bash
|
|
npm run dev # development
|
|
npm run build # production build
|
|
npm run start # serve production build
|
|
npm run lint # eslint
|
|
```
|
|
|
|
## Brand
|
|
|
|
Gishen mint / black palette and logo from Gishen-Ecom (`public/brand/gishen-logo.png`, `src/data/brand.ts`). Layout patterns follow Fortune Admin `ui` (PageShell, collapsible sidebar, topbar) built with shadcn only.
|