Quickstart

Get SonicJS running in under 60 seconds and create your first content-driven application.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (version 18 or higher)
  • npm or pnpm
  • Git

Quick Start

Create a new SonicJS application with a single command. The setup is fully automated and takes less than 60 seconds:

One-Command Setup

# Create a new SonicJS application
npx create-sonicjs my-app

# Navigate to your project
cd my-app

# Start development server
npm run dev

# Your CMS is now running at http://localhost:8787

The create-sonicjs command automatically:

  • βœ… Creates a new project directory
  • βœ… Installs all dependencies
  • βœ… Sets up the database schema
  • βœ… Configures Cloudflare Workers
  • βœ… Creates the admin user
  • βœ… Runs initial migrations

Your SonicJS instance will be available at http://localhost:8787


First Steps

Access the Admin Dashboard

Navigate to http://localhost:8787/admin and log in with the default credentials.

The admin interface provides:

  • System Overview - Real-time health checks and activity feed
  • Content Management - Create, edit, and publish content
  • Media Library - Upload and manage media files
  • Plugin Management - Install and configure plugins
  • User Management - Manage users, roles, and permissions

Create Your First Content

Via Admin UI:

  1. Navigate to Content β†’ New Content
  2. Select a collection (e.g., "Blog Posts")
  3. Fill in the fields and click Save

Via API:

Create Content

# Get auth token
curl -X POST http://localhost:8787/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"admin@sonicjs.com","password":"admin123"}'

# Create content
curl -X POST http://localhost:8787/admin/content \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "collection": "blog_posts",
    "title": "My First Post",
    "data": {
      "slug": "my-first-post",
      "content": "<p>Hello World!</p>",
      "status": "published"
    }
  }'

Fetch Content via API

Fetch Content

# Get all content
curl http://localhost:8787/api/content

# Get content by collection
curl http://localhost:8787/api/collections/blog_posts/content

# Get single content item
curl http://localhost:8787/api/content/:id

Next Steps

Now that you have SonicJS running, explore these guides:

Was this page helpful?