Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 2.74 KB

MOCK_MODE.md

File metadata and controls

56 lines (44 loc) · 2.74 KB

Admin Panel demo mode

The portfolio build uses fictional records and does not send dashboard requests to a university gateway. Keep VITE_USE_MOCK=true on this project. It is not an administrative system and must not be used with real student data.

Explore the demo

  • Sign in with ورود با حساب نمونه to explore the mock staff dashboard without creating an account.
  • To test sign-up, use a fictional email such as reviewer@example.org and a fresh test-only password. Then sign in with those details. No email, OTP, or recovery message is sent. Your session is valid only for this demo.
  • Browse the modules from the sidebar: dropdowns, searches, lists, and actions use sample fixtures. Simulated actions do not change institutional records.
  • To configure the separately hosted account database or test the auth routes locally, see Isolated demo auth setup.

The web app needs access to its same-origin /api/demo-auth endpoint. Plain Vite preview serves the static frontend only and does not run Vercel functions.

Mock implementation

customBaseQuery routes business requests to fixtures in src/infrastructure/mock/. The demo-specific option and record collections are in demoLookups.ts and demoRecords.ts; the resolver also retains the generic fixtures for other mock endpoints. Empty filtered results remain empty on routes with typed fixtures. No gateway credentials should be configured for this deployment.

The server-side Postgres database stores demo accounts and attempt windows only. Panel records remain mocked. Do not copy a live gateway connection or real records into this workspace.

Demo coverage in the follow-up review

The mock resolver first applies hand-written fixtures for important workflows and enums, then uses the response contracts in generated/ for the other endpoint shapes (nested lists, drawers, detail records, drop-downs, and report data). Regenerate these schemas after changing an RTK Query response type:

node scripts/demo-fixtures/generate.mjs
npx vitest run --project unit src/infrastructure/mock

Ticket replies, internal notes, closing tickets, and base food edits are simulated in the current tab. Some contract-driven CRUD views also reflect changes for the current tab. Refreshing or signing out resets that sample data. Only login accounts persist in the existing isolated database.

The “my” shop/withdrawal views that were stubs reuse the corresponding populated screens in mock mode; they do not assert real permissions or make payments. Some legacy screens still require picking a parent record, period, or related item before their detail table appears. The scenario and smoke tests do not validate every conditional action, permission, and combination.