# Use and adapt sonicjs

Use the documented interfaces and source layout for **sonicjs**. The sections below retain the README’s examples and configuration details.

## Project Structure

```
sonicjs/
├── packages/
│   ├── core/              # 📦 Main CMS package (@sonicjs-cms/core)
│   │   ├── src/
│   │   │   ├── routes/    # Route handlers (admin, API, auth)
│   │   │   ├── templates/ # HTML templates & components
│   │   │   ├── middleware/# Authentication & middleware
│   │   │   ├── utils/     # Utility functions
│   │   │   └── db/        # Database schemas & migrations
│   │   └── package.json
│   ├── templates/         # Template system package
│   └── scripts/           # Build scripts & generators
│
├── my-sonicjs-app/        # 🧪 Test application (gitignored)
│                          # Created with: npx create-sonicjs@latest
│
├── www/                   # 🌐 Marketing website
└── tests/e2e/             # End-to-end test suites
```

⚠️ **This is NOT an application repository** — it's for developing the `@sonicjs-cms/core` npm package.

## Plugin Development

```typescript
// src/plugins/my-plugin/index.ts
import type { Plugin, PluginContext } from '@sonicjs-cms/core'

export default {
  name: 'my-plugin',
  version: '1.0.0',
  description: 'My custom plugin',

  async activate(context: PluginContext) {
    // Runs when the plugin is activated
  },

  async install(context: PluginContext) {
    // Runs once on install — migrations, seed data, etc.
  },
} satisfies Plugin
```

## Commands in the root manifest

The captured [package.json](https://github.com/Up-to-code/sonicjs/blob/HEAD/package.json) declares the following scripts. Run them from the directory containing that manifest.

| Command | Script |
| --- | --- |
| `npm run dev` | `npm run dev --workspace=my-sonicjs-app` |
| `npm run build` | `npm run build:core && npm run build --workspace=my-sonicjs-app` |
| `npm run test` | `npm run test --workspace=@sonicjs-cms/core` |
| `npm run lint` | `npm run type-check` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-sonicjs/quick-start-guide).
2. Compare required configuration and dependency versions with the README.
3. Check the linked issue tracker for the same error. Include the command, runtime version, and relevant error when reporting a problem; omit credentials.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/sonicjs)
- [Original README](https://github.com/Up-to-code/sonicjs/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/sonicjs/issues)
- [Open the project website](https://sonicjs.com)

The catalog identifies the license as **MIT**. Read the repository license before redistributing source or assets.

This catalog entry is a fork. The README may describe upstream packages, domains, or release procedures; those destinations do not establish a separate release of this fork.