Before starting, it is recommended to read YAO Architecture Analysis, understand the source code structure of YAO.
YAO is developed in golang, and a development environment can be established in a Mac or Linux environment.
Tools | Versions | Instructions |
---|---|---|
Golang | 1.18+ | Golang |
MySQL | 8.0+ | optional |
It is recommended to use Docker to install the service
YAO related code repository
Warehouse | Instructions |
---|---|
https://github.com/yaoapp/yao | Yao |
https://github.com/yaoapp/gou | Engine Framework |
https://github.com/yaoapp/xun | ORM |
https://github.com/yaoapp/kun | Common data processing packages |
https://github.com/yaoapp/v8go | V8 JavaScript engine |
Download the source code to the project directory
mkdir /your-project/rootgit clone https://github.com/yaoapp/yaogit clone https://github.com/yaoapp/gougit clone https://github.com/yaoapp/xungit clone https://github.com/yaoapp/kungit clone https://github.com/yaoapp/v8go
Set environment variables for source code debugging
variable | description | example |
---|---|---|
YAO_DEV | Source path | /your-project/root/yao |
YAO_ENV | How to start the test application development | production | development |
YAO_ROOT | Test application directory | /your-project/root/yao/tests |
YAO_HOST | Listening host | 0.0.0.0 |
YAO_PORT | Listening port | 5099 |
YAO_LOG | Test application log file | /your-project/root/yao/tests/logs |
YAO_JWT_SECRET | JWT secret | qo-2U+hoTRU |
YAO_DB_AESKEY | Database AES KEY | LX=T&f6refe |
export YAO_DEV="/your-project/root/yao"export YAO_ENV="development"export YAO_ROOT="/your-project/root/yao/tests"export YAO_HOST="0.0.0.0"export YAO_PORT="5099"export YAO_LOG="/your-project/root/yao/tests/logs"export YAO_JWT_SECRET="qo-2U+hoTRU"# Enable MySQL databaseexport YAO_DB_DRIVER=mysqlexport YAO_DB_PRIMARY="root:db-password@tcp(db-server:3308)/xiang?charset=utf8mb4&parseTime=True&loc=Local"export YAO_DB_AESKEY="LX=T&f6refe"
Go to the Yao project directory to run unit tests
cd /your-project/root/yaomake test
Debugging with Go commands
cd /your-project/root/yaogo run .go run . run xiang.sys.pinggo run . start
For the first compilation, you need to install related tools
cd /your-project/root/yaomake tools
During the compilation process, the code will be pulled from the https://github.com/YaoApp/xgen.git repository and built Need to install nodejs 16+ in advance
###MacOS
cd /your-project/root/yaomake release
Artifact is dist/release/yao
cd /your-project/root/yaomake linux-release
Artifact is dist/release/yao
Does not integrate XGen interface engine
make debug
Artifact is dist/release/yao-debug
https://github.com/YaoApp/yao/blob/main/.github/workflows/release-linux.yml https://github.com/YaoApp/yao/blob/main/.github/workflows/release-macos.yml
Before starting, it is recommended to read YAO Architecture Analysis, understand the source code structure of YAO.
YAO is developed in golang, and a development environment can be established in a Mac or Linux environment.
Tools | Versions | Instructions |
---|---|---|
Golang | 1.18+ | Golang |
MySQL | 8.0+ | optional |
It is recommended to use Docker to install the service
YAO related code repository
Warehouse | Instructions |
---|---|
https://github.com/yaoapp/yao | Yao |
https://github.com/yaoapp/gou | Engine Framework |
https://github.com/yaoapp/xun | ORM |
https://github.com/yaoapp/kun | Common data processing packages |
https://github.com/yaoapp/v8go | V8 JavaScript engine |
Download the source code to the project directory
mkdir /your-project/rootgit clone https://github.com/yaoapp/yaogit clone https://github.com/yaoapp/gougit clone https://github.com/yaoapp/xungit clone https://github.com/yaoapp/kungit clone https://github.com/yaoapp/v8go
Set environment variables for source code debugging
variable | description | example |
---|---|---|
YAO_DEV | Source path | /your-project/root/yao |
YAO_ENV | How to start the test application development | production | development |
YAO_ROOT | Test application directory | /your-project/root/yao/tests |
YAO_HOST | Listening host | 0.0.0.0 |
YAO_PORT | Listening port | 5099 |
YAO_LOG | Test application log file | /your-project/root/yao/tests/logs |
YAO_JWT_SECRET | JWT secret | qo-2U+hoTRU |
YAO_DB_AESKEY | Database AES KEY | LX=T&f6refe |
export YAO_DEV="/your-project/root/yao"export YAO_ENV="development"export YAO_ROOT="/your-project/root/yao/tests"export YAO_HOST="0.0.0.0"export YAO_PORT="5099"export YAO_LOG="/your-project/root/yao/tests/logs"export YAO_JWT_SECRET="qo-2U+hoTRU"# Enable MySQL databaseexport YAO_DB_DRIVER=mysqlexport YAO_DB_PRIMARY="root:db-password@tcp(db-server:3308)/xiang?charset=utf8mb4&parseTime=True&loc=Local"export YAO_DB_AESKEY="LX=T&f6refe"
Go to the Yao project directory to run unit tests
cd /your-project/root/yaomake test
Debugging with Go commands
cd /your-project/root/yaogo run .go run . run xiang.sys.pinggo run . start
For the first compilation, you need to install related tools
cd /your-project/root/yaomake tools
During the compilation process, the code will be pulled from the https://github.com/YaoApp/xgen.git repository and built Need to install nodejs 16+ in advance
###MacOS
cd /your-project/root/yaomake release
Artifact is dist/release/yao
cd /your-project/root/yaomake linux-release
Artifact is dist/release/yao
Does not integrate XGen interface engine
make debug
Artifact is dist/release/yao-debug
https://github.com/YaoApp/yao/blob/main/.github/workflows/release-linux.yml https://github.com/YaoApp/yao/blob/main/.github/workflows/release-macos.yml