### Start Docker Containers Source: https://github.com/dictionarry-hub/profilarr/wiki/Developing-Custom-Formats-&-Quality-Profiles Run this command to start the Radarr and Sonarr Docker containers. Ensure Docker is installed and configured. ```bash docker-compose up -d ``` -------------------------------- ### Clone Repository and Start Development Server Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Clone the Profilarr repository, navigate into the directory, and start the development server using Deno tasks. ```bash git clone https://github.com/Dictionarry-Hub/profilarr.git cd profilarr den o task dev ``` -------------------------------- ### Schema Versioning Example Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/schema-bump.md Provides examples of how to bump the schema version in 'pcd.json' based on the type of change introduced. ```markdown | Change type | | --------------------------------------------------- | | Additive column/table with default (compatible) | | Breaking change (rename, drop, NOT NULL no default) | | Bump | Example | | ----- | ----------------- | | Minor | `1.0.0` → `1.1.0` | | Major | `1.0.0` → `2.0.0` | ``` -------------------------------- ### Clone Repository and Start Development Server Source: https://github.com/dictionarry-hub/profilarr/blob/develop/README.md Clone the Profilarr repository and start the development server using Deno tasks. This command runs the parser service and Vite dev server concurrently. ```bash git clone https://github.com/Dictionarry-Hub/profilarr.git cd profilarr denp task dev ``` -------------------------------- ### Fixture Builder Examples Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/pcd-tests.md Examples of using fixture builders to generate SQL and metadata for tests. These builders simplify test setup by abstracting repetitive seeding logic. ```typescript base.regex({ name, pattern, description }); ``` ```typescript user.regex.update(name, { pattern: { from, to } }); ``` ```typescript upstream.regex.update(name, { pattern: { from, to } }); ``` -------------------------------- ### Build Information Configuration Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/announcements.md TypeScript examples for configuring build information, showing both a stable build and a development build with placeholder values. ```typescript // stable, up to date against the live bulletin export const build: BuildInfo = { version: '1.1.4', channel: 'stable', commit: 'abc1234' }; // develop export const build: BuildInfo = { version: '', channel: 'develop', commit: '' }; ``` -------------------------------- ### Serve Dev Bulletin Fixtures Source: https://github.com/dictionarry-hub/profilarr/blob/develop/scripts/dev-bulletin/README.md Starts a local server to serve fake bulletin data. Point `PROFILARR_BULLETIN_URL` to this endpoint for testing. ```bash # Terminal 1: serve fixtures on http://localhost:6970 deno task dev:bulletin ``` ```bash # Terminal 2: run dev with PROFILARR_BULLETIN_URL pointed at the fake PROFILARR_BULLETIN_URL=http://localhost:6970 deno task dev ``` -------------------------------- ### Start a New Feature Branch Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Branch off the 'develop' branch and give it a descriptive name to start working on new features. ```bash git checkout develop git pull git checkout -b feat/settings-redesign ``` -------------------------------- ### Source Name Convention Example Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/logger.md Illustrates the recommended naming convention for the `source` field in log entries, emphasizing clarity and grep-friendliness. ```text Good: source: 'sync.qualityProfiles' // action goes in the message Bad: source: 'transform.qualityProfile' // breaks grep "sync\." ``` -------------------------------- ### Add Target Element for Onboarding Step Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of adding a data attribute to an HTML element to serve as a target for an onboarding step. ```svelte
...
``` -------------------------------- ### Console Output Format Example Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/logger.md Illustrates the human-readable, ANSI-colored format for console logs, including timestamp, level, message, source, and metadata. ```text 2026-04-14T12:00:00.000Z | INFO | Sync processing complete | [SyncProcessor] | {"totalSynced":4} ``` -------------------------------- ### versions.json Structure Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/announcements.md Example of the `versions.json` file, detailing release channels, latest versions, and release history. This file is rebuilt hourly by a GitHub workflow. ```json { "schema": 1, "updated_at": "2026-04-20T10:00:00Z", "channels": { "stable": { "latest": "2.3.0", "releases": [ { "tag": "2.3.0", "published_at": "2026-04-15T12:00:00Z", "url": "https://github.com/Dictionarry-Hub/profilarr/releases/tag/v2.3.0" } ] }, "develop": { "latest": "abc1234", "published_at": "2026-04-20T10:00:00Z" } } } ``` -------------------------------- ### Conventional Commit Message Examples Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Examples of commit messages following the conventional commit format, used for PR titles when squash merging. ```text feat: add regex filter type fix: sync status not updating after save refactor: extract profile compilation logic ``` -------------------------------- ### Semantic Versioning Examples Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Use Semantic Versioning for tags, indicating bug fixes, new features, or breaking changes. ```markdown | Change | Example | | --------------- | ------------------- | | Bug fix | `v2.1.0` → `v2.1.1` | | New feature | `v2.1.0` → `v2.2.0` | | Breaking change | `v2.1.0` → `v3.0.0` | ``` -------------------------------- ### PCD Manifest Example Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/pcd.md This JSON object represents the manifest file (`pcd.json`) for a PCD repository, defining its name, version, description, supported Arr types, and dependencies. ```json { "name": "db", "version": "2.1.35", "description": "Seraphys' OCD Playground", "arr_types": ["radarr", "sonarr", "whisparr"], "dependencies": { "schema": "^1.1.0" } } ``` -------------------------------- ### File Output Format Example Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/logger.md Shows the JSON object format used for file logging, with fields for timestamp, level, message, source, and metadata. ```json { "timestamp": "2026-04-14T12:00:00.000Z", "level": "INFO", "message": "Sync processing complete", source": "SyncProcessor", "meta": { "totalSynced": 4 } } ``` -------------------------------- ### Start a New Feature Branch Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/DEVELOPMENT.md Begin a new feature by checking out the develop branch, pulling the latest changes, and creating a new feature branch. ```bash git checkout develop git pull git checkout -b feat/settings-page ``` -------------------------------- ### Logger Instantiation for Testing Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/logger.md Provides an example of how to instantiate the `Logger` class directly for testing purposes, allowing custom configuration like a temporary log directory and minimum log level. ```typescript import { Logger } from '$logger/logger.ts'; const testLogger = new Logger({ logsDir: '/tmp/test-logs', minLevel: 'DEBUG' }); ``` -------------------------------- ### Register New Stage Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of registering a newly defined stage into the global STAGES record. This makes the stage available for use in the application. ```typescript // definitions/index.ts import { myStage } from './stages/my-stage.ts'; export const STAGES: Record = { // ...existing 'my-stage': myStage }; ``` -------------------------------- ### Basic API Endpoint Handler Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/api.md Example of a basic SvelteKit request handler for an API endpoint, exporting a named HTTP method function. ```typescript import { json } from '@sveltejs/kit'; import type { RequestHandler } from '@sveltejs/kit'; export const GET: RequestHandler = async () => { return json(data); }; ``` -------------------------------- ### Define a New Stage Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of defining a new stage with its ID, name, description, and a list of steps. Each step has an ID, target element, title, body, position, and completion criteria. ```typescript // definitions/stages/my-stage.ts import type { Stage } from '../../types.ts'; export const myStage: Stage = { id: 'my-stage', name: 'My Stage', description: 'What this stage teaches', steps: [ { id: 'first-step', target: 'my-target', title: 'Do This', body: 'Click the thing to continue.', position: 'right', completion: { type: 'click' } } ] }; ``` -------------------------------- ### Navigate to Directory Source: https://github.com/dictionarry-hub/profilarr/wiki/Contributing Move into the cloned repository directory. ```bash cd ``` -------------------------------- ### GET /health Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/parser.md Checks the health status of the Parser microservice. ```APIDOC ## GET /health ### Description Checks the health status of the Parser microservice. Returns the current status and version information. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - The health status of the service (e.g., "healthy"). - **version** (string) - The version of the running service. ### Response Example { "example": "{ \"status\": \"healthy\", \"version\": \"1.0.0\" }" } ``` -------------------------------- ### Basic Log Usage Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/logger.md Demonstrates how to import the logger singleton and use the `info` method to log a message with source and metadata. Use `await` to ensure file writes complete. ```typescript import { logger } from '$logger/logger.ts'; await logger.info('Sync processing complete', { source: 'SyncProcessor', meta: { totalSynced: 4, instanceCount: 2 } }); ``` -------------------------------- ### Health Check Endpoint Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/parser.md This GET endpoint checks the health status and version of the parser service. ```http GET /health ``` -------------------------------- ### Example Filter Rules Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/upgrades.md Illustrates the basic structure of a filter rule, consisting of a field, an operator, and a value. ```plaintext monitored is true year gte 2020 status gte released ``` -------------------------------- ### Run the no-raw-ui lint rule Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/ui.md Execute the custom Deno lint script to enforce the use of UI wrappers instead of raw HTML elements. ```bash deno task lint:ui # run the no-raw-ui rule alone ``` -------------------------------- ### Importing Generated Types Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/api.md Example of importing generated component schemas from the API types for use in endpoint handlers. ```typescript import type { components } from '$api/v1'; type MyResponse = components['schemas']['MySchema']; ``` -------------------------------- ### Create and Use Arr Client Source: https://github.com/dictionarry-hub/profilarr/blob/develop/src/lib/server/utils/arr/README.md Demonstrates creating a client for a specific *arr application and performing common operations. ```typescript import { createArrClient } from '$utils/arr/factory.ts'; const radarr = createArrClient('radarr', 'http://localhost:7878', 'api-key'); // Get movies const movies = await radarr.getMovies(); // Get quality profiles const profiles = await radarr.getQualityProfiles(); // Add movie await radarr.addMovie({ title: 'Inception', tmdbId: 27205, qualityProfileId: 1 }); ``` -------------------------------- ### Conventional Commit Message Examples Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Follow the Conventional Commits specification for commit messages to clearly indicate the type and scope of changes. ```text feat: add regex filter type fix: sync status not updating after save docs: update contributing guide refactor: extract profile compilation logic chore: update Deno to 2.x ``` -------------------------------- ### Define Stage Groups Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of defining an array of StageGroup objects. These groups are used to organize stages visually on the onboarding page. ```typescript export const GROUPS: StageGroup[] = [ { name: 'Getting Started', description: 'Learn the basics of Profilarr', stages: ['welcome', 'navigation', 'personalize', 'help'] }, { name: 'Databases', description: 'Connect and manage configuration databases', stages: ['database-link', 'database-manage'] } ]; ``` -------------------------------- ### Adding a New Schema Operation File Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/schema-bump.md Demonstrates the creation of a new, sequentially numbered SQL file for schema changes within the 'ops/' directory. ```tree ops/ ├── 0.schema.sql ├── 1.languages.sql ├── 2.qualities.sql └── 3.your-change.sql ← new file ``` -------------------------------- ### Local Development Commands Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/announcements.md Commands to run the local bulletin server and the main development server, useful for testing announcement fetching with local fixtures. ```bash # Terminal 1 deno task dev:bulletin # Terminal 2 PROFILARR_BULLETIN_URL=http://localhost:6970 deno task dev ``` -------------------------------- ### Initialize Form Based on Mode Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/dirty.md Initializes the form state on mount, choosing between `initCreate` for new forms or `initEdit` for existing data based on the provided `mode` prop. ```svelte onMount(() => { if (mode === 'create') { initCreate(initialData ?? defaults); } else { initEdit(initialData); } }); ``` -------------------------------- ### Define Stage Prerequisites Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of how to define prerequisites for a stage in its definition. The 'check' property references a function in stateChecks, and 'message' is displayed on failure. ```typescript prerequisites: [{ check: 'hasDatabase', message: 'You need at least one connected database.' }]; ``` -------------------------------- ### Initialize Theme and Accent Colors Source: https://github.com/dictionarry-hub/profilarr/blob/develop/src/app.html Sets the initial theme (dark/light) and accent color based on localStorage or user preferences. It also defines CSS variables for accent color shades. ```javascript (function () { var d = document.documentElement; // Theme var stored = localStorage.getItem('theme'); d.classList.add( stored || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') ); // Accent color var accent = localStorage.getItem('accent') || 'blue'; var palettes = { blue: { 50: '#eff6ff', 100: '#dbeafe', 200: '#bfdbfe', 300: '#93c5fd', 400: '#60a5fa', 500: '#3b82f6', 600: '#2563eb', 700: '#1d4ed8', 800: '#1e40af', 900: '#1e3a8a', 950: '#172554' }, yellow: { 50: '#fefce8', 100: '#fef9c3', 200: '#fef08a', 300: '#fde047', 400: '#facc15', 500: '#eab308', 600: '#ca8a04', 700: '#a16207', 800: '#854d0e', 900: '#713f12', 950: '#422006' }, green: { 50: '#f0fdf4', 100: '#dcfce7', 200: '#bbf7d0', 300: '#86efac', 400: '#4ade80', 500: '#22c55e', 600: '#16a34a', 700: '#15803d', 800: '#166534', 900: '#14532d', 950: '#052e16' }, orange: { 50: '#fff7ed', 100: '#ffedd5', 200: '#fed7aa', 300: '#fdba74', 400: '#fb923c', 500: '#f97316', 600: '#ea580c', 700: '#c2410c', 800: '#9a3412', 900: '#7c2d12', 950: '#431407' }, teal: { 50: '#f0fdfa', 100: '#ccfbf1', 200: '#99f6e4', 300: '#5eead4', 400: '#2dd4bf', 500: '#14b8a6', 600: '#0d9488', 700: '#0f766e', 800: '#115e59', 900: '#134e4a', 950: '#042f2e' }, purple: { 50: '#faf5ff', 100: '#f3e8ff', 200: '#e9d5ff', 300: '#d8b4fe', 400: '#c084fc', 500: '#a855f7', 600: '#9333ea', 700: '#7e22ce', 800: '#6b21a8', 900: '#581c87', 950: '#3b0764' }, rose: { 50: '#fff1f2', 100: '#ffe4e6', 200: '#fecdd3', 300: '#fda4af', 400: '#fb7185', 500: '#f43f5e', 600: '#e11d48', 700: '#be123c', 800: '#9f1239', 900: '#881337', 950: '#4c0519' } }; var p = palettes[accent] || palettes.blue; for (var shade in p) { d.style.setProperty('--accent-' + shade, p[shade]); } // Nav icon style d.dataset.navIcons = localStorage.getItem('navIconStyle') || 'lucide'; })(); ``` -------------------------------- ### Initialize Display Stores Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/datetime.md Import and use read-only stores for timezone and date format preferences. These stores are initialized from server data and remain constant for the session. ```typescript import { serverTimezone } from '$stores/timezone'; import { dateFormat } from '$stores/dateFormat'; // In a component const tz = $serverTimezone; // "Asia/Kuala_Lumpur" const fmt = $dateFormat; // "auto", "mdy", "dmy", or "ymd" ``` -------------------------------- ### Compile Kysely Query to SQL Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/pcd.md Demonstrates how to compile a Kysely insert query into a SQL string and parameters. This is a key step before executing database operations. ```typescript const query = db.insertInto('custom_formats').values({ name: 'HDR10+', description: '' }).compile(); // compiledQueryToSql(query) -> "INSERT INTO custom_formats ..." ``` -------------------------------- ### Add a State Check Function Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Example of adding a new asynchronous check function to the stateChecks registry. This function should return a boolean indicating success or failure. ```typescript export const stateChecks: Record Promise> = { hasDatabase: async () => { const res = await fetch('/api/v1/databases'); if (!res.ok) return false; const data = await res.json(); return data.length > 0; } }; ``` -------------------------------- ### BaseHttpClient Constructor Source: https://github.com/dictionarry-hub/profilarr/blob/develop/src/lib/server/utils/arr/README.md Initializes the BaseHttpClient with a base URL and optional configuration options. ```typescript new BaseHttpClient(baseUrl: string, options?: HttpClientOptions) ``` -------------------------------- ### Schema File Structure Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/schema-bump.md Illustrates the directory structure for schema operations, emphasizing additive changes through numbered SQL files. ```tree schema repo (Dictionarry-Hub/schema) ├── pcd.json ← version lives here └── ops/ ├── 0.schema.sql ← original DDL (never edited) ├── 1.languages.sql ├── 2.qualities.sql └── 3.xxx.sql ← new changes go here (additive only) ``` -------------------------------- ### Notification Payload Examples Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/announcements.md These objects represent the structure of notification payloads for different announcement sources. The default kind is 'profilarr', while 'pcd' kind includes additional database information. ```typescript { kind: 'profilarr' } // default ``` ```typescript { kind: 'pcd', databaseName: 'Library DB' } // per-PCD ``` -------------------------------- ### Run Semgrep Scans Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/security.md Execute Semgrep scans for static code analysis. Use the --quick flag for faster scans focusing only on custom rules. ```bash deno task test semgrep # full scan: custom rules + community rulesets denodeno task test semgrep --quick # custom rules only (faster, for iteration) ``` -------------------------------- ### Clone Repo and Create Feature Branch Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/CONTRIBUTING.md Clone the repository, set up the upstream remote, and create a new branch for your feature. ```bash git clone https://github.com/their-username/profilarr.git cd profilarr git remote add upstream https://github.com/Dictionarry-Hub/profilarr.git git checkout -b feat/dark-mode-toggle ``` -------------------------------- ### Table Component Usage Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/ui.md Example of using the Table component for displaying paginated logs with sorting, hover effects, and custom row actions. Ensure 'paginatedLogs' and 'columns' are defined and 'handleSortChange' is implemented. ```svelte
``` -------------------------------- ### Write Test: Scalar Fields Update Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/pcd-tests.md Verifies that updating scalar fields in a PCD entity results in independent, grouped operations. Uses helper functions for setup, op checkpointing, and assertions. ```typescript test('scalar fields split into independent grouped ops', async () => { const ctx = await seededPcd('scalars', [ base.regex({ name: 'Scalar Regex', pattern: '\bold\b', description: 'Old', regex101Id: 'old101' }) ]); const checkpoint = opCheckpoint(ctx); await write.regex.update(ctx, 1, { name: 'Scalar Regex', pattern: '\bnew\b', description: 'New description', regex101Id: 'new101' }); const ops = userOpsSince(ctx, checkpoint); assertEquals(ops.length, 3); assertOnlyField(ops, 'pattern'); assertOnlyField(ops, 'description'); assertOnlyField(ops, 'regex101_id'); sameGroup(ops); }); ``` -------------------------------- ### Create New Branch Source: https://github.com/dictionarry-hub/profilarr/wiki/Contributing Create a new branch for your changes. Use a descriptive name that reflects the nature of your changes. ```bash git checkout -b ``` -------------------------------- ### Export Custom Formats and Profiles Source: https://github.com/dictionarry-hub/profilarr/wiki/Developing-Custom-Formats-&-Quality-Profiles Run this command to export any new or modified custom formats and profiles from your development instances. ```bash py exportarr.py ``` -------------------------------- ### InlineLink Component Usage Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/ui.md Example of using the InlineLink component for creating text-level links within content. The 'href' and 'text' props are required. Set 'external' to true for links opening in a new tab. ```svelte ``` -------------------------------- ### Dynamic Route Resolver Configuration Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/frontend/cutscene.md Illustrates how to configure dynamic routes for steps using named resolvers. Resolvers are async functions that return a path string, enabling navigation to pages with runtime data. ```typescript route: { resolve: 'firstDatabaseChanges'; } ``` -------------------------------- ### Example of a Value Guard in an UPDATE statement Source: https://github.com/dictionarry-hub/profilarr/blob/develop/docs/backend/pcd.md This SQL snippet demonstrates a value guard in an UPDATE statement. The `AND description = 'original text'` clause acts as the guard, ensuring the update only proceeds if the description field has not been modified upstream since the operation was created. ```sql UPDATE custom_formats SET description = 'user override' WHERE name = 'HDR10+' AND description = 'original text' -- value guard ``` -------------------------------- ### Import Custom Formats and Profiles Source: https://github.com/dictionarry-hub/profilarr/wiki/Developing-Custom-Formats-&-Quality-Profiles Use this script to import necessary settings into your development instances of Radarr and Sonarr. ```bash py importarr.py ```