# bookpauk/inpx-web architecture

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

- Interactive diagram: https://gitdiagram.com/bookpauk/inpx-web
- Repository: https://github.com/bookpauk/inpx-web

## Overview

inpx-web is a web and OPDS server for searching and retrieving books from an .inpx-indexed library. The main workflow is browser search over WebSocket, server-side catalog lookup, then retrieval of a book from disk or a ZIP archive. The README also documents OPDS access, access-password protection, remote-library mode, filtering during search-database creation, and automatic database refresh. Some internal wiring is based on documented roles and filenames; unsampled calls are omitted where ownership is uncertain.

Main entry points: [`server/core/WebWorker.js`](https://github.com/bookpauk/inpx-web/blob/master/server/core/WebWorker.js) (Library worker), [`server/index.js`](https://github.com/bookpauk/inpx-web/blob/master/server/index.js) (HTTP server), [`server/controllers/WebSocketController.js`](https://github.com/bookpauk/inpx-web/blob/master/server/controllers/WebSocketController.js) (Socket controller), [`server/core/DbCreator.js`](https://github.com/bookpauk/inpx-web/blob/master/server/core/DbCreator.js) (Database creator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web interface"]
  node_browser["Browser UI<br/>[App.vue]"]
  node_searchui["Search views<br/>[Search.vue]"]
  node_clientapi["WebSocket API<br/>[Api.vue]"]
  node_socketclient["Socket connection"]
end

subgraph group_runtime["Server runtime"]
  node_server["HTTP server<br/>[index.js]"]
  node_access["Access control<br/>[WebAccess.js]"]
  node_controller["Socket controller"]
  node_config["Configuration<br/>[index.js]"]
end

subgraph group_search["Catalog indexing"]
  node_worker["Library worker<br/>[WebWorker.js]"]
  node_searcher["Database search<br/>[DbSearcher.js]"]
  node_database[("Search database")]
  node_dbcreator["Database creator<br/>[DbCreator.js]"]
  node_inpxparser["INPX parser<br/>[InpxParser.js]"]
  node_filter["Catalog filter<br/>[InpxParser.js]"]
end

subgraph group_library["Library access"]
  node_zipreader["ZIP reader<br/>[ZipReader.js]"]
  node_remote["Remote library<br/>[RemoteLib.js]"]
end

subgraph group_protocols["Catalog interfaces"]
  node_opds["OPDS routes<br/>[index.js]"]
  node_static["Static files<br/>[static.js]"]
end

node_reader(("Library reader"))
node_inpxfile["INPX index"]
node_books[("Book archives")]

node_reader -->|"browses"| node_browser
node_browser -->|"opens"| node_searchui
node_searchui -->|"requests"| node_clientapi
node_clientapi -->|"uses"| node_socketclient
node_socketclient -->|"sends requests"| node_controller
node_server -->|"registers"| node_controller
node_server -->|"mounts routes"| node_opds
node_server -->|"serves files"| node_static
node_controller -->|"checks access"| node_access
node_controller -->|"dispatches actions"| node_worker
node_worker -->|"searches"| node_searcher
node_searcher -->|"queries"| node_database
node_worker -->|"creates database"| node_dbcreator
node_dbcreator -->|"parses index"| node_inpxparser
node_inpxparser -->|"reads"| node_inpxfile
node_dbcreator -.->|"applies filter"| node_filter
node_worker -->|"extracts books"| node_zipreader
node_zipreader -->|"reads archives"| node_books
node_worker -.->|"uses when configured"| node_remote
node_remote -.->|"downloads index"| node_inpxfile
node_server -->|"loads settings"| node_config

click node_browser "https://github.com/bookpauk/inpx-web/blob/master/client/components/App.vue"
click node_searchui "https://github.com/bookpauk/inpx-web/blob/master/client/components/Search/Search.vue"
click node_clientapi "https://github.com/bookpauk/inpx-web/blob/master/client/components/Api/Api.vue"
click node_socketclient "https://github.com/bookpauk/inpx-web/blob/master/client/components/Api/webSocketConnection.js"
click node_server "https://github.com/bookpauk/inpx-web/blob/master/server/index.js"
click node_access "https://github.com/bookpauk/inpx-web/blob/master/server/core/WebAccess.js"
click node_controller "https://github.com/bookpauk/inpx-web/blob/master/server/controllers/WebSocketController.js"
click node_worker "https://github.com/bookpauk/inpx-web/blob/master/server/core/WebWorker.js"
click node_searcher "https://github.com/bookpauk/inpx-web/blob/master/server/core/DbSearcher.js"
click node_dbcreator "https://github.com/bookpauk/inpx-web/blob/master/server/core/DbCreator.js"
click node_inpxparser "https://github.com/bookpauk/inpx-web/blob/master/server/core/InpxParser.js"
click node_filter "https://github.com/bookpauk/inpx-web/blob/master/server/core/InpxParser.js"
click node_zipreader "https://github.com/bookpauk/inpx-web/blob/master/server/core/ZipReader.js"
click node_remote "https://github.com/bookpauk/inpx-web/blob/master/server/core/RemoteLib.js"
click node_opds "https://github.com/bookpauk/inpx-web/blob/master/server/core/opds/index.js"
click node_static "https://github.com/bookpauk/inpx-web/blob/master/server/static.js"
click node_config "https://github.com/bookpauk/inpx-web/blob/master/server/config/index.js"

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_browser,node_searchui,node_clientapi,node_socketclient toneBlue
class node_server,node_access,node_controller,node_config,node_books toneAmber
class node_worker,node_searcher,node_database,node_dbcreator,node_inpxparser,node_filter toneMint
class node_zipreader,node_remote toneRose
class node_opds,node_static,node_reader,node_inpxfile toneIndigo
```

## Components

### Web interface

- [Browser UI](https://github.com/bookpauk/inpx-web/blob/master/client/components/App.vue): `client/components/App.vue`
- [Search views](https://github.com/bookpauk/inpx-web/blob/master/client/components/Search/Search.vue): `client/components/Search/Search.vue`
- [WebSocket API](https://github.com/bookpauk/inpx-web/blob/master/client/components/Api/Api.vue): `client/components/Api/Api.vue`
- [Socket connection](https://github.com/bookpauk/inpx-web/blob/master/client/components/Api/webSocketConnection.js): `client/components/Api/webSocketConnection.js`

### Server runtime

- [HTTP server](https://github.com/bookpauk/inpx-web/blob/master/server/index.js): `server/index.js`
- [Access control](https://github.com/bookpauk/inpx-web/blob/master/server/core/WebAccess.js): `server/core/WebAccess.js`
- [Socket controller](https://github.com/bookpauk/inpx-web/blob/master/server/controllers/WebSocketController.js): `server/controllers/WebSocketController.js`
- [Configuration](https://github.com/bookpauk/inpx-web/blob/master/server/config/index.js): `server/config/index.js`

### Catalog indexing

- [Library worker](https://github.com/bookpauk/inpx-web/blob/master/server/core/WebWorker.js): `server/core/WebWorker.js`
- [Database search](https://github.com/bookpauk/inpx-web/blob/master/server/core/DbSearcher.js): `server/core/DbSearcher.js`
- **Search database**
- [Database creator](https://github.com/bookpauk/inpx-web/blob/master/server/core/DbCreator.js): `server/core/DbCreator.js`
- [INPX parser](https://github.com/bookpauk/inpx-web/blob/master/server/core/InpxParser.js): `server/core/InpxParser.js`
- [Catalog filter](https://github.com/bookpauk/inpx-web/blob/master/server/core/InpxParser.js): `server/core/InpxParser.js`

### Library access

- [ZIP reader](https://github.com/bookpauk/inpx-web/blob/master/server/core/ZipReader.js): `server/core/ZipReader.js`
- [Remote library](https://github.com/bookpauk/inpx-web/blob/master/server/core/RemoteLib.js): `server/core/RemoteLib.js`

### Catalog interfaces

- [OPDS routes](https://github.com/bookpauk/inpx-web/blob/master/server/core/opds/index.js): `server/core/opds/index.js`
- [Static files](https://github.com/bookpauk/inpx-web/blob/master/server/static.js): `server/static.js`

### Other components

- **Library reader**
- **INPX index**
- **Book archives**

## Connections

- Library reader → Browser UI: browses
- Browser UI → Search views: opens
- Search views → WebSocket API: requests
- WebSocket API → Socket connection: uses
- Socket connection → Socket controller: sends requests
- HTTP server → Socket controller: registers
- HTTP server → OPDS routes: mounts routes
- HTTP server → Static files: serves files
- Socket controller → Access control: checks access
- Socket controller → Library worker: dispatches actions
- Library worker → Database search: searches
- Database search → Search database: queries
- Library worker → Database creator: creates database
- Database creator → INPX parser: parses index
- INPX parser → INPX index: reads
- Database creator → Catalog filter: applies filter
- Library worker → ZIP reader: extracts books
- ZIP reader → Book archives: reads archives
- Library worker → Remote library: uses when configured
- Remote library → INPX index: downloads index
- HTTP server → Configuration: loads settings
