Development Setup¶
1. Clone and install dependencies¶
git clone https://github.com/PGAN-Dev/PoracleWeb.NET.git
cd PoracleWeb.NET
# Install frontend dependencies (from root)
./scripts/dev.sh install
Or manually: cd Applications/Pgan.PoracleWebNet.App/ClientApp && npm install
2. Configure secrets¶
Run the interactive setup to create and configure your .env at the project root:
The same .env format works for development, Docker, and standalone mode. The app auto-translates short variable names (DB_HOST, JWT_SECRET, etc.) into .NET's configuration format.
Create Applications/Pgan.PoracleWebNet.Api/appsettings.Development.json (gitignored):
{
"ConnectionStrings": {
"PoracleDb": "Server=localhost;Port=3306;Database=poracle;User=root;Password=your_password;AllowZeroDateTime=true;ConvertZeroDateTime=true",
"PoracleWebDb": "Server=localhost;Port=3306;Database=poracle_web;User=root;Password=your_password;AllowZeroDateTime=true;ConvertZeroDateTime=true",
"ScannerDb": ""
},
"Jwt": {
"Secret": "your-development-secret-key-at-least-32-characters-long"
},
"Discord": {
"ClientId": "your_discord_client_id",
"ClientSecret": "your_discord_client_secret",
"FrontendUrl": "http://localhost:4200",
"BotToken": "your_discord_bot_token",
"GuildId": "your_discord_guild_id",
"GeofenceForumChannelId": ""
},
"Telegram": {
"Enabled": false,
"BotToken": "",
"BotUsername": ""
},
"Poracle": {
"ApiAddress": "http://localhost:3030",
"ApiSecret": "your_poracle_secret",
"AdminIds": "your_discord_user_id"
},
"Koji": {
"ApiAddress": "http://localhost:8080",
"BearerToken": "your_koji_bearer_token",
"ProjectId": 1,
"ProjectName": "your_koji_project_name"
}
}
PoracleNG must be running
Poracle:ApiAddress must point to a running PoracleNG instance. All alarm tracking writes are proxied through this API. Poracle:ApiSecret must match PoracleNG's server.apiSecret config value.
3. Run the application¶
Starts both the API and Angular dev server in one terminal. Output is prefixed with [api] and [app]. Press Ctrl+C to stop both.
Backend API:
Starts on http://localhost:5048. Swagger/OpenAPI is available in development mode.
Frontend:
Starts on http://localhost:4200. The Angular dev server proxies API requests to the .NET backend.
Open http://localhost:4200 in your browser.
4. Running tests¶
# All tests (backend + frontend)
./scripts/dev.sh test
# Or individually:
dotnet test # Backend (xUnit)
cd Applications/Pgan.PoracleWebNet.App/ClientApp && npm test # Frontend (Jest)
5. Linting and formatting¶
# Check lint + formatting
./scripts/dev.sh lint
# Or manually:
cd Applications/Pgan.PoracleWebNet.App/ClientApp
npm run lint # ESLint check
npm run prettier-check # Prettier check
npx eslint --fix src/ # Auto-fix lint issues
npm run prettier-format # Auto-format code
Build commands¶
# Full production build (API + Angular, outputs to ./publish)
./scripts/dev.sh build
# Or manually:
dotnet build # Build .NET solution
cd Applications/Pgan.PoracleWebNet.App/ClientApp && npm run build # Angular production build
cd Applications/Pgan.PoracleWebNet.App/ClientApp && npm run watch # Angular watch mode