Development Manual
Less than 1 minute
Development Manual
Development Environment
Backend
- Go version: 1.22.9
Frontend
- Node version: 18.20.4
Quick Start
Clone the backend code
git clone https://github.com/samwafgo/SamWaf
Download the precompiled frontend version
(A detailed guide for separate compilation is provided later.)
https://github.com/samwafgo/SamWafWeb/releases/latest/download/dist.zipAfter downloading, extract it into the backend directory:
SamWaf/public/dist
Directory structure:
├─public │ └─dist // Extract the precompiled frontend content here │ └─assets │ └─index.html │ └─favicon.ico │ └─robots.txt
Start the backend
Slightly modify the code inglobal/global.go
(to conveniently use the precompiled frontend):GWAF_RELEASE string = "true"
Entry point to start the code:
main.go
Then access: http://127.0.0.1:26666/
Development and Debugging
Backend
Ensure global/global.go
:
GWAF_RELEASE string = "false"
Start: main.go
Frontend
Clone the frontend code
git clone https://github.com/samwafgo/SamWafWeb
Install dependencies (for the first time)
npm install
Start the frontend
npm run dev
At this point, both the backend and frontend development codes are running, allowing collaborative debugging.