# dennisbica/cruxsync architecture

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

- Interactive diagram: https://gitdiagram.com/dennisbica/cruxsync
- Repository: https://github.com/dennisbica/cruxsync

## Overview

CruxSync combines game discovery and metadata, personal library and review tracking, wishlist deal monitoring, and account management. Users interact through the Svelte app; the Kotlin/Javalin backend owns API routing, business logic, and access to PostgreSQL and upstream providers. The graph follows the documented client-to-server workflow and sampled backend calls; unsampled feature wiring is represented only where README capabilities support it.

Main entry points: [`backend/src/main/kotlin/Main.kt`](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/Main.kt) (HTTP routing), [`frontend/src/routes/+layout.svelte`](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/%2Blayout.svelte) (App shell), [`backend/src/main/kotlin/services/GameService.kt`](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/services/GameService.kt) (Game workflows), [`backend/src/main/kotlin/repositories/GameRepository.kt`](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/repositories/GameRepository.kt) (Game repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Svelte application"]
  node_app["App shell<br/>[+layout.svelte]"]
  node_discovery["Game discovery<br/>[+page.svelte]"]
  node_gamepage["Game details<br/>[+page.svelte]"]
  node_libraryui["Library<br/>[+page.svelte]"]
  node_wishlistui["Wishlist and deals<br/>[+page.svelte]"]
  node_reviewui["Review interface<br/>[gameReviews.svelte]"]
  node_profileui["Profile and settings<br/>[+page.svelte]"]
end

subgraph group_backend["Backend API"]
  node_server["HTTP routing<br/>[Main.kt]"]
  node_gamecontroller["Game API<br/>[GameController.kt]"]
  node_authcontroller["Account API<br/>[AuthController.kt]"]
  node_gameservice["Game workflows<br/>[GameService.kt]"]
  node_authservice["Authentication<br/>[AuthService.kt]"]
  node_gamerepo["Game repository<br/>[GameRepository.kt]"]
  node_userrepo["User repository<br/>[UserRepository.kt]"]
  node_igdbclient["IGDB client<br/>[IgdbClient.kt]"]
  node_cheapsharkclient["CheapShark client"]
end

subgraph group_storage["Relational data"]
  node_games[("Game catalog<br/>[Games.kt]")]
  node_library[("Library and wishlist<br/>[GameLibrary.kt]")]
  node_reviews[("Reviews<br/>[Reviews.kt]")]
  node_users[("Users and profiles<br/>[Users.kt]")]
  node_postgres[("PostgreSQL")]
end

subgraph group_providers["External providers"]
  node_igdb{{"IGDB"}}
  node_cheapshark{{"CheapShark"}}
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"opens"| node_discovery
node_app -->|"opens"| node_gamepage
node_app -->|"opens"| node_libraryui
node_app -->|"opens"| node_wishlistui
node_gamepage -->|"shows"| node_reviewui
node_reviewui -->|"requests reviews"| node_server
node_discovery -->|"requests catalog"| node_server
node_libraryui -->|"requests library"| node_server
node_wishlistui -->|"requests deals"| node_server
node_profileui -->|"requests account"| node_server
node_server -->|"dispatches game routes"| node_gamecontroller
node_server -->|"dispatches auth routes"| node_authcontroller
node_gamecontroller -->|"calls"| node_gameservice
node_authcontroller -->|"calls"| node_authservice
node_gameservice -->|"reads and writes"| node_gamerepo
node_gameservice -->|"searches metadata"| node_igdbclient
node_gameservice -->|"fetches prices"| node_cheapsharkclient
node_authservice -->|"reads and writes"| node_userrepo
node_gamerepo -->|"reads and writes"| node_games
node_gamerepo -->|"reads and writes"| node_library
node_gamerepo -->|"reads and writes"| node_reviews
node_userrepo -->|"reads and writes"| node_users
node_games -->|"persists in"| node_postgres
node_library -->|"persists in"| node_postgres
node_reviews -->|"persists in"| node_postgres
node_users -->|"persists in"| node_postgres
node_igdbclient -->|"queries"| node_igdb
node_cheapsharkclient -->|"queries"| node_cheapshark

click node_app "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/%2Blayout.svelte"
click node_discovery "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/discover/%2Bpage.svelte"
click node_gamepage "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/games/%5Bid%5D/%2Bpage.svelte"
click node_libraryui "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/library/%2Bpage.svelte"
click node_wishlistui "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/wishlist/%2Bpage.svelte"
click node_reviewui "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/lib/components/gamePage/gameReviews.svelte"
click node_profileui "https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/profile/%2Bpage.svelte"
click node_server "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/Main.kt"
click node_gamecontroller "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/controllers/GameController.kt"
click node_authcontroller "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/controllers/AuthController.kt"
click node_gameservice "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/services/GameService.kt"
click node_authservice "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/services/AuthService.kt"
click node_gamerepo "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/repositories/GameRepository.kt"
click node_userrepo "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/repositories/UserRepository.kt"
click node_games "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Games.kt"
click node_library "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/GameLibrary.kt"
click node_reviews "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Reviews.kt"
click node_users "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Users.kt"
click node_igdbclient "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/clients/IgdbClient.kt"
click node_cheapsharkclient "https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/clients/CheapSharkClient.kt"

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_app,node_discovery,node_gamepage,node_libraryui,node_wishlistui,node_reviewui,node_profileui,node_user toneBlue
class node_server,node_gamecontroller,node_authcontroller,node_gameservice,node_authservice,node_gamerepo,node_userrepo,node_igdbclient,node_cheapsharkclient toneAmber
class node_games,node_library,node_reviews,node_users,node_postgres toneMint
class node_igdb,node_cheapshark toneRose
```

## Components

### Svelte application

- [App shell](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/%2Blayout.svelte): `frontend/src/routes/+layout.svelte`
- [Game discovery](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/discover/%2Bpage.svelte): `frontend/src/routes/(app)/discover/+page.svelte`
- [Game details](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/games/%5Bid%5D/%2Bpage.svelte): `frontend/src/routes/(app)/games/[id]/+page.svelte`
- [Library](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/library/%2Bpage.svelte): `frontend/src/routes/(app)/library/+page.svelte`
- [Wishlist and deals](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/wishlist/%2Bpage.svelte): `frontend/src/routes/(app)/wishlist/+page.svelte`
- [Review interface](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/lib/components/gamePage/gameReviews.svelte): `frontend/src/lib/components/gamePage/gameReviews.svelte`
- [Profile and settings](https://github.com/dennisbica/cruxsync/blob/main/frontend/src/routes/(app)/profile/%2Bpage.svelte): `frontend/src/routes/(app)/profile/+page.svelte`

### Backend API

- [HTTP routing](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/Main.kt): `backend/src/main/kotlin/Main.kt`
- [Game API](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/controllers/GameController.kt): `backend/src/main/kotlin/controllers/GameController.kt`
- [Account API](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/controllers/AuthController.kt): `backend/src/main/kotlin/controllers/AuthController.kt`
- [Game workflows](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/services/GameService.kt): `backend/src/main/kotlin/services/GameService.kt`
- [Authentication](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/services/AuthService.kt): `backend/src/main/kotlin/services/AuthService.kt`
- [Game repository](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/repositories/GameRepository.kt): `backend/src/main/kotlin/repositories/GameRepository.kt`
- [User repository](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/repositories/UserRepository.kt): `backend/src/main/kotlin/repositories/UserRepository.kt`
- [IGDB client](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/clients/IgdbClient.kt): `backend/src/main/kotlin/clients/IgdbClient.kt`
- [CheapShark client](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/clients/CheapSharkClient.kt): `backend/src/main/kotlin/clients/CheapSharkClient.kt`

### Relational data

- [Game catalog](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Games.kt): `backend/src/main/kotlin/db/Games.kt`
- [Library and wishlist](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/GameLibrary.kt): `backend/src/main/kotlin/db/GameLibrary.kt`
- [Reviews](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Reviews.kt): `backend/src/main/kotlin/db/Reviews.kt`
- [Users and profiles](https://github.com/dennisbica/cruxsync/blob/main/backend/src/main/kotlin/db/Users.kt): `backend/src/main/kotlin/db/Users.kt`
- **PostgreSQL**

### External providers

- **IGDB**
- **CheapShark**

### Other components

- **User**

## Connections

- User → App shell: uses
- App shell → Game discovery: opens
- App shell → Game details: opens
- App shell → Library: opens
- App shell → Wishlist and deals: opens
- Game details → Review interface: shows
- Review interface → HTTP routing: requests reviews
- Game discovery → HTTP routing: requests catalog
- Library → HTTP routing: requests library
- Wishlist and deals → HTTP routing: requests deals
- Profile and settings → HTTP routing: requests account
- HTTP routing → Game API: dispatches game routes
- HTTP routing → Account API: dispatches auth routes
- Game API → Game workflows: calls
- Account API → Authentication: calls
- Game workflows → Game repository: reads and writes
- Game workflows → IGDB client: searches metadata
- Game workflows → CheapShark client: fetches prices
- Authentication → User repository: reads and writes
- Game repository → Game catalog: reads and writes
- Game repository → Library and wishlist: reads and writes
- Game repository → Reviews: reads and writes
- User repository → Users and profiles: reads and writes
- Game catalog → PostgreSQL: persists in
- Library and wishlist → PostgreSQL: persists in
- Reviews → PostgreSQL: persists in
- Users and profiles → PostgreSQL: persists in
- IGDB client → IGDB: queries
- CheapShark client → CheapShark: queries
