CtrlK
BlogDocsLog inGet started
Tessl Logo

sonicjs-cms/sonicjs-cms

SonicJS headless CMS knowledge base, coding standards, and architectural guidelines.

93

Quality

93%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

index.mddocs/

SonicJS CMS Documentation Index

This index provides a structured map of all available documentation for SonicJS CMS. AI Agents should refer to these references to learn about domain-specific concepts, configurations, and APIs before executing implementation tasks.

📦 Package Installation

To install SonicJS in a Cloudflare Workers or Hono environment:

# Using npm
npm create sonicjs@latest my-project
cd my-project
npm install

🔗 Core Imports

Most functionality is accessed via the @sonicjs-cms/core package.

import { requireAuth, requireRole } from '@sonicjs-cms/core'
import { collections } from './db/schema'
import { eq } from 'drizzle-orm'

💻 Usage Examples

Initialize D1 Database and Run Migrations

# Create local and production D1 instances
wrangler d1 create sonicjs-ai
npm run db:migrate:local

Basic API Route with RBAC

app.use('/api/admin/*', requireRole(['admin', 'editor']))
app.get('/api/admin/stats', async (c) => {
  return c.json({ status: 'success', data: {} })
})

📖 API Reference & Documentation Map

🚀 Getting Started

  • Quickstart - Get up and running with SonicJS.
  • Configuration - Setting up the environment and general configurations.

🏗️ Core Concepts

  • Architecture - System architecture and overall design patterns.
  • Collections - Defining and interacting with data collections.
  • Database - D1 Database configuration, queries, and migrations.
  • API - Utilizing the internal and external REST/GraphQL APIs.
  • Routing - Handling paths and endpoints in SonicJS.

⚡ Features & Modules

  • Authentication - Auth workflows, permissions, and session management.
  • Plugins - Creating and consuming SonicJS plugins.
  • Templating - UI Templating and rendering.
  • Webhooks - Emitting and handling webhooks.
  • Attachments - Handling file attachments and media processing.
  • Forms - Form creation and submission handling.
  • Pagination - Fetching paginated records.

🧩 Additional Features

🛠️ Developer Reference

  • Coding Standards - Best practices and conventions.
  • Hooks - Lifecycle hooks available to developers.
  • Field Types - Supported schema field types.
  • Errors - Error handling and common status codes.
  • Caching - KV caching mechanisms and cache invalidation.
  • Security - Securing collections and access control logic.
  • Testing - Playwright and unit testing instructions.
  • Telemetry - Instrumentation and logging.
  • SDKs - Client SDK usage.

🚀 Operations

💡 Guides & Community

  • Examples - Code snippets and use-cases.
  • FAQ - Frequently asked questions.
  • Community - Community discussion links.
  • Contributing - How to contribute to the open-source repo.
  • Contacts - Team and support contacts.
  • Sponsor - Project sponsorship info.

📅 Updates & Roadmap

docs

api.md

architecture.md

attachments.md

authentication.md

caching.md

changelog.md

coding-standards.md

collections.md

community.md

configuration.md

contacts.md

contributing.md

conversations.md

database.md

deployment.md

errors.md

examples.md

faq.md

field-types.md

forms.md

groups.md

hooks.md

index.md

messages.md

pagination.md

plugins.md

quickstart.md

roadmap.md

routing.md

sdks.md

security.md

sponsor.md

telemetry.md

templating.md

testing.md

troubleshooting.md

webhooks.md

tile.json