# Where Are the Configuration Files for OmniRoute Located? A Complete Guide to the Config Directory

> Discover OmniRoute configuration file locations easily. This guide details where to find runtime settings and environment configs in the config directory and project root.

- Repository: [Diego Rodrigues de Sa e Souza/OmniRoute](https://github.com/diegosouzapw/OmniRoute)
- Tags: how-to-guide
- Published: 2026-07-24

---

**OmniRoute stores its runtime settings, feature toggles, internationalisation data, and quality-gate baselines in JSON files under the `config/` directory, with additional environment and build configurations located in the project root.**

The open-source OmniRoute repository (`diegosouzapw/OmniRoute`) centralizes its behavioral settings in a hierarchical configuration structure. Understanding the OmniRoute configuration files location is essential for administrators who need to customize request handling, localization, or quality thresholds without modifying core source code. These files are read by the server at startup and exposed through the **Settings** skill endpoints, allowing dynamic queries and modifications via the REST API.

## Core Configuration Files in the `config/` Directory

The primary OmniRoute configuration files reside in the repository’s `config/` folder. These JSON files define runtime behavior and are imported directly by the application bootstrap process in [`src/server/init.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/server/init.ts).

### Payload Validation Rules ([`config/payloadRules.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/payloadRules.json))

The [`config/payloadRules.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/payloadRules.json) file contains rules that filter or reshape incoming request payloads, including size limits and prohibited fields. This configuration is consumed by the request-validation middleware located at [`src/middleware/payloadValidator.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/middleware/payloadValidator.ts).

```typescript
// src/lib/config/load.ts
import { readFileSync } from 'fs';
import { resolve } from 'path';

export function loadJson<T>(relativePath: string): T {
  const fullPath = resolve(process.cwd(), relativePath);
  const raw = readFileSync(fullPath, 'utf‑8');
  return JSON.parse(raw) as T;
}

// Example usage during server initialization
const payloadRules = loadJson<Record<string, unknown>>('config/payloadRules.json');
console.log('Payload max size →', payloadRules.maxBytes);

```

### Internationalisation Catalogue ([`config/i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n.json))

Global localization data is stored in [`config/i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n.json), which maps language codes to translation files used by both the UI and CLI components. The structure of this file is strictly enforced against [`config/i18n-schema.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n-schema.json) by the validation layer in [`src/lib/validation/i18nValidator.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/validation/i18nValidator.ts).

### Quality Gate Baselines (`config/quality/*.json`)

The `config/quality/` directory contains baseline JSON files used by the **Quality Gate** tooling to enforce code-quality metrics such as complexity limits, duplication thresholds, and file-size constraints. These files are consumed by CI scripts located in `scripts/check/quality/`.

## Root-Level Configuration Files

Beyond the dedicated `config/` folder, OmniRoute utilizes several configuration files in the project root for build tooling, environment management, and dependency tracking:

- **`.env.example`** — Template for environment variables required at runtime (API keys, database paths, feature flags). Developers copy this to `.env` and populate secrets for local development.
- **[`tsconfig.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/tsconfig.json)**, **`tsconfig.typecheck‑core.json`**, **`tsconfig.typecheck‑noimplicit‑core.json`** — TypeScript compiler configurations for the main application and strict type-checking runs used in the build pipeline (`npm run typecheck:*`).
- **[`package.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/package.json)** and **[`package-lock.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/package-lock.json)** — Define project dependencies, npm scripts, and package metadata.
- **[`.size-limit.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/.size-limit.json)** — Configuration for the `size-limit` tool to enforce bundle size caps during CI (`npm run size-limit`).
- **[`.markdownlint.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/.markdownlint.json)** — Linting rules for Markdown documentation enforced via `npm run lint:md`.

## Modifying Configuration via the Settings API

OmniRoute exposes configuration management through the Settings skill endpoints under `/api/settings/*`. These endpoints read from and write to the JSON configuration files at runtime, persisting changes back to disk or to a SQLite key-value store for transient settings.

### Querying Current Configuration

Administrators can retrieve current payload rules via the REST API:

```bash

# Get the current payload rules

curl -X GET https://localhost:20128/api/settings/payload-rules \
  -H "Authorization: Bearer $OMNIRoute_API_KEY"

```

The endpoint handler maps to [`src/lib/db/settings.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/db/settings.ts), which reads directly from [`config/payloadRules.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/payloadRules.json).

### Updating Configuration Programmatically

To modify settings without manual file editing, use the following pattern implemented in the Settings UI ([`pages/settings/payload-rules.tsx`](https://github.com/diegosouzapw/OmniRoute/blob/main/pages/settings/payload-rules.tsx)):

```typescript
import { writeFileSync } from 'fs';
import { resolve } from 'path';

function updatePayloadRules(updates: Partial<Record<string, unknown>>) {
  const cfgPath = resolve('config/payloadRules.json');
  const current = JSON.parse(readFileSync(cfgPath, 'utf‑8'));
  const merged = { ...current, ...updates };
  writeFileSync(cfgPath, JSON.stringify(merged, null, 2));
}

// Increase the request‑size limit to 5 MiB
updatePayloadRules({ maxBytes: 5 * 1024 * 1024 });

```

## Accessing i18n Data in the Frontend

Frontend components import internationalisation data directly from the configuration directory. The following React component found in [`src/app/components/LocaleSwitcher.tsx`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/app/components/LocaleSwitcher.tsx) consumes [`config/i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n.json):

```tsx
import localeData from '../../config/i18n.json';

export function LocaleSwitcher() {
  return (
    <select>
      {Object.entries(localeData).map(([code, name]) => (
        <option key={code} value={code}>
          {name}
        </option>
      ))}
    </select>
  );
}

```

This direct import pattern ensures the UI always reflects the current language catalogue defined in the OmniRoute configuration files location.

## Summary

- **Primary config location**: The `config/` directory contains [`payloadRules.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/payloadRules.json), [`i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/i18n.json), [`i18n-schema.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/i18n-schema.json), and the `quality/` subdirectory for runtime behavioral settings.
- **Environment and build configs**: Root-level files including `.env.example`, `tsconfig*.json`, and [`package.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/package.json) manage dependencies, TypeScript compilation, and environment variables.
- **Runtime loading**: The `loadJson` utility in [`src/lib/config/load.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/config/load.ts) imports configuration files at startup, with [`src/server/init.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/server/init.ts) orchestrating the initialization sequence.
- **API exposure**: The Settings skill (`/api/settings/*`) enables runtime querying and modification of configuration values, with persistence handled by [`src/lib/db/settings.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/db/settings.ts).
- **Validation**: JSON-Schema validation ensures [`i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/i18n.json) conforms to expected structures via [`src/lib/validation/i18nValidator.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/validation/i18nValidator.ts).

## Frequently Asked Questions

### Where are the OmniRoute configuration files located?

OmniRoute configuration files are primarily located in the `config/` directory at the repository root, with additional environment and build configuration files (such as `.env.example` and [`tsconfig.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/tsconfig.json)) located in the project root. The `config/` folder contains JSON files for payload rules, internationalisation, and quality gate baselines.

### How does OmniRoute validate its internationalisation configuration?

OmniRoute validates the [`config/i18n.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n.json) file against the JSON-Schema defined in [`config/i18n-schema.json`](https://github.com/diegosouzapw/OmniRoute/blob/main/config/i18n-schema.json). This validation is performed by the [`src/lib/validation/i18nValidator.ts`](https://github.com/diegosouzapw/OmniRoute/blob/main/src/lib/validation/i18nValidator.ts) module at startup to ensure new languages conform to the expected structure before being loaded into the application.

### Can I modify OmniRoute settings without restarting the server?

Yes, many settings can be modified at runtime via the Settings skill API endpoints (`/api/settings/*`). These endpoints read from and write to the configuration files directly, allowing administrators to update payload rules and other values dynamically. Changes are persisted back to the JSON files or to a SQLite key-value store for transient settings.

### What is the purpose of the `config/quality/` directory?

The `config/quality/` directory contains baseline JSON files used by OmniRoute’s **Quality Gate** tooling. These files define thresholds for code-quality metrics such as complexity, duplication, and file-size limits, which are enforced during continuous integration runs via scripts in `scripts/check/quality/`.