Версия:

How to Start with GoCore

This section describes the steps for deploying and performing the initial launch of a project based on the GoCore kernel.

1. Environment Preparation

DBMS (MariaDB)

The Core requires MariaDB version 10 or higher.

2. Obtaining the Codebase

3. Initial Build

You must perform an initial build of the frontend part and install dependencies.

  1. Run the firstBuild script from package.json:

    npm run firstBuild
    

    This script sequentially executes: npm i && cd public && npm i && cd .. && babel public_src --out-dir public --copy-files.

  2. For subsequent frontend development, use the command:

    npm run watch
    

4. Configuration Setup

config/config.json File

The configuration file is excluded from Git and is created automatically during the first run. After creation, it must be edited.

  1. Start the project (using the npm run run command or node bin/www.js).
  2. Wait for an error about DB settings to appear, then edit the created config/config.json file.

Key Parameters:

Other parameters can be left unchanged for the first launch.

5. Launch and Debugging

TypeScript Compilation

The Core is shipped with pre-compiled code (JS), but for TS development, you will need compilation:

Main Process

Start the server:

npm run run
# or
node bin/www.js

Using an Alternative Config

You can launch the project with a different configuration file (e.g., for debugging on a production database copy):

node bin/www.js prod.json

The file must be located in the config/ directory.

Authorization

After launching, navigate to the link displayed in the console.

Important Notes for the First Launch

  1. First Launch: config.json is created, and the process ends with a DB connection error.
  2. Second Launch: After configuring the connection, the Core begins importing the DB dump from the DB/ccs.init.sql file. This takes some time.
  3. Wait for the message: INFO: cMysql.getConnection. Database has been filled. Enjoy your work!.
  4. Restart the process once more.

Note: Messages in console.error during startup are normal (they are used to highlight important system events in logs). Read them carefully, but only panic if errors occur while the already-launched server is running.

6. Developer Summary