This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Fundermaps Management Front is an admin-only Vue 3 management portal for the Fundermaps platform. It manages users, organisations, and mapsets. Only users with the administrator role can access the app (enforced via router guard). Used by two people; will eventually be integrated into the maps app.
The package manager is pnpm (packageManager: pnpm@10.28.0).
pnpm dev- Start Vite dev server (port 5173)pnpm build- Type-check + production build (runsvue-tsc --buildandvite buildin parallel)pnpm type-check- TypeScript checking only (vue-tsc --build)pnpm lint- ESLint with auto-fixpnpm format- Prettier formatting forsrc/
No test framework is configured.
Stack: Vue 3 (Composition API, <script setup>), TypeScript, Pinia, Vue Router, Tailwind CSS 4 (CSS-first, via @tailwindcss/vite), Vite, Zod.
Path aliases: @ = src/, @assets = src/assets/.
client.ts- Core HTTP client wrappingfetch. Exportsget,post,put,del. Constructs URLs fromVITE_FUNDERMAPS_URLenv var +/api/prefix. Handles auth headers (Bearer token or API key) automatically.endpoints/management/user.ts- User CRUD, password reset, API key management, role updates.endpoints/management/organisation.ts- Org CRUD, user/mapset membership, geolock management (districts, municipalities, neighborhoods).endpoints/management/mapset.ts- Mapset listing (read-only).oidc.ts- OIDC authorization-code + PKCE client (client_id=managementfront). Handles the login redirect, code exchange at/auth/callback, single-flight silent refresh, and RP-initiated logout (end-session withid_token_hint).session.ts- Stores the OIDC token set (access/refresh/id tokens + expiry) inlocalStorage.api-key.ts- Optional API key auth viaVITE_AUTH_KEY; when set, overrides the Bearer token inclient.ts.errors.ts- Custom error classes (APICallError,APITokenError,APIErrorResponse).
Single store: session.ts - Pinia store managing authentication state, current user, and timer-based token refresh. Login/logout go through the OIDC redirects in services/oidc.ts.
All routes are top-level. Home (/) redirects to /user. The /login route kicks off the OIDC redirect and /auth/callback completes the code exchange. Router guards redirect unauthenticated users to /login and non-admins to /403.
UserListView- User list + detail panel with role change, password reset, API key management, deleteOrganisationListView- Org list + detail panel with tabs (Users, Mapsets, Geolock), edit name, deleteMapsetListView- Read-only mapset list + detail panel- Auth views:
Login(OIDC redirect shim),Callback(OIDC code exchange),403
Common/- Reusable UI primitives (buttons, inputs, modals, icons, links, cards)Management/- Domain forms and detail views. All lists useVue3Datatablefor consistency.Form.vue/FormCard.vue- Generic form wrappers with validation (Zod), submit/cancel, inline modeRecordDetailsCard.vue- Detail panel with edit/delete/close header buttonsOrganisationUsersList.vue/OrganisationMapsetsList.vue/OrganisationGeolockSection.vue- Org sub-lists
Layout/- Page wrappers (AuthWrapper,MainWrapper,Header)Branding/- Logo and loading indicator
user.ts-renderUserName()for display name formattingpassword.ts-generateStrongPassword()for user creationstring.ts- String trimming helpers used by the API client
- Prettier: no semicolons, single quotes, 100 char print width
- ESLint: Vue essential rules + TypeScript recommended
- SVGs loaded as Vue components via
vite-svg-loader - All lists must use
Vue3Datatable(type declaration insrc/types/vue3-datatable.d.ts) - Node 22+ required