# sc **Repository Path**: kule111/sc ## Basic Information - **Project Name**: sc - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-08 - **Last Updated**: 2026-04-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Distributed Mall Local Runbook This repository is wired for a local end-to-end path with MySQL, Redis, Nacos, Sentinel, Elasticsearch, six backend services, and two Vue frontends. ## Prerequisites - Docker Desktop with Compose - Java 17 - Maven - Node.js 20+ - npm ## Quick Start 1. Start infra, import Nacos configs, build backend modules, launch all backend services, and run the smoke check: ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\start-backend.ps1 ``` 2. Start the mall frontend: ```powershell Set-Location .\frontend\mall-web npm install npm run start ``` 3. Start the admin frontend in a second terminal: ```powershell Set-Location ..\admin-web npm install npm run start ``` ## Manual Flow Start only infrastructure: ```powershell docker compose -f .\deploy\docker-compose.yml up -d ``` Import Nacos config files: ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\import-nacos.ps1 ``` Start backends without rebuilding: ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\start-backend.ps1 -SkipBuild ``` Run the smoke check by itself: ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\smoke-e2e.ps1 -RetryCount 10 -RetryDelaySec 3 ``` ## Local Endpoints - Gateway: `http://localhost:9000` - Auth service: `http://localhost:9001` - Product service: `http://localhost:9002` - Trade service: `http://localhost:9003` - Payment service: `http://localhost:9004` - Search service: `http://localhost:9005` - Mall web: `http://localhost:5173` - Admin web: `http://localhost:5174` - Nacos: `http://localhost:8848/nacos` - Sentinel: `http://localhost:8858` - Elasticsearch: `http://localhost:9200` ## Default Credentials - Admin login: `admin / 123456` The smoke script validates: - `POST /api/auth/admin/login` - `GET /api/products/1001` - `GET /api/search?keyword=手机` ## Notes - The gateway defaults to fixed local upstream URLs so local startup does not depend on Nacos service registration. - Nacos config import is still provided for local inspection and parity with the configuration files already tracked under `deploy/nacos/config`. - Backend process ids and logs are written under `.\logs`. ## Stop Stop backend JVM processes started by `start-backend.ps1`: ```powershell if (Test-Path .\logs\backend-processes.json) { $processes = Get-Content .\logs\backend-processes.json | ConvertFrom-Json $processes | ForEach-Object { if (Get-Process -Id $_.pid -ErrorAction SilentlyContinue) { taskkill /PID $_.pid /T /F | Out-Null } } Remove-Item .\logs\backend-processes.json -Force } ``` `backend-processes.json` records the launcher PowerShell PIDs. On Windows, use `taskkill /T /F` so the whole `powershell -> mvn -> java` tree is terminated instead of only the recorded parent process. Stop infrastructure without deleting MySQL, Redis, or Elasticsearch data: ```powershell docker compose -f .\deploy\docker-compose.yml down ``` `docker compose down` stops containers only. The named volumes declared in `deploy/docker-compose.yml` keep database, cache, and Elasticsearch state for the next run. ## Destructive Reset Remove containers and named volumes when you need a true local reset of MySQL, Redis, and Elasticsearch state: ```powershell docker compose -f .\deploy\docker-compose.yml down -v ``` This is destructive for local state stored in the named volumes.