LokiCMS is a powerful headless content management system that leverages a modernized version of LokiJS, providing a seamless REST API experience. With embedded database functionality and AI-driven management through the Model Context Protocol, it offers flexibility for developers seeking to create dynamic applications without the overhead of traditional CMS interfaces.
lokiCMS is a modernized Headless Content Management System (CMS) powered by LokiJS, featuring a REST API and an AI-driven Model Context Protocol (MCP) server for seamless agent management. Built using TypeScript, it provides a robust and lightweight solution focused exclusively on backend functionality, allowing for easy integration and consumption without a graphical user interface.
To get started, the following environment configurations are necessary:
| Variable | Description | Default |
|---|---|---|
PORT | Specify the API server port | 3000 |
HOST | Define the server host | localhost |
DB_PATH | Path to the database file | ./data/cms.db |
JWT_SECRET | Secret key for JWT tokens | (required in production) |
JWT_EXPIRES_IN | Token expiration duration | 7d |
API_KEY_PREFIX | Prefix for API keys | lkcms_ |
To initialize the database, run the following command:
npm run seed
This setup will create an administrator user, default content types (e.g., Post, Page), default taxonomies (e.g., Category, Tag), and example terms.
POST /api/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "password123",
"name": "John Doe"
}
POST /api/content-types
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Product",
"slug": "product",
"description": "E-commerce products",
"fields": [
{
"name": "title",
"label": "Title",
"type": "text",
"required": true
},
{
"name": "price",
"label": "Price",
"type": "number",
"required": true
}
]
}
GET /api/entries?contentType=post&status=published&search=hello&page=1&limit=10
Additional functionality can be added through the flexible plugin system that supports both npm packages and local plugins. Plugins can register their hooks, routes, and even modify the CMS's operational behavior through the provided API.
lokiCMS incorporates an enhanced LokiJS library, offering:
lokiCMS provides a powerful, headless solution for managing digital content while integrating seamlessly with external applications and AI services. It is designed for developers seeking efficient content management capabilities, free from the limitations of traditional CMS interfaces.
No comments yet.
Sign in to be the first to comment.