mirror of
https://github.com/unraid/api.git
synced 2026-01-02 06:30:02 -06:00
- also add better watcher support <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a helper that displays a local installation URL to simplify setting up the plugin. - **Chores** - Updated service and container port configurations to ensure consistent network connectivity (changed from 8080 to 5858). - Refined container management to gracefully handle running instances during startup. - Improved build and installation routines for streamlined deployment and enhanced reliability. - Enhanced documentation to clarify installation and usage instructions for better user experience. - Introduced a new document outlining development workflows for better guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209561202532053
2.0 KiB
2.0 KiB
Repository Organization
This document describes the high-level architecture of the Unraid API repository.
Overview
The repository consists of:
- API Server (NestJS)
- Redux Store
- Core Modules
- Tests
API Server Architecture
The API server is built with NestJS and provides the core functionality for interacting with Unraid systems.
Key Components
src/unraid-api/- Core NestJS implementationsrc/core/- Legacy business logic and utilitiessrc/store/- Redux store and state managementsrc/common/- Shared utilities and types
Redux Store
The store manages application state through several modules:
Store 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
Store Listeners
Key listeners that handle side effects:
- Array state changes
- Configuration updates
- Remote access changes
- Server state updates
- UPnP changes
- WAN access changes
Store Synchronization
The store syncs data in two ways:
- Flash Storage - Persistent configuration
- Memory Storage - Runtime state
Project Structure
The repository is organized into several packages:
api/- NestJS API serverplugin/- Unraid plugin packageweb/- Frontend applicationunraid-ui/- Shared UI components
Development Flow
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
Best Practices
- Follow NestJS architectural patterns
- Use TypeScript decorators and strong typing
- Implement proper dependency injection
- Write unit tests for new services