Skip to main content

Architecture

Wizarr uses a traditional client-server design, with a dedicated database for data persistence. The frontend clients communicate with backend services over HTTP using REST APIs. Below is a high level diagram of the architecture.

High Level Diagram​

danger

Insert PHOTO Here

The diagram shows clients communicating with the server's API via REST. The server communicates with downstream systems (i.e. Redis, Postgres, file system) through repository interfaces.

Clients​

info

Our client uses OpenAPI to auto-generate rest clients for easy integration. For more information about this process, see OpenAPI.

Web Client​

The web app is a TypeScript project that uses Vue.js and Tailwindcss.

Server​

The Wizarr backend is divided into several services, which are run as individual docker containers.

  1. wizarr-server - Handle and respond to REST API requests and hosts the web client
  2. postgres - Persistent data storage
  3. redis- Queue management for wizarr-server

Wizarr Server​

The Wizarr Server is a TypeScript project written for Node.js. It uses the Koa.js framework, with TypeORM for database management. The server codebase also loosely follows the MVP Architecture.

REST Endpoints​

The server is a list of HTTP endpoints and associated handlers (controllers). Each controller usually implements the following CRUD operations:

  • POST /<type> - Create
  • GET /<type> - Read (all)
  • GET /<type>/:id - Read (by id)
  • PUT /<type>/:id - Updated (by id)
  • DELETE /<type>/:id - Delete (by id)

DTOs​

The server uses Domain Transfer Objects as public interfaces for the inputs (query, params, and body) and outputs (response) for each endpoint. DTOs translate to OpenAPI schemas and control the generated code used by each client.

Postgres​

Wizarr persists data in Postgres, which includes information about access and authorization, users, settings, etc.

info

See Database Migrations for more information about how to modify the database to create an index, modify a table, add a new column, etc.

Redis​

Wizarr uses Redis via BullMQ to manage job queues. Some jobs trigger subsequent jobs.