SonicJS headless CMS knowledge base, coding standards, and architectural guidelines.
93
93%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
This guide is for developers who want to contribute to the SonicJS platform itself. If you're building an application with SonicJS, see the Installation guide instead.
We appreciate every developer who wants to contribute to SonicJS. To ensure the best experience for both contributors and maintainers, we've established a clear process for getting involved.
💡We receive many requests from developers interested in contributing. While we value every potential contributor, we've found that the most effective way to get involved is to demonstrate your commitment through contributions first. Please submit at least one meaningful pull request before requesting a meeting or deeper integration into the project.
We're looking for contributors to create video content for our YouTube channel. Video tutorials help developers learn SonicJS faster and reach a wider audience.
Video ideas:
Reach out via GitHub Discussions if you're interested in creating video content.
SonicJS uses a monorepo structure managed by npm workspaces. This allows us to develop the core framework, CLI tools, and documentation in a single repository.
# Fork the repository on GitHub first
# Then clone your fork:
git clone https://github.com/YOUR_USERNAME/sonicjs.git
cd sonicjs
# Add upstream remote
git remote add upstream https://github.com/lane711/sonicjs.git
# Install all dependencies (installs for all workspaces)
npm install# Start the development application
npm run dev
# Or start the documentation site
npm run dev:wwwThe development server runs at http://localhost:8787
The SonicJS monorepo is organized as follows:
sonicjs/
├── packages/
│ ├── core/ # @sonicjs-cms/core - The main framework
│ │ ├── src/
│ │ │ ├── index.ts # Package entry point
│ │ │ ├── middleware/ # Request middleware
│ │ │ ├── routes/ # HTTP route handlers
│ │ │ ├── services/ # Business logic
│ │ │ ├── templates/ # HTML templates
│ │ │ ├── plugins/ # Plugin system
│ │ │ │ ├── core/ # Plugin architecture
│ │ │ │ ├── core-plugins/ # Built-in plugins
│ │ │ │ └── available/ # Optional plugins
│ │ │ ├── collections/ # Collection definitions
│ │ │ └── types/ # TypeScript types
│ │ ├── migrations/ # Database migrations
│ │ └── package.json
│ │
│ └── create-app/ # create-sonicjs CLI tool
│ ├── src/
│ │ └── cli.js # CLI entry point
│ ├── templates/
│ │ └── starter/ # Starter project template
│ └── package.json
│
├── www/ # Documentation website (Next.js)
│ ├── src/
│ │ └── app/ # MDX documentation pages
│ └── package.json
│
├── my-sonicjs-app/ # Development/test application
│ ├── src/
│ │ └── index.ts # App entry point
│ ├── wrangler.toml # Cloudflare config
│ └── package.json
│
├── tests/ # E2E tests
│ ├── e2e/ # Playwright tests
│ └── playwright.config.ts
│
├── docs/ # Internal documentation
├── package.json # Root package.json (workspaces)
└── README.md| Directory | Description |
|---|---|
packages/core | The core SonicJS framework published as @sonicjs-cms/core |
packages/create-app | The create-sonicjs CLI tool for scaffolding new projects |
www | Documentation website built with Next.js |
my-sonicjs-app | Development application for testing changes |
tests | End-to-end tests using Playwright |
Run these from the repository root:
| Command | Description |
|---|---|
npm run dev | Start development server (my-sonicjs-app) |
npm run dev:www | Start documentation site |
npm run build | Build core package and development app |
npm run build:core | Build only the core package |
npm run build:www | Build documentation site |
npm test | Run core package unit tests |
npm run test:e2e | Run Playwright end-to-end tests |
npm run deploy | Deploy development app to Cloudflare |
npm run deploy:www | Deploy documentation site |
| Command | Description |
|---|---|
npm run db:generate | Generate migration files from schema changes |
npm run db:migrate | Apply migrations to local D1 database |
npm run db:migrate:prod | Apply migrations to production database |
npm run db:studio | Open Drizzle Studio (database GUI) |
| Command | Description |
|---|---|
npm test | Run Vitest unit tests |
npm run test:watch | Run tests in watch mode |
npm run test:cov | Run tests with coverage report |
npm run test:e2e | Run Playwright E2E tests |
npm run test:e2e:ui | Run E2E tests with UI mode |
| Command | Description |
|---|---|
npm run plugins:generate | Regenerate plugin registry from manifests |
npm run plugins:watch | Watch plugin manifests and auto-regenerate |
Browse our GitHub Issues to find something to work on:
[ 🏷️
Issues tagged for newcomers - great starting point
](https://github.com/lane711/sonicjs/labels/good%20first%20issue)[ 🙋
Issues where we actively need community help
](https://github.com/lane711/sonicjs/labels/help%20wanted)[ 🔍
Browse all open issues and find one that interests you
](https://github.com/lane711/sonicjs/issues)[ 📚
Help improve our docs - great for learning the project
](https://github.com/lane711/sonicjs/labels/documentation)# Sync with upstream
git fetch upstream
git checkout main
git merge upstream/main
# Create a feature branch
git checkout -b feature/your-feature-nameHave questions? Ask in our Discord server - we're happy to help!
# Commit your changes
git add .
git commit -m "feat: add your feature description"
# Push to your fork
git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
🎉After your first meaningful contribution is merged, you'll be:
<ul className="text-emerald-800 dark:text-emerald-200 list-disc list-inside space-y-1 mb-0"> <li>Added to our contributors list</li> <li>Eligible for deeper project discussions</li> <li>Welcome to schedule a call with maintainers if desired</li> <li>Considered for more significant responsibilities</li> </ul>We use conventional commit messages. Reference issue numbers when applicable.
feat: add new caching strategy
fix: resolve authentication bug (#123)
docs: update installation guide
test: add tests for plugin loaderBefore submitting a PR, ensure:
npm test)npm run test:e2e)npm run format)npm run lint)Error: Error: no such table: users
Solution:
# Run migrations
npm run db:migrate
# Verify migration status
wrangler d1 migrations list DB --localError: Error: listen EADDRINUSE: address already in use :::8787
Solution:
# Find and kill the process using port 8787
lsof -ti:8787 | xargs kill -9Error: Cannot find module 'hono'
Solution:
# Clear and reinstall dependencies
rm -rf node_modules package-lock.json
npm install
# Clear TypeScript build cache
rm -rf .wranglerError: Build fails when running npm run build:core
Solution:
rm -rf packages/core/distnpm installnpm run build:coreResources:
Find an Issue to Work On View Repository
If you have questions about contributing:
We look forward to your contributions!
docs
skills