Skip to content

veniplex/compliance-mapper

πŸ›‘οΈ Compliance Mapper

Map overlapping controls across cybersecurity and privacy frameworks β€” so you can close gaps and reduce duplication.

Version SvelteKit Tailwind CSS Node.js License GitHub Issues GitHub Stars

Important

This tool is currently in pre-alpha and may have inconsistencies, missing and/or incorrect data.

Compliance Mapper Screenshot


πŸ“‹ Table of Contents


✨ Features

  • πŸ—ΊοΈ Framework Browser β€” explore all supported frameworks and their individual controls
  • πŸ”— Cross-Framework Mapping β€” query how controls from different frameworks relate to each other
  • πŸ” Relationship Filtering β€” filter by equivalent, subset, superset, or related
  • πŸ‘€ User Accounts β€” sign up / sign in with per-control progress tracking
  • πŸŒ™ Dark Mode β€” full dark mode UI built with Tailwind CSS v4
  • πŸ“– Live API Docs β€” built-in documentation page with a "try it" runner
  • πŸ“Š Progress Dashboard β€” per-framework progress bars and an overall compliance score

πŸš€ Tech Stack

Layer Technology
Frontend SvelteKit v2 (Svelte 5 with runes)
Styling Tailwind CSS v4
Backend SvelteKit server routes via @sveltejs/adapter-node
Runtime Node.js β‰₯ 18
Data JSON files for frameworks, controls, and mappings
Database PostgreSQL (user accounts & progress tracking)

🏁 Getting Started

Option A β€” Docker (recommended)

The easiest way to run the full stack (app + database) is with Docker Compose.

Prerequisites: Docker Desktop or Docker Engine + Compose plugin.

  1. Copy the example environment file and set your secrets:

    cp .env.example .env

    DB_PASSWORD and JWT_SECRET must be set β€” Docker Compose will refuse to start without them:

    DB_PASSWORD=a-strong-db-password
    JWT_SECRET=a-long-random-string-at-least-32-characters
  2. Start the stack:

    docker compose up --build

    On the first run Docker will:

    • Build the app image (runs npm run build for the SvelteKit app)
    • Pull the postgres:16-alpine image
    • Wait for PostgreSQL to be healthy, then start the app
  3. Open the app: http://localhost:3000

  4. Stop the stack:

    docker compose down      # keep the database volume
    docker compose down -v   # also remove the database volume
πŸ“‹ Useful Compose commands
Command Description
docker compose up -d Start in the background (detached)
docker compose logs -f app Stream app logs
docker compose logs -f db Stream database logs
docker compose ps Show running services
docker compose exec db psql -U ${DB_USER:-postgres} ${DB_NAME:-compliance_mapper} Open a psql shell
βš™οΈ Environment variables
Variable Default Description
PORT 3000 Host port to expose the app on
DB_NAME compliance_mapper PostgreSQL database name
DB_USER postgres PostgreSQL user
DB_PASSWORD (required) PostgreSQL password
JWT_SECRET (required) Secret for signing JWTs β€” use a long random string
BCRYPT_ROUNDS 12 bcrypt work factor for password hashing
STANDALONE_MODE false Set to true to disable database features (serves data-only)

Option B β€” Local Development (no Docker)

You need Node.js β‰₯ 18 and a running PostgreSQL instance.

  1. Install dependencies:

    npm install
  2. Configure environment:

    cp .env.example .env
    # Edit .env β€” set DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, JWT_SECRET
  3. Run in development mode (with HMR):

    npm run dev
  4. Build and run for production:

    npm run build
    npm start

The app is available at http://localhost:3000 in production or http://localhost:5173 in dev mode.

Note: The app starts even without a database β€” framework and mapping data are served from JSON files. Auth and progress endpoints return 503 until a database is reachable. Set STANDALONE_MODE=true to explicitly disable database features.


πŸ—‚οΈ Project Structure

