Overview
Leverandørvakt is an early-warning service for Norwegian businesses. Users follow the companies they depend on, such as suppliers, customers and partners, and are notified when one of them changes for the worse: a new CEO, an auditor who resigns, late or corrected annual accounts, equity turning negative, or the start of bankruptcy proceedings.
Everything is built on open data from the Brønnøysund Register Centre, the Norwegian Mapping Authority and Statistics Norway. Nothing is bought, scraped or guessed.
The challenge
Small and medium-sized businesses rarely notice that a partner is in trouble until an invoice goes unpaid or a delivery does not arrive. The warning signs are often public long before that, but nobody has time to check every partner in the registry by hand.
The service also has to be trustworthy: a warning is only useful if the user can see what changed, when, and why it matters.
How I solved it
- Change detection reads the Brønnøysund update feeds for companies and roles every ten minutes and records every change with a severity: critical, warning or info. A daily check compares the annual accounts year by year, and keeps years the registry no longer shows.
- Explainable risk signals give a "check before you sign" assessment for any company: every signal with its points and reason, and what could not be checked. It supports the user's own judgement and is not a credit rating.
- Connections show people and audit firms that hold roles in several of the user's companies.
- Regional trends show new companies per month by municipality and industry, compared with the same month a year earlier.
- An AI assistant answers questions in plain language, in English or Norwegian, with tool calling over the app's own service functions. It is read-only and never sends private notes to the model. The model provider (local Ollama, Ollama Cloud or Gemini) is chosen in the configuration.
- Notifications in the app and by email: critical changes at once, the rest as a daily summary, in the user's language.
- Reports and exports: a one-page supplier check to print or save as PDF, and the watchlist as Excel or as CSV files for Power BI.
Security and privacy
- The web app follows the backend-for-frontend pattern: the JWT stays in an httpOnly cookie on the Next.js server and never reaches the browser.
- A nonce-based content security policy, security headers and rate limits on logins, new accounts and API requests.
- Users can download all their data as JSON or delete their account (GDPR). Birth dates from the registry are only used in memory and are never stored.
Quality
- API tests with Vitest and Supertest against a real PostgreSQL database, with the external registries replaced by fakes so the tests never depend on the network.
- End-to-end tests with Playwright in a real browser, covering both languages, dark mode and phone width.
- GitHub Actions runs everything on every push.
- The interface uses Designsystemet, the Norwegian public sector's design system, in English and Norwegian, with light and dark mode.
Deployment
The app runs in production on a Linux server with Docker Compose: the Next.js web app, the Express API and PostgreSQL. Cloudflare Tunnel brings visitors to the web app, so no ports are open to the internet; the API and the database are only reachable inside Docker's network. Every service restarts by itself, and the database is backed up every night.