docs: add native run guide and restore admin creation in setup.sh

This commit is contained in:
datadunia
2026-05-23 20:35:13 +07:00
parent 715930f7a5
commit cb674c964b
3 changed files with 50 additions and 11 deletions
+36 -5
View File
@@ -12,19 +12,50 @@ This suite contains three main components:
## 🚀 Deployment & Installation
### 1. Initial Setup
### Option A: Docker (Recommended)
Clone this repository and start all services:
```bash
git clone https://git.datadunia.com/nexusguard/Nexus-Guard-Suite.git
cd Nexus-Guard-Suite
cp .env.example .env # Edit .env with your configuration
make up # Start all services (PostgreSQL, Redis, Server-Core, Dashboard UI)
./setup.sh # Generate .env file automatically
# Edit .env with your configuration
bash update.sh # Pull, build, migrate, and start
```
The first run will automatically:
- Create the database schema via GORM AutoMigrate.
- Boot up all required infrastructure via Docker Compose.
- Pull the latest code and build the Docker containers (via `update.sh`).
- Auto-generate the **Local Primary Node** WireGuard keys on the first boot.
- Create the database schema via automated migration.
### Option B: Native (Without Docker)
If you prefer to run the components directly on your host machine, you will need **Go 1.25+**, **Node.js 24+**, **PostgreSQL**, and **Redis**.
**1. Setup Database & Environment**
Create a PostgreSQL database. Copy `.env.example` to `.env` and configure `DB_HOST`, `DB_USER`, `DB_PASSWORD`, and `DB_NAME` to point to your local database.
**2. Start Backend (Server Core)**
```bash
cd apps/server-core
go mod download
go run -tags dev .
```
*(The dev tag automatically runs migrations and provisions the local node)*
**3. Start Frontend (Dashboard UI)**
```bash
cd apps/dashboard-ui
npm install
npm run dev
```
**4. Create Admin Account**
In a new terminal:
```bash
cd apps/server-core
go run -tags dev . -create-admin -user "admin" -pass "YourNewSecurePassword123!"
```
### 2. Quick Reference with Makefile