Unraid API Development Workflows
This document outlines the various workflow styles available for developing, building, and deploying the Unraid API monorepo.
Repository Structure
The Unraid API monorepo consists of several packages:
api: The Unraid API backendweb: The web frontend componentsplugin: The Unraid pluginunraid-ui: UI components library
Development Workflows
Local Development
To start all development servers in the monorepo:
This command runs all development servers concurrently:
- API server: http://localhost:3001
- Web components: http://localhost:4321
- UI components: http://localhost:5173
Package-Specific Development
If you want to work on a specific package, you can run its development server individually:
API Development
Web Development
UI Component Development
Building Workflows
Building All Packages
To build all packages in the monorepo:
Plugin Building (Docker Required)
The plugin build requires Docker. This command automatically builds all dependencies (API, web) before starting Docker:
cd plugin pnpm run docker:build-and-run # Then inside the container: pnpm build
This serves the plugin at http://YOUR_IP:5858/ for installation on your Unraid server.
Package-Specific Building
API Building
Web Building
Development Build for Web
Deployment Workflows
Deploying to Development Unraid Server
To deploy to a development Unraid server:
pnpm unraid:deploy <SERVER_IP>
This command builds and deploys all components to the specified Unraid server.
Package-Specific Deployment
API Deployment
cd api pnpm unraid:deploy <SERVER_IP>
Web Deployment
cd web pnpm unraid:deploy <SERVER_IP>
Plugin Deployment
cd plugin pnpm unraid:deploy <SERVER_IP>
Testing
To run tests across all packages:
Package-Specific Testing
cd <package-directory> pnpm test
Code Quality Workflows
Linting
To lint all packages:
To automatically fix linting issues:
Type Checking
To run type checking across all packages:
GraphQL Codegen Workflows
For packages that use GraphQL, you can generate types from your schema:
cd <package-directory> pnpm codegen
To watch for changes and regenerate types:
cd <package-directory> pnpm codegen:watch
Docker Workflows
The API package supports Docker-based development:
cd api pnpm container:build # Build the Docker container pnpm container:start # Start the container pnpm container:stop # Stop the container pnpm container:enter # Enter the container shell pnpm container:test # Run tests in the container
CLI Commands
When working with a deployed Unraid API, you can use the CLI:
Recommended Workflow for New Developers
- Clone the repository:
git clone git@github.com:unraid/api.git - Set up the monorepo:
just setuporpnpm install - Start development servers:
pnpm dev - Make your changes
- Test your changes:
pnpm test - Deploy to a development server:
pnpm unraid:deploy <SERVER_IP> - Verify your changes on the Unraid server
If using nix, run nix develop from the root of the repo before Step 2.