# navikt/nada-markedsplassen architecture

> Architecture diagram of the GitHub repository navikt/nada-markedsplassen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/navikt/nada-markedsplassen
- Repository: https://github.com/navikt/nada-markedsplassen

## Overview

NAV’s Data Markedsplassen is an internal web application for organizing, discovering, and managing shared data and enabling collaboration. Users discover product areas and search, then can manage data products, datasets, access, Metabase publishing, stories, and workstations through the frontend and Go backend. The graph preserves these documented and tree-visible product areas, while detailing the sampled BigQuery request path and backend storage composition. Many frontend and backend domain modules were not sampled, so their internal call relationships are omitted rather than inferred.

Main entry points: [`pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go`](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go) (Missing-table cleanup), [`frontend/pages/index.tsx`](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/pages/index.tsx) (Home and discovery), [`pkg/service/core/service_bigquery.go`](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_bigquery.go) (BigQuery service), [`frontend/components/dataproducts/queries.tsx`](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/dataproducts/queries.tsx) (Data product UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_home["Home and discovery<br/>[index.tsx]"]
  node_search["Search<br/>[search.tsx]"]
  node_product_ui["Data product UI<br/>[queries.tsx]"]
  node_metabase_ui["Metabase publishing UI"]
  node_workstation_ui["Workstation UI<br/>[queries.tsx]"]
  node_rest["REST request client<br/>[request.ts]"]
end

subgraph group_backend["Backend API"]
  node_routes["HTTP routes"]
  node_handlers["BigQuery handlers"]
  node_bq_service["BigQuery service"]
  node_storage_factory["Storage composition<br/>[storage.go]"]
  node_postgres[("Postgres stores")]
  node_database[("Postgres database<br/>[repo.go]")]
  node_backend_main["Backend runtime<br/>[main.go]"]
end

subgraph group_domain["Data capabilities"]
  node_products["Data products and access"]
  node_insights["Insight products and stories"]
  node_workstations["Workstations"]
  node_metabase["Metabase integration"]
  node_bigquery["BigQuery<br/>[bq.go]"]
end

subgraph group_ops["Platform operations"]
  node_syncers["Scheduled synchronizers<br/>[syncers.go]"]
  node_missing_sync["Missing-table cleanup"]
end

node_user(("NAV user"))

node_user -->|"opens"| node_home
node_user -.->|"searches"| node_search
node_home -.->|"submits search"| node_search
node_home -.->|"navigates to"| node_product_ui
node_product_ui -->|"uses requests"| node_rest
node_metabase_ui -->|"uses queries"| node_product_ui
node_workstation_ui -.->|"uses requests"| node_rest
node_backend_main -.->|"registers routes"| node_routes
node_routes -->|"builds endpoints"| node_handlers
node_handlers -->|"calls service"| node_bq_service
node_storage_factory -->|"creates stores"| node_postgres
node_postgres -.->|"uses repository"| node_database
node_backend_main -->|"starts synchronizers"| node_syncers
node_syncers -.->|"runs cleanup"| node_missing_sync
node_missing_sync -->|"checks tables"| node_bigquery
node_missing_sync -->|"deletes database"| node_metabase
node_missing_sync -->|"deletes dataset"| node_products
node_bq_service -->|"fetches metadata"| node_bigquery
node_bq_service -.->|"updates metadata"| node_postgres

click node_home "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/pages/index.tsx"
click node_search "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/pages/search.tsx"
click node_product_ui "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/dataproducts/queries.tsx"
click node_metabase_ui "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/dataproducts/metabaseBigquery.tsx"
click node_workstation_ui "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/workstation/queries.tsx"
click node_rest "https://github.com/navikt/nada-markedsplassen/blob/main/frontend/lib/rest/request.ts"
click node_routes "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/routes/routes_big_query.go"
click node_handlers "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/handlers/handler_bigquery.go"
click node_bq_service "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_bigquery.go"
click node_storage_factory "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/storage/storage.go"
click node_postgres "https://github.com/navikt/nada-markedsplassen/tree/main/pkg/service/core/storage/postgres"
click node_database "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/database/repo.go"
click node_products "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_dataproducts.go"
click node_insights "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_insight_product.go"
click node_workstations "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_workstations.go"
click node_metabase "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_metabase.go"
click node_bigquery "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/bq/bq.go"
click node_backend_main "https://github.com/navikt/nada-markedsplassen/blob/main/cmd/nada-backend/main.go"
click node_syncers "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/syncers/syncers.go"
click node_missing_sync "https://github.com/navikt/nada-markedsplassen/blob/main/pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_search,node_product_ui,node_metabase_ui,node_workstation_ui,node_rest,node_user toneBlue
class node_routes,node_handlers,node_bq_service,node_storage_factory,node_postgres,node_database,node_backend_main toneAmber
class node_products,node_insights,node_workstations,node_metabase,node_bigquery toneMint
class node_syncers,node_missing_sync toneRose
```

## Components

### Frontend

- [Home and discovery](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/pages/index.tsx): `frontend/pages/index.tsx`
- [Search](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/pages/search.tsx): `frontend/pages/search.tsx`
- [Data product UI](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/dataproducts/queries.tsx): `frontend/components/dataproducts/queries.tsx`
- [Metabase publishing UI](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/dataproducts/metabaseBigquery.tsx): `frontend/components/dataproducts/metabaseBigquery.tsx`
- [Workstation UI](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/components/workstation/queries.tsx): `frontend/components/workstation/queries.tsx`
- [REST request client](https://github.com/navikt/nada-markedsplassen/blob/main/frontend/lib/rest/request.ts): `frontend/lib/rest/request.ts`

### Backend API

- [HTTP routes](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/routes/routes_big_query.go): `pkg/service/core/routes/routes_big_query.go`
- [BigQuery handlers](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/handlers/handler_bigquery.go): `pkg/service/core/handlers/handler_bigquery.go`
- [BigQuery service](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_bigquery.go): `pkg/service/core/service_bigquery.go`
- [Storage composition](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/storage/storage.go): `pkg/service/core/storage/storage.go`
- [Postgres stores](https://github.com/navikt/nada-markedsplassen/tree/main/pkg/service/core/storage/postgres): `pkg/service/core/storage/postgres`
- [Postgres database](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/database/repo.go): `pkg/database/repo.go`
- [Backend runtime](https://github.com/navikt/nada-markedsplassen/blob/main/cmd/nada-backend/main.go): `cmd/nada-backend/main.go`

### Data capabilities

- [Data products and access](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_dataproducts.go): `pkg/service/core/service_dataproducts.go`
- [Insight products and stories](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_insight_product.go): `pkg/service/core/service_insight_product.go`
- [Workstations](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_workstations.go): `pkg/service/core/service_workstations.go`
- [Metabase integration](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/service/core/service_metabase.go): `pkg/service/core/service_metabase.go`
- [BigQuery](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/bq/bq.go): `pkg/bq/bq.go`

### Platform operations

- [Scheduled synchronizers](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/syncers/syncers.go): `pkg/syncers/syncers.go`
- [Missing-table cleanup](https://github.com/navikt/nada-markedsplassen/blob/main/pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go): `pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go`

### Other components

- **NAV user**

## Connections

- NAV user → Home and discovery: opens (evidence: `frontend/pages/index.tsx`)
- NAV user → Search: searches
- Home and discovery → Search: submits search
- Home and discovery → Data product UI: navigates to
- Data product UI → REST request client: uses requests (evidence: `frontend/components/dataproducts/queries.tsx`)
- Metabase publishing UI → Data product UI: uses queries (evidence: `frontend/components/dataproducts/metabaseBigquery.tsx`)
- Workstation UI → REST request client: uses requests
- Backend runtime → HTTP routes: registers routes
- HTTP routes → BigQuery handlers: builds endpoints (evidence: `pkg/service/core/routes/routes_big_query.go`)
- BigQuery handlers → BigQuery service: calls service (evidence: `pkg/service/core/handlers/handler_bigquery.go`)
- Storage composition → Postgres stores: creates stores (evidence: `pkg/service/core/storage/storage.go`)
- Postgres stores → Postgres database: uses repository
- Backend runtime → Scheduled synchronizers: starts synchronizers (evidence: `cmd/nada-backend/main.go`)
- Scheduled synchronizers → Missing-table cleanup: runs cleanup
- Missing-table cleanup → BigQuery: checks tables (evidence: `pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go`)
- Missing-table cleanup → Metabase integration: deletes database (evidence: `pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go`)
- Missing-table cleanup → Data products and access: deletes dataset (evidence: `pkg/syncers/bigquery_datasource_missing/bigquery_datasource_missing.go`)
- BigQuery service → BigQuery: fetches metadata (evidence: `pkg/service/core/service_bigquery.go`)
- BigQuery service → Postgres stores: updates metadata