Click to expand
src/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ components/          # Reusable Svelte components
β”‚   β”‚   β”œβ”€β”€ NavBar.svelte        # Top navigation bar
β”‚   β”‚   β”œβ”€β”€ FrameworkCard.svelte # Framework grid card
β”‚   β”‚   β”œβ”€β”€ FwBadge.svelte       # Coloured framework badge
β”‚   β”‚   β”œβ”€β”€ RelPill.svelte       # Mapping relationship pill
β”‚   β”‚   β”œβ”€β”€ ProgressBadge.svelte # Per-control progress indicator
β”‚   β”‚   β”œβ”€β”€ Modal.svelte         # Reusable modal dialog
β”‚   β”‚   β”œβ”€β”€ AuthModal.svelte     # Sign in / Sign up modal
β”‚   β”‚   └── DonutChart.svelte    # SVG donut chart for score
β”‚   β”œβ”€β”€ server/              # Server-only modules
β”‚   β”‚   β”œβ”€β”€ auth.js              # JWT helpers
β”‚   β”‚   β”œβ”€β”€ data.js              # Loads JSON data files
β”‚   β”‚   └── db.js                # PostgreSQL pool
β”‚   β”œβ”€β”€ api.js               # Client-side API fetch helpers
β”‚   β”œβ”€β”€ stores.js            # Svelte stores (auth, frameworks, progress)
β”‚   └── utils.js             # Shared utilities (progress cycle, preferences)
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ +layout.svelte       # Root layout (NavBar, data init)
β”‚   β”œβ”€β”€ +page.svelte         # Frameworks grid (home page)
β”‚   β”œβ”€β”€ frameworks/[id]/     # Framework detail + controls list
β”‚   β”œβ”€β”€ controls/            # Cross-framework mapping table
β”‚   β”œβ”€β”€ api-docs/            # Interactive REST API docs
β”‚   β”œβ”€β”€ dashboard/           # Progress dashboard
β”‚   β”œβ”€β”€ settings/            # Account settings (profile, password, API keys)
β”‚   └── api/                 # SvelteKit server routes (REST API)
β”‚       β”œβ”€β”€ frameworks/
β”‚       β”œβ”€β”€ controls/
β”‚       β”œβ”€β”€ mappings/
β”‚       β”œβ”€β”€ auth/            # register, login, me
β”‚       β”œβ”€β”€ progress/
β”‚       β”œβ”€β”€ settings/
β”‚       β”œβ”€β”€ stats/
β”‚       β”œβ”€β”€ themes/
β”‚       └── config/
└── hooks.server.js          # CORS headers + JSON error format for API routes

πŸ”Œ API Reference

πŸ“‚ Public endpoints (framework & mapping data)

Method Path Description
GET /api/frameworks List all frameworks
GET /api/frameworks/:id Get a single framework
GET /api/frameworks/:id/controls List controls for a framework
GET /api/controls List controls (optional ?framework= filter)
GET /api/controls/:id Get a single control
GET /api/mappings Query mappings (?from=, ?to=, ?control=, ?relationship=)
GET /api/mappings/:id Get a single mapping
GET /api/themes List unique themes across all controls
GET /api/stats Get summary statistics
GET /api/config Returns { dbEnabled: boolean }

πŸ” Authentication

Method Path Description
POST /api/auth/register Create a new account ({ email, password })
POST /api/auth/login Sign in ({ email, password }) β†’ returns JWT
GET /api/auth/me Validate token and return current user

πŸ“ˆ Progress tracking (requires Authorization: Bearer <token>)

Method Path Description
GET /api/progress List progress for all controls (?framework= filter)
PUT /api/progress/:controlId Set status for a control ({ status, notes? })
DELETE /api/progress/:controlId Remove progress entry for a control

Progress status values: not_started Β· in_progress Β· completed

βš™οΈ Settings (requires Authorization: Bearer <token>)

Method Path Description
GET /api/settings/profile Get profile
PATCH /api/settings/profile Update profile ({ username?, email? })
PATCH /api/settings/password Change password ({ currentPassword, newPassword })
GET /api/settings/apikeys List API keys
POST /api/settings/apikeys Create API key ({ name? })
DELETE /api/settings/apikeys/:id Revoke API key

πŸ§ͺ Running Tests

npm test

Tests cover all public API endpoints using the built SvelteKit server (runs npm run build first). The test runner is Node.js built-in node:test.


πŸ“„ License

This project is released under a custom Non-Commercial Use License. See the LICENSE file for the full terms.

βœ… Permitted Personal use, educational & research use, open-source projects, internal business use
❌ Prohibited Selling this software or derivatives, delivering paid services to clients, bundling in commercial products

For commercial licensing enquiries, open an issue or contact the maintainer via the repository.


Made with ❀️ by @veniplex

About

A web app and REST API that helps cybersecurity experts map overlapping controls across compliance frameworks such as ISO 27001, NIS2, GDPR, DORA, CIS Controls, NIST CSF, BSI IT Grundschutz and NIS2-Umsetzungsrichtline.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors