How navikt/pam-stillingsok works
pam-stillingsok is the Next.js frontend for searching jobs on arbeidsplassen.nav.no. A visitor enters search criteria, which are normalized and sent through the search route to the search service; results support filtering and pagination. Logged-in users can also save favorites and searches, while the app provides summer-job listings, account pages, informational articles, and youth-focused content. The README documents the main external services; source-index references and excerpts establish the detailed search and authenticated-user calls. Other UI-to-API links are shown only where documented or marked unverified.
Main entry points: fetchElasticSearch.ts Search fetch · query.ts Query parsing · route.ts Search route · searchParamsVersioning.ts URL migration
Components 25
Job search
- Search interface
src/app/stillinger/(sok)/_components - Search route
src/app/stillinger/api/search/route.ts - Query parsing
src/app/stillinger/(sok)/_utils/query.ts - URL migration
src/app/stillinger/(sok)/_utils/versioning/searchParamsVersioning.ts - Search fetch
src/app/stillinger/(sok)/_utils/fetchElasticSearch.ts - Result validation
src/server/schemas/stillingSearchSchema.ts - Summer jobs
src/app/sommerjobb
Accounts
- Sign-in and tokens
src/app/_common/auth/auth.server.ts - Aduser token exchange
src/app/_common/auth/aduserAuth.server.ts - User API route
src/app/api/aduser/v1/user/route.ts - Favorites and saved searches
src/app/stillinger/_common/actions - My page
src/app/min-side
Content and discovery
- Articles and SEO
src/app/(artikler) - Home and employer pages
src/app/(forside) - Youth section
src/features/ung/ui/UngMainPage.tsx
Shared platform
- Geographic data
src/app/_common/geografi/fetchLocations.ts - Experiments
src/app/_experiments/middlewareAb.ts - Event telemetry
src/app/api/telemetry/events/route.ts - Service metrics
src/metrics.ts - Next.js cache
cache-handler.mjs
Other components
- Job seeker
- Search API
- pam-aduser
- Redis or Valkey
- Wonderwall
Connections 27
- Job seeker → Search interface: searches
- Search interface → Search route: requests results
- Search route → URL migration: migrates parameters
src/app/stillinger/api/search/route.ts - Search route → Query parsing: parses query
src/app/stillinger/api/search/route.ts - Search route → Search fetch: fetches results
src/app/stillinger/api/search/route.ts - Query parsing → URL migration: reads version
src/app/stillinger/(sok)/_utils/query.ts - Search fetch → Query parsing: builds query
src/app/stillinger/(sok)/_utils/fetchElasticSearch.ts - Search fetch → Result validation: validates results
src/app/stillinger/(sok)/_utils/fetchElasticSearch.ts - Search fetch → Search API: queries
- URL migration → Query parsing: normalizes parameters
src/app/stillinger/(sok)/_utils/versioning/searchParamsVersioning.ts - URL migration → Query parsing: uses query names
src/app/stillinger/(sok)/_utils/versioning/searchParamsVersioning.ts - Job seeker → Summer jobs: browses
- Job seeker → Favorites and saved searches: saves searches
- Favorites and saved searches → pam-aduser: stores favorites and searches
- Job seeker → My page: opens account
- Wonderwall → Sign-in and tokens: provides authentication
- User API route → Sign-in and tokens: exchanges token
src/app/api/aduser/v1/user/route.ts - Sign-in and tokens → Aduser token exchange: gets OBO token
src/app/_common/auth/auth.server.ts - User API route → pam-aduser: forwards user requests
src/app/api/aduser/v1/user/route.ts - Job seeker → Articles and SEO: reads guidance
- Job seeker → Home and employer pages: visits
- Job seeker → Youth section: visits
- Search interface → Geographic data: uses location options
- Experiments → Job seeker: assigns variants
- Job seeker → Event telemetry: sends events
- Search fetch → Service metrics: records search metrics
src/app/stillinger/(sok)/_utils/fetchElasticSearch.ts - Next.js cache → Redis or Valkey: stores cache
cache-handler.mjs