Markdown Converter
Agent skill for markdown-converter
This file provides guidance to AI agents when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to AI agents when working with code in this repository.
Nirgali is a frontend application for managing deviation messages, cancellations, and extra journeys in the Entur public transportation system. It has a corresponding backend component: enlil.
npm start
The dev server runs on port 3001 (configured in vite.config.mts). This command automatically copies the dev config file from
.github/environments/config-dev.json to public/config.json.
npm test # Run tests in watch mode npm run test:coverage # Run tests with coverage reports
Tests use Vitest with jsdom environment. The test setup file is at
src/setupTests.ts.
npm run build
TypeScript compilation is run first, then Vite builds the production bundle to the
build directory.
npm run format # Format all code npm run check # Check formatting without making changes
Prettier is configured with
singleQuote: true. Husky pre-commit hooks automatically format staged files.
react-oidc-context and oidc-client-tssrc/index.tsx), fetches /config.json containing API endpoints and OIDC configurationAuthenticatedApp component handles the authentication flow and redirects unauthenticated usersuseOrganizations hook from the deviation-messages API's userContext queryThe app uses runtime configuration loaded from
/config.json:
deviation-messages-api: Backend GraphQL API for messages, cancellations, and extra journeysjourney-planner-api: Entur's journey planner GraphQL API for service journey datastop-places-api: REST API for stop place and topographic place dataoidcConfig: OIDC authentication settingsConfiguration is provided via
ConfigContext (src/config/ConfigContext.ts) and accessed through useConfig() hook.
The API module creates Apollo Client instances and exports functions for:
All authenticated endpoints automatically inject the OIDC access token via the Authorization header.
The app has three main feature areas, each with overview, register, and edit components:
src/components/messages/): Deviation messages (SIRI-SX situation elements)src/components/cancellations/): Trip cancellations (SIRI-ET)src/components/extrajourneys/): Additional trips not in the regular schedule (SIRI-ET)Common components in
src/components/common/ include line picker and stop picker.
src/components/app/appRouter.tsx/meldinger (messages)/meldinger, /innstillinger, /ekstratureSelectedOrganizationContextcodespace:authority (e.g., NSB:Authority:NSB)useOrganizations: Fetches user context and available authorities, handles authorizationuseSelectedOrganization: Accesses the currently selected organization from contextuseMessages, useCancellations, useExtrajourneys: Fetch and manage respective datauseLines, useOperators: Fetch reference data from journey planner APIsrc/style/base/base.scssgql template literals in src/api/api.jsET-Client-Name header is set to "entur - deviation-messages" for all API requests@internationalized/date library