# bostads-ab-mimer/onecore architecture

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

- Interactive diagram: https://gitdiagram.com/bostads-ab-mimer/onecore
- Repository: https://github.com/bostads-ab-mimer/onecore

## Overview

ONECore is a monorepo platform of user-facing portals, an orchestration API, shared libraries, and domain microservices. The visible internal-portal workflow is staff navigating routed tools for parking-space listings, applicant/material-choice work, and listing-text editing; these tools use page-level hooks for data operations. The tree also documents keys and property-management portals and services for leasing, property, contacts, economy, files, inspections, and work orders. Source excerpts establish only selected UI and routing relationships; many service-to-service and portal-to-backend interactions are not shown and are omitted.

Main entry points: [`core/src/app.ts`](https://github.com/bostads-ab-mimer/onecore/blob/main/core/src/app.ts) (Core orchestration), [`apps/internal-portal/frontend/src/App.tsx`](https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/App.tsx) (Internal portal), [`apps/internal-portal/frontend/src/pages/ListingTextContent`](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingTextContent) (Listing content), [`apps/internal-portal/frontend/src/pages/ListingAreaTextContent`](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingAreaTextContent) (Area content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User portals"]
  node_internal_ui["Internal portal<br/>[App.tsx]"]
  node_parking_workflow["Parking operations"]
  node_listing_content["Listing content"]
  node_area_content["Area content"]
  node_residences["Residence profiles<br/>[Residences.tsx]"]
  node_material_choices["Material choices<br/>[Home.tsx]"]
  node_keys_portal["Keys portal"]
  node_property_tree["Property Tree"]
end

subgraph group_core["Core platform"]
  node_core_api["Core orchestration<br/>[app.ts]"]
  node_internal_backend["Portal backend<br/>[app.ts]"]
end

subgraph group_services["Domain services"]
  node_leasing["Leasing<br/>[app.ts]"]
  node_property["Property<br/>[app.ts]"]
  node_property_management["Property management<br/>[app.ts]"]
  node_contacts["Contacts<br/>[app.ts]"]
  node_keys_service["Keys service<br/>[app.ts]"]
  node_economy["Economy<br/>[app.ts]"]
  node_communication["Communication<br/>[app.ts]"]
  node_file_storage["File storage<br/>[app.ts]"]
  node_inspection["Inspection<br/>[app.ts]"]
  node_work_order["Work orders<br/>[app.ts]"]
end

subgraph group_shared["Shared libraries"]
  node_types["Shared types<br/>[file-storage.ts]"]
  node_utilities["Shared utilities"]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_internal_ui
node_internal_ui -->|"routes to"| node_parking_workflow
node_internal_ui -->|"routes to"| node_listing_content
node_internal_ui -->|"routes to"| node_area_content
node_internal_ui -->|"routes to"| node_residences
node_internal_ui -->|"routes to"| node_material_choices
node_listing_content -.->|"loads data"| node_internal_backend
node_area_content -.->|"loads data"| node_internal_backend
node_core_api -.->|"routes API"| node_leasing
node_core_api -.->|"routes API"| node_property
node_core_api -.->|"routes API"| node_contacts
node_core_api -.->|"routes API"| node_keys_service
node_core_api -.->|"routes API"| node_file_storage
node_core_api -.->|"routes API"| node_economy
node_core_api -.->|"routes API"| node_communication
node_core_api -.->|"routes API"| node_inspection
node_core_api -.->|"routes API"| node_property_management
node_core_api -.->|"routes API"| node_work_order
node_file_storage -.->|"uses schemas"| node_types
node_internal_ui -.->|"separate portal"| node_keys_portal
node_internal_ui -.->|"separate portal"| node_property_tree

click node_internal_ui "https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/App.tsx"
click node_parking_workflow "https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ParkingSpaces"
click node_listing_content "https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingTextContent"
click node_area_content "https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingAreaTextContent"
click node_residences "https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/pages/Residences/Residences.tsx"
click node_material_choices "https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/pages/Home/Home.tsx"
click node_keys_portal "https://github.com/bostads-ab-mimer/onecore/tree/main/apps/keys-portal/src/pages"
click node_property_tree "https://github.com/bostads-ab-mimer/onecore/tree/main/apps/property-tree/src"
click node_core_api "https://github.com/bostads-ab-mimer/onecore/blob/main/core/src/app.ts"
click node_internal_backend "https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/backend/src/app.ts"
click node_leasing "https://github.com/bostads-ab-mimer/onecore/blob/main/services/leasing/src/app.ts"
click node_property "https://github.com/bostads-ab-mimer/onecore/blob/main/services/property/src/app.ts"
click node_property_management "https://github.com/bostads-ab-mimer/onecore/blob/main/services/property-management/src/app.ts"
click node_contacts "https://github.com/bostads-ab-mimer/onecore/blob/main/services/contacts/src/app.ts"
click node_keys_service "https://github.com/bostads-ab-mimer/onecore/blob/main/services/keys/src/app.ts"
click node_economy "https://github.com/bostads-ab-mimer/onecore/blob/main/services/economy/src/app.ts"
click node_communication "https://github.com/bostads-ab-mimer/onecore/blob/main/services/communication/src/app.ts"
click node_file_storage "https://github.com/bostads-ab-mimer/onecore/blob/main/services/file-storage/src/app.ts"
click node_inspection "https://github.com/bostads-ab-mimer/onecore/blob/main/services/inspection/src/app.ts"
click node_work_order "https://github.com/bostads-ab-mimer/onecore/blob/main/services/work-order/src/app.ts"
click node_types "https://github.com/bostads-ab-mimer/onecore/blob/main/libs/types/src/file-storage.ts"
click node_utilities "https://github.com/bostads-ab-mimer/onecore/tree/main/libs/utilities/src"

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_internal_ui,node_parking_workflow,node_listing_content,node_area_content,node_residences,node_material_choices,node_keys_portal,node_property_tree,node_staff toneBlue
class node_core_api,node_internal_backend toneAmber
class node_leasing,node_property,node_property_management,node_contacts,node_keys_service,node_economy,node_communication,node_file_storage,node_inspection,node_work_order toneMint
class node_types,node_utilities toneRose
```

## Components

### User portals

- [Internal portal](https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/App.tsx): `apps/internal-portal/frontend/src/App.tsx`
- [Parking operations](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ParkingSpaces): `apps/internal-portal/frontend/src/pages/ParkingSpaces`
- [Listing content](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingTextContent): `apps/internal-portal/frontend/src/pages/ListingTextContent`
- [Area content](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/internal-portal/frontend/src/pages/ListingAreaTextContent): `apps/internal-portal/frontend/src/pages/ListingAreaTextContent`
- [Residence profiles](https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/pages/Residences/Residences.tsx): `apps/internal-portal/frontend/src/pages/Residences/Residences.tsx`
- [Material choices](https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/frontend/src/pages/Home/Home.tsx): `apps/internal-portal/frontend/src/pages/Home/Home.tsx`
- [Keys portal](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/keys-portal/src/pages): `apps/keys-portal/src/pages`
- [Property Tree](https://github.com/bostads-ab-mimer/onecore/tree/main/apps/property-tree/src): `apps/property-tree/src`

### Core platform

- [Core orchestration](https://github.com/bostads-ab-mimer/onecore/blob/main/core/src/app.ts): `core/src/app.ts`
- [Portal backend](https://github.com/bostads-ab-mimer/onecore/blob/main/apps/internal-portal/backend/src/app.ts): `apps/internal-portal/backend/src/app.ts`

### Domain services

- [Leasing](https://github.com/bostads-ab-mimer/onecore/blob/main/services/leasing/src/app.ts): `services/leasing/src/app.ts`
- [Property](https://github.com/bostads-ab-mimer/onecore/blob/main/services/property/src/app.ts): `services/property/src/app.ts`
- [Property management](https://github.com/bostads-ab-mimer/onecore/blob/main/services/property-management/src/app.ts): `services/property-management/src/app.ts`
- [Contacts](https://github.com/bostads-ab-mimer/onecore/blob/main/services/contacts/src/app.ts): `services/contacts/src/app.ts`
- [Keys service](https://github.com/bostads-ab-mimer/onecore/blob/main/services/keys/src/app.ts): `services/keys/src/app.ts`
- [Economy](https://github.com/bostads-ab-mimer/onecore/blob/main/services/economy/src/app.ts): `services/economy/src/app.ts`
- [Communication](https://github.com/bostads-ab-mimer/onecore/blob/main/services/communication/src/app.ts): `services/communication/src/app.ts`
- [File storage](https://github.com/bostads-ab-mimer/onecore/blob/main/services/file-storage/src/app.ts): `services/file-storage/src/app.ts`
- [Inspection](https://github.com/bostads-ab-mimer/onecore/blob/main/services/inspection/src/app.ts): `services/inspection/src/app.ts`
- [Work orders](https://github.com/bostads-ab-mimer/onecore/blob/main/services/work-order/src/app.ts): `services/work-order/src/app.ts`

### Shared libraries

- [Shared types](https://github.com/bostads-ab-mimer/onecore/blob/main/libs/types/src/file-storage.ts): `libs/types/src/file-storage.ts`
- [Shared utilities](https://github.com/bostads-ab-mimer/onecore/tree/main/libs/utilities/src): `libs/utilities/src`

### Other components

- **Staff user**

## Connections

- Staff user → Internal portal: uses (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Internal portal → Parking operations: routes to (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Internal portal → Listing content: routes to (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Internal portal → Area content: routes to (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Internal portal → Residence profiles: routes to (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Internal portal → Material choices: routes to (evidence: `apps/internal-portal/frontend/src/App.tsx`)
- Listing content → Portal backend: loads data
- Area content → Portal backend: loads data
- Core orchestration → Leasing: routes API
- Core orchestration → Property: routes API
- Core orchestration → Contacts: routes API
- Core orchestration → Keys service: routes API
- Core orchestration → File storage: routes API
- Core orchestration → Economy: routes API
- Core orchestration → Communication: routes API
- Core orchestration → Inspection: routes API
- Core orchestration → Property management: routes API
- Core orchestration → Work orders: routes API
- File storage → Shared types: uses schemas
- Internal portal → Keys portal: separate portal
- Internal portal → Property Tree: separate portal
