Get a complete design stack
Get to know DashCore color options
Useful accordion elements
Comply with the hideous EU Cookie Law
Online store home with an outstanding UX
Online store shopping cart
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.
The default SQLite database that you get after cloning master is the same database used for http://sonicjs.com and is therefore a good starter for learning how to use SonicJs to bring your big idea to life!
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:
The .env file at the root of the project is where you will configure your database connection. DO NOT MANUALLY CREATE THIS FILE. It is automatically generated the first time that you start up the application. Please see the samples below and check out the TypeORM connection docs for full details.
Open the project environments file to set your database connection options:
[path to sonicjs]/.env:
# The path your entity files, do not modify this
# The type of database that you want to connect to
# The path to your SQLite database file
# Set synchronize to true so that your tables are created in your
# destination database if they do not exist
# Set this to true if you are troubleshooting connection
# issues, other leave it off
TYPEORM_CONNECTION = mysql
TYPEORM_HOST = localhost
TYPEORM_USERNAME = root
TYPEORM_PASSWORD = admin
TYPEORM_DATABASE = test
TYPEORM_PORT = 3000
TYPEORM_SYNCHRONIZE = true
TYPEORM_LOGGING = true
TYPEORM_ENTITIES = server/data/entity/*.js
To use a database that is different from the 2 examples above, please see the full list of environment variables below:
Please refer to the TypeORM connection documentation here for details.
Its possible that you can. Google "typeorm some-database" and see if a connector has been built for the database that you want to use.