Overview

SonicJs is a modern, open source content management system and web application framework.

It is 100% Javascript based and leverages TypeORM for data access to most popular database systems.

SonicJs is architected to be extremely flexible. Modules are not just "bolt-ons" as they are in many other CMS'. In SonicJs, modules can alter core behavior and even alter/extend the behavior of other modules. See Hooks for more info. This is conceptually very similar to Drupal.

SonicJs' is not a Node.js based clone of Drupal, however the intension was to take the best aspects of Drupal, Wordpress, and many other CMS' and attempt to meld them into a high end CMS and enterprise application framework that is both powerful and enjoyable to work with.

For an explanation of why it was built and to read up on the project's underlying principals, please see here

Project Status

Special Sauce?

What makes SonicJs special? What separates it from the countless CMS already on the market? To answer this, let's first look at the problem SonicJs was built to solve...

Nearly all web software development tasks fall into one of two categories:

Grunt Work

This is the work we are forced to do in order to complete the project. It's not fun, it's not challenging, and we've done it hundreds of times, but it's gotta get done. 

If your team has a mix of junior and senior developers, it's the work we often give to the junior devs. This isn't to say it's not important, in fact it's often critical and foundational to your app.

Examples include:

  1. User/Role/Permissions Management
  2. CRUD Operations
  3. API Development
  4. Configuration Management
  5. Sending Notifications (Emails/SMS)
  6. Error Logging
  7. Caching
  8. Breadcrumbs
  9. Routing
  10. Data Entry Forms
  11. So much more...

Fun Work

This is the challenging type of work that we actually get up in the morning for. This is were we are empowered to exercise our critical thinking, get in "the zone" and really earn those big bucks!

Examples include:

  1. Complex Business Rules
  2. Advanced UX/UI
  3. Deep Domain Knowledge
  4. Integrations With Other Services/Platforms
  5. Performance Tuning

So what does that all have to do with SonicJs? As web developers, we often repeat the above mentioned "grunt work" types of tasks over and over. SonicJs is a platform laser focused on the goal of categorizing, analyzing and platformizing these common tasks. This is why SonicJs can also be considered a low-code Node.js platform or enterprise application platform, not just a CMS.

So How Does SonicJs Actually Help Minimize Time Consuming Grunt Work?

SonicJs' core is surprisingly lightweight, this is why the entire application, even with all its core modules enabled, only takes about 2 seconds to load via "npm start".

As SonicJs goes thru its startup and page rendering processes, it emits "hooks" along the way. Modules can register these hooks and perform their own custom logic. While the event/emitter or pub/sub design patterns are certainly not unique to SonicJs, they are surprising incredibly hard to find properly implemented in any CMS. 

Most CMS have some sort of API that allows the developer to interact with the core CMS. They are almost always, with very few exceptions, dismally limited in what you can do with them. This forces the CMS to be highly opinionated with respect to how they resolve the various problems. With SonicJS, you can modify or extend just what you need without having to rewrite an entire module, or even understand the entire inner workings of the module. Moreover, SonicJs allows you to alter core functionality via your own modules and even alter other modules via their own custom hooks. 

Another major distinction that goes above and beyond SonicJs' hook system, is the built in form builder. SonicJs has tight integration and has extended Form.io (https://www.form.io/). This enables developers to build a consistent administrative user experience across the entire platform. If you've ever used Wordpress, you know how annoying it is that every module has a totally separate UI/UX which mandates a separate learning curve.

There are loads of features too, which grows every month. Whether you are building a website of any complexity, a business/consumer web application or even looking for a solid headless CMS for your module/IoT app, SonicJs may just be the platform that you've been looking for!

Business Impact

So what is the net business impact of using SonicJs? Using SonicJS CMS as your platform of choice can reduce your project's development hours by up to 40%! In many cases, even fairly complex, full featured websites/web applications with custom content types can all be generated with zero custom coding. SonicJs is a great choice for a wide array of common web development applications.

Getting Started

Prerequisites

The only hard requirement is Node.js version 14.17.5 or later which can be downloaded from:

When you initially setup SonicJs, you will be using the built in SQLite file based database, so there is no need to connect to a centralized database. This is the recommended approach if you are initially evaluating SonicJs because it provides you will a quick frictionless setup process.

If you would prefer to setup SonicJs with another database, this is certainly possible. See the below Database Setup section below.

You can use SonicJs' backup/restore feature to easily migrate your data from one database to another, so you will not need to rebuild your site if you want to start with the built in SQLite database and then migrate to another database later.

If you are building a read-only website, you can even source control your site's content by using SQLite as your database. This may not work well if you are working on a team due to GIT merge conflicts of the SQLite file, but if you are working solo on a website, it can make your content migrations from local dev to production a breeze.

Database Support

SonicJs uses TypeORM (https://typeorm.io/) for data access. By default, when you first install SonicJs, you will typically want to use the SQLite file based database. Please don't change your database settings (in the .env file) when first running SonicJs.  If you want to use another database, you will want to use the backup/restore feature to copy over this default data to your desired database.

The default SQLite database that you get after cloning master has a basic site including some example pages and a blog setup.

SQLite is even suitable for production in many cases and is the most widely used database in the world. 

However, should you need to use another database, SonicJs supports the many databases below:

  • MySQL
  • PostgreSQL
  • SQLite (local file based database)
  • MariaDB
  • Microsoft SQL Server
  • Oracle
  • WebSQL
  • MongoDB
  • CockroachDB
  • SAP Hana
  • sql.js
  • Others (Any Database Supported by TypeORM)

To use one of the above supported databases, please the database connections section in the developer docs.

Local Setup

$ git clone https://github.com/lane711/sonicjs
$ cd sonicjs
$ npm install
$ npm start

That's it! You now have SonicJs up and running on your local development environment. When you run "npm start" SonicJs will typically be up and running within about 2 seconds.

You can also run "npm run dev" to run SonicJs using Nodemon. This mean that every time you make a changes to a file, the web server will automatically restart.

Default URLs

Front End: http://localhost:3018
Back End: http://localhost:3018/admin
API: http://localhost:3018/graphql

Creating The Admin Account

We you first visit your site, you will be prompted to create the site's admin account using an email and password. Follow the directions and then you will be directed to the admin console

Debugging

To debug the app, use the built in debugger from VS Code. The "Server"  debugger profile will allow you to set breakpoints and walk thru the code.