Setting Up the Development Environment for SQLE (Go Backend API and React Frontend)
This guide walks through the complete setup of SQLE's development environment, covering the Go-based backend API, MySQL configuration, and the Node.js/React frontend, including required tools, code cloning, building, and testing steps on Linux.
Author: Jason, DBA at Jiexin Consumer Finance, with experience in Oracle, Mongo, MySQL, and big‑data ETL, interested in NewSQL and cloud‑native distributed databases.
SQLE is an open‑source SQL audit tool developed by ActionTech, supporting SQL review, index optimization, pre‑ and post‑audit, standardized release processes, native MySQL audit, and extensible database types.
Backend setup (Go RESTful API)
Prepare a Go 1.16 environment on Linux or macOS (Windows is not supported due to missing syslog implementation). Clone the SQLE repository from GitHub:
git clone https://github.com/actiontech/sqle.gitOpen the project in GoLand (or another IDE) via VNC from a Windows machine if needed.
Identify the main packages at sqle/cmd/sqld/sqled.go and sqle/cmd/sqld/gen_secret_pass.go . Create a sqled.yml configuration file, for example:
server:
sqle_config:
server_port: 10000
log_path: '/data/sqle-main/logs'
plugin_path: '/data/sqle-main/plugins'
db_config:
mysql_cnf:
mysql_host: '10.67.200.37'
mysql_port: 3306
mysql_user: 'app_sqle'
mysql_password: '*******'
mysql_schema: 'sqle'In MySQL, create the database and user:
CREATE DATABASE IF NOT EXISTS sqle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER app_sqle@'%' IDENTIFIED WITH mysql_native_password BY "***********";
GRANT ALL ON sqle.* TO app_sqle@'%';Build the project with go build and run it using the configuration file:
./sqld --config /data/sqle-main/sqle/sqled.ymlTest the login API (e.g., http://10.67.200.38:10000/v1/login ) with Postman to verify the backend is working.
Frontend setup (Node.js + React)
Install Node.js (v16) on the Linux server, extract it, and create symbolic links for node and npm . Configure global and cache directories, then install Yarn globally:
npm install -g yarn
sudo ln -s /data/jason/nodejs/node/node_global/bin/yarn /usr/bin/yarnClone the SQLE UI repository:
git clone https://github.com/actiontech/sqle-ui.gitUse VS Code with the Remote Development extension to connect to the Linux machine, open the project, and install dependencies:
yarn installRun the build scripts and compile the React application:
node ./scripts/moveAntdCss.js && node ./scripts/getGitVersion.js
craco buildStart the frontend with:
yarn run startAccess the UI at http://10.67.200.38:3000 and log in with the default credentials (admin/admin).
Overall, the tutorial demonstrates a full-stack, front‑back separation development workflow for SQLE, requiring solid knowledge of both backend (Go, MySQL) and frontend (Node.js, React) technologies, as well as database fundamentals.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.