# @reldens/cms

> Reldens - CMS

Latest version **0.88.0** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reldens/cms
pnpm add @reldens/cms
yarn add @reldens/cms
bun add @reldens/cms
```

Provides the commands `reldens-cms`, `reldens-cms-update-password`, `reldens-cms-generate-entities`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.88.0 |
| Published | 2026-09-11 |
| First published | 2025-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20.0.0 |
| Dependencies | 5 |
| Unpacked size | 939.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Damian A. Pastorini |
| Maintainers | dpastorini |
| Keywords | reldens, cms, system, content, management, dwd, nodejs, platform, framework |

## Links

- npm: https://www.npmjs.com/package/@reldens/cms
- Repository: https://github.com/damian-pastorini/reldens-cms
- Issues: https://github.com/damian-pastorini/reldens-cms/issues
- npm.io page: https://npm.io/package/@reldens/cms

## Dependencies (5)

- [dotenv](https://npm.io/package/dotenv.md) 17.4.2
- [mustache](https://npm.io/package/mustache.md) 4.2.0
- [@reldens/utils](https://npm.io/package/@reldens/utils.md) ^0.58.0
- [@reldens/storage](https://npm.io/package/@reldens/storage.md) ^0.118.0
- [@reldens/server-utils](https://npm.io/package/@reldens/server-utils.md) ^0.57.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 0.88.0 (latest) — 2026-09-11
- 0.87.0 — 2026-09-08
- 0.86.0 — 2026-09-07
- 0.85.0 — 2026-08-16
- 0.84.0 — 2026-08-16
- 0.83.0 — 2026-08-16
- 0.82.0 — 2026-08-16
- 0.81.0 — 2026-08-10
- 0.80.0 — 2026-08-10
- 0.79.0 — 2026-07-24
- 0.78.0 — 2026-07-16
- 0.77.0 — 2026-07-15
- 0.76.0 — 2026-07-09
- 0.75.0 — 2026-07-09
- 0.74.0 — 2026-07-08
- … 71 more at https://npm.io/package/@reldens/cms/versions

## README

[![Reldens - GitHub - Release](https://www.dwdeveloper.com/media/reldens/reldens-mmorpg-platform.png)](https://github.com/damian-pastorini/reldens)

# Reldens CMS

A powerful, flexible Content Management System built with Node.js, featuring an admin panel, multi-domain frontend support, enhanced templating with reusable content blocks, system variables, internationalization, template reloading, dynamic forms, and automated installation with subprocess handling.

## Features

### - Quick Setup
- **Web-based installer** with guided setup process and subprocess management
- **Subprocess installation handling** for complex operations with progress tracking
- **Automatic database schema creation** and seeding
- **Intelligent dependency management** with npm integration
- **Environment configuration generation** with template validation
- **Directory structure initialization** with asset copying

### - Frontend Engine
- **Multi-domain support** with domain-specific templates and partials
- **Dynamic routing** from database-driven routes
- **Entity-based URLs** (e.g., `/articles/123`)
- **Template fallback system** (domain → default → base)
- **Layout system** with body content layouts and page wrappers
- **Reusable content blocks** with `<entity>` template functions
- **Collection rendering** with filtering, sorting, pagination, and loop support
- **Custom partial tags** with HTML-style syntax for complex partials
- **Entity access control** for public/private content
- **Static asset serving** with Express integration as default
- **Template engine** with Mustache integration as default
- **System variables** for request, route, and domain context
- **Enhanced context passing** with currentEntity data in child blocks
- **Template functions** for URLs, assets, dates, and translations
- **Event-driven rendering** with hooks for customization
- **Custom 404 handling**
- **Advanced search functionality** with template data support
- **Dynamic forms system** with template transformers and security features
- **Template reloading** for development with configurable reload strategies

### - Admin Panel
- **Full CRUD operations** for all entities including content blocks
- **File upload handling** with multiple storage buckets
- **Role-based authentication** and access control
- **Advanced filtering and search** across entity properties
- **Bulk operations** (delete multiple records)
- **Relationship management** with foreign key support
- **Template-driven UI** with customizable admin themes

### -️ Database & Entities
- **Multiple database drivers** (Knex by default; Kysely, Drizzle, Objection JS, MikroORM and Prisma when their packages are installed in the project)
- **Automatic entity generation** from a database schema
- **Relationship mapping** and foreign key handling
- **Custom entity configuration** with validation rules
- **Translation support** for entity labels and properties
- **Content blocks management** via cms_blocks table
- **Entity access control** via entities_access table
- **Dynamic forms storage** via cms_forms and cms_forms_submitted tables

### - Configuration & Architecture
- **Environment-based configuration** (.env file)
- **Modular service architecture** with specialized classes for better maintainability
- **Event-driven system** with hooks for customization
- **Extensible authentication** (database users or custom callbacks)
- **Password encryption** with PBKDF2 (100k iterations, SHA-512) - automatic on save
- **File security** with path validation and dangerous key filtering
- **Internationalization support** with translation files

## Architecture

### Core Classes
The CMS uses a modular architecture with specialized classes:

**Installation & Management:**
- `Installer` - Installation orchestrator with subprocess management and progress tracking
- `Manager` - Main CMS orchestrator with service initialization and configuration management
- `MySQLInstaller` - Database-specific installation with schema migration support

**Frontend Orchestrator:**
- `Frontend` - Main orchestrator class that coordinates all frontend operations

**Template Management:**
- `TemplateResolver` - Template discovery and domain resolution
- `TemplateCache` - Template and partial caching management
- `TemplateReloader` - Template reloading with file change detection

**Request Processing:**
- `RequestProcessor` - HTTP request routing and path handling
- `SearchRequestHandler` - Dedicated search request processing
- `DynamicFormRequestHandler` - Form submission processing

**Content Management:**
- `ContentRenderer` - Content generation and template processing
- `EntityAccessManager` - Entity access control and loading

**Response Handling:**
- `ResponseManager` - HTTP response handling and caching logic

**Template Processing:**
- `TemplateEngine` - Core template rendering with enhanced context
- `SystemVariablesProvider` - System variables for templates
- `FormsTransformer` - Dynamic forms template transformer

**Forms System:**
- `DynamicForm` - Form validation and data processing
- `DynamicFormRenderer` - Template-based form rendering

This architecture follows SOLID principles, providing better:
- **Testability** - Individual components can be tested in isolation
- **Maintainability** - Changes to one area don't affect others
- **Reusability** - Components can be reused in different contexts
- **Readability** - Smaller, focused classes are easier to understand

## Installation

Install the CMS package and its dependencies:
```bash
npm install @reldens/cms
```

Then use the web installer or create the files manually.

### Method 1: Automated Web Installer with Subprocess Handling
```bash
npx reldens-cms
```
Navigate to `http://localhost:8080` and follow the installation wizard with:
- **Automatic dependency checking** and installation
- **Subprocess progress tracking** for complex operations
- **Database connection validation** with real-time feedback
- **SSL certificate configuration** for production
- **Post-installation callbacks** for custom initialization

