This document describes the high-level architecture of the Unraid API repository.
The repository consists of:
- API Server (NestJS)
- Redux Store
- Core Modules
- Tests
The API server is built with NestJS and provides the core functionality for interacting with Unraid systems.
src/unraid-api/- Core NestJS implementationsrc/core/- Legacy business logic and utilitiessrc/store/- Redux store and state managementsrc/common/- Shared utilities and types
The store manages application state through several modules:
config- User settings, authentication, and API configurationemhttp- Unraid system and array stateregistration- License managementcache- Application cachingdocker- Container managementupnp- UPnP functionalitydynamix- Plugin stateminigraph- Mothership connectivitynotifications- System notifications
Key listeners that handle side effects:
- Array state changes
- Configuration updates
- Remote access changes
- Server state updates
- UPnP changes
- WAN access changes
The store syncs data in two ways:
- Flash Storage - Persistent configuration
- Memory Storage - Runtime state
The repository is organized into several packages:
api/- NestJS API serverplugin/- Unraid plugin packageweb/- Frontend applicationunraid-ui/- Shared UI components
New development should focus on the NestJS implementation in src/unraid-api/:
- Create new features in
src/unraid-api/using NestJS patterns - Use dependency injection and NestJS modules
- Legacy code in
src/core/should be gradually migrated - State management still uses Redux store when needed
- Follow NestJS architectural patterns
- Use TypeScript decorators and strong typing
- Implement proper dependency injection
- Write unit tests for new services