### Method 2: Manual Setup
```javascript
const { Manager } = require('@reldens/cms');

const cms = new Manager({
    projectRoot: process.cwd(),
    entityAccess: {
        cmsPages: { public: true, operations: ['read'] },
        articles: { public: true, operations: ['read'] },
        users: { public: false }
    },
    // Enhanced manager configuration
    authenticationMethod: 'db-users', // or 'custom'
    adminRoleId: 99,
    cache: true,
    reloadTime: 0 // Disable template reloading for production
});

cms.start();
```

## Configuration

**Environment variables:** Database, server, admin, multi-domain settings
**Template reloading:** Configure for development (-1) or production (0)
**Entity configuration:** Custom entity properties, validation, and relationships
**Manager options:** Authentication, caching, domain mapping

**Full documentation:** See `.claude/configuration-guide.md`

## CLI Commands

### Start CMS

```bash
npx reldens-cms
```

Runs the installer if not installed, otherwise starts the CMS server.

### Generate Entities

```bash
npx reldens-cms-generate-entities
npx reldens-cms-generate-entities --override
```

Generate entity classes from database schema.

### Update User Password

```bash
npx reldens-cms-update-password --email=admin@example.com
npx reldens-cms-update-password --username=admin
```

Securely update user passwords via CLI. Password will be prompted if not provided.

## Password Management

**Automatic encryption:** PBKDF2 with 100k iterations, SHA-512
**CLI password update:** `npx reldens-cms-update-password --email=user@example.com`
**Event-driven:** Encrypts passwords automatically on save via admin panel
**Storage format:** salt:hash (192 characters total)
**Enabled by default:** Set `enablePasswordEncryption: false` to disable

**Full documentation:** See `.claude/password-management-guide.md`

## Advanced Installation Features

**Subprocess handling** for complex operations with progress tracking
**Enhanced Manager** with service validation and automatic initialization
**Development mode detection** with configurable patterns
**Security configuration** with CSP, Helmet headers, and external domain support

**Full documentation:** See `.claude/installation-guide.md`

## Dynamic Forms System

Create database-driven forms with `<cmsForm key="contactForm"/>` tags in templates. Features:

- Schema-based validation with multiple field types (text, email, select, etc.)
- Security: Honeypot protection, rate limiting, XSS protection
- Domain-aware template customization
- Event hooks for custom processing
- Database storage in cms_forms and cms_forms_submitted tables

**Full documentation:** See `.claude/forms-system-guide.md`

## Search Functionality

Multi-entity search with pagination and template data support.

**Usage:** `/search?search=technology&limit=20&templateData[columnsClass]=col-md-4`

**Full documentation:** See `.claude/search-guide.md`

## Enhanced Templating System

Powerful template engine with Mustache integration, system variables, and dynamic content rendering.

**Core Features:**
- System variables: `{{currentRequest.host}}`, `{{currentRoute.title}}`, `{{systemInfo.environment}}`
- Template functions: `[url(/path)]`, `[asset(/img.png)]`, `[date(now, Y-m-d)]`, `[translate(key)]`
- Entity rendering: `<entity name="cmsBlocks" field="name" value="header"/>`
- Collections with pagination: `<collection name="articles" filters="{}" data="{limit: 10}">`
- Custom partials: `<partial name="hero" title="Welcome"/>` or `{{>hero -{data}-}}`

**Full documentation:** See `.claude/templating-system-guide.md`

## Internationalization & Multi-Domain

**Translation files:** JSON-based i18n with `[translate(key)]` and `[t(key, fallback)]` functions
**Multi-domain support:** Domain-specific templates, partials, and configurations
**Layout system:** Two-tier layout (page.html + layouts/) with multiple layout options
**Content blocks:** Reusable content via cms_blocks table
**Entity access control:** Configure public/private entities and operations

**Full documentation:** See `.claude/multi-domain-i18n-guide.md`

## Advanced Usage

**Template Reloading:** Set `reloadTime: -1` for development, `0` for production
**Event System:** Hook into CMS events for customization
**Custom Authentication:** Implement custom auth callbacks
**File Upload Config:** Configure MIME types and allowed extensions

**Full documentation:** See `.claude/advanced-usage-guide.md`

## Database Schema

**Core tables:** routes, cms_pages, cms_blocks, entities_access, entities_meta
**Forms tables:** cms_forms, cms_forms_submitted
**Optional:** users, roles

**Full documentation:** See `.claude/database-schema.md`

## API Reference

Complete class and method reference for all CMS components.

**Full documentation:** See `.claude/api-reference.md`

## Contributing

1. Fork the repository
2. Create a feature branch
3. Follow the coding standards in the JavaScript rules
4. Submit a pull request

---

Need something specific?

[Request a feature here: https://www.reldens.com/features-request](https://www.reldens.com/features-request)

## Documentation

[https://www.reldens.com/documentation/cms](https://www.reldens.com/documentation/cms)

---

## License

MIT License - see LICENSE file for details.

---

### [Reldens](https://github.com/damian-pastorini/reldens/ "Reldens")

##### [By DwDeveloper](https://www.dwdeveloper.com/ "DwDeveloper")

---
_Source: https://npm.io/package/@reldens/cms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
