A comprehensive API and web interface for managing ARK: Survival Ascended servers via POK Manager
PokManagerApi is a modern, production-ready control plane for managing ARK: Survival Ascended (ASA) server instances through POK Manager. Built with .NET 10, Aspire 13.1.0, and Blazor, it provides a comprehensive web UI and REST API for complete server lifecycle management.
The project emphasizes Clean Architecture, Test-Driven Development (TDD), and type-safe operations with extensive test coverage (904 tests, 99.9% pass rate).
- Create Instance - Deploy new ARK server instances from templates
- Start/Stop/Restart - Control instance lifecycle with safety checks
- Status Monitoring - Real-time server status and health checks
- Log Management - View, tail, and download server logs
- Disk-Based Discovery - Primary discovery via Instance_* directories (filesystem as source of truth)
- Container Status Tracking - Docker container state as secondary property
- Data-Only Instances - Support for instances without containers (e.g., TwinPeak)
- Create Container - Initialize containers from existing disk data
- Destroy Container - Remove containers while preserving data (safe by default)
- Recreate Container - Refresh container configuration without data loss
- Docker Compose Integration - Full docker-compose orchestration support
- Manual Backups - Create on-demand backups with compression
- Backup Listing - View all available backups per instance
- Restore Operations - Revert to previous backups with preview
- Backup Download - Export backups for external storage
- Retention Policies - Configurable backup retention rules
- View Configuration - Display current instance settings
- Edit Configuration - Modify server settings with validation
- Apply Changes - Safe configuration updates with restart prompts
- Template Support - Use configuration templates for consistency
- Validation - FluentValidation ensures configuration correctness
- Update Detection - Check for ASA and container updates
- Safe Updates - Gated update process with rollback support
- Update History - Track update history and changes
- Scheduled Updates - Configure automatic update windows
- Restart Schedules - Cron-like restart scheduling
- Backup Schedules - Automated backup creation
- Maintenance Windows - Define blackout periods for operations
- Task Management - View and manage scheduled tasks
- Operation Locking - Prevent concurrent operations on instances
- Audit Trails - Complete audit log of all operations
- Input Validation - Comprehensive validation of all inputs
- Plan-Preview-Apply - Safe workflow for destructive operations
- No Secret Leakage - Redacted logging and secure handling
- Clean Architecture - Maintainable, testable, scalable design
- TDD-First - 904 comprehensive tests drive implementation
- Type-Safe - Strong typing throughout, no stringly-typed commands
- Result Monad - Explicit error handling without exceptions
Placeholder for application screenshots
- .NET 10 SDK - Download
- Docker - For running ASA server containers
- POK Manager - Installed at
~/asa_server(pokuser) - Linux Host - Recommended for server operations
- Git - For cloning the repository
-
Clone the repository
git clone https://github.com/JerrettDavis/PokManagerUI.git cd PokManagerUI -
Restore dependencies
dotnet restore
-
Build the solution
dotnet build
-
Run tests
dotnet test -
Run the application
dotnet run --project src/Hosting/PokManager.AppHost/PokManager.AppHost.csproj
-
Access the application
- Web UI:
https://localhost:7000 - API Service:
https://localhost:7001 - Aspire Dashboard:
https://localhost:15000
- Web UI:
PokManagerApi follows Clean Architecture principles with clear separation of concerns:
┌─────────────────────────────────────────┐
│ Presentation Layer │
│ (Blazor Web UI, API Controllers) │
└─────────────┬───────────────────────────┘
│
┌─────────────▼───────────────────────────┐
│ Application Layer │
│ (Use Cases, DTOs, Validation) │
└─────────────┬───────────────────────────┘
│
┌─────────────▼───────────────────────────┐
│ Infrastructure Layer │
│ (POK Manager, Bash Execution) │
└─────────────┬───────────────────────────┘
│
┌─────────────▼───────────────────────────┐
│ Domain Layer │
│ (Entities, Value Objects, Business │
│ Logic, No Dependencies) │
└─────────────────────────────────────────┘
- Domain - Pure business logic, entities, value objects, domain events (no dependencies)
- Application - Use cases, business rules, interfaces (depends on Domain)
- Infrastructure - External services, POK Manager client, file system (depends on Application)
- Presentation - Blazor UI, REST API, user interaction (depends on Application)
See Architecture Documentation for detailed information.
- .NET 10 - Latest C# features and performance improvements
- Aspire 13.1.0 - Cloud-native orchestration and observability
- Blazor - Interactive web UI with component-based architecture
- xUnit - Primary testing framework
- TinyBDD - Behavior-driven development tests
- FluentAssertions - Readable test assertions
- NSubstitute - Mocking framework
- bUnit - Blazor component testing
- FluentValidation - Input validation library
- YamlDotNet - YAML configuration parsing
- Microsoft.Extensions.* - Logging, DI, Options pattern
- Nuke - Build automation (planned)
- Docker - Containerization for deployment
- Git - Version control
PokManagerApi/
├── src/
│ ├── Core/ # Core business logic
│ │ ├── PokManager.Domain/ # Entities, value objects
│ │ └── PokManager.Application/ # Use cases, interfaces
│ │
│ ├── Infrastructure/ # External integrations
│ │ ├── PokManager.Infrastructure/ # Base infrastructure
│ │ ├── PokManager.Infrastructure.PokManager/ # POK Manager client
│ │ └── PokManager.Infrastructure.Docker/ # Docker operations
│ │
│ ├── Presentation/ # User interfaces
│ │ ├── PokManager.Web/ # Blazor web UI
│ │ └── PokManager.ApiService/ # REST API
│ │
│ └── Hosting/ # Application hosting
│ ├── PokManager.AppHost/ # Aspire orchestration
│ └── PokManager.ServiceDefaults/ # Shared configurations
│
├── tests/ # Test projects
│ ├── PokManager.Domain.Tests/ # 119 tests
│ ├── PokManager.Application.Tests/ # 390 tests
│ ├── PokManager.Infrastructure.Tests/ # 394 tests
│ └── PokManager.Web.Tests/ # 1 test
│
├── docs/ # Documentation
│ ├── architecture.md # Architecture details
│ ├── getting-started.md # Setup guide
│ ├── development.md # Development guide
│ └── README.md # Documentation index
│
└── samples/ # Sample code and demos
Configuration is managed through appsettings.json and environment variables:
{
"PokManager": {
"BasePath": "~/asa_server",
"User": "pokuser",
"Timeout": "00:05:00",
"AllowedOperations": ["start", "stop", "restart", "backup", "restore"]
},
"Backup": {
"RetentionDays": 30,
"CompressionFormat": "zst"
},
"Scheduling": {
"Enabled": true,
"DefaultRestartTime": "03:00:00"
}
}POKMANAGER_BASE_PATH- POK Manager installation directoryPOKMANAGER_USER- Linux user for operations (default: pokuser)ASPNETCORE_ENVIRONMENT- Development/Staging/Production
All configuration is validated at startup with clear error messages for invalid settings.
curl -X POST https://localhost:7001/api/instances/MyServer/startcurl -X POST https://localhost:7001/api/instances/MyServer/backupscurl https://localhost:7001/api/instances- Navigate to
https://localhost:7000 - View the dashboard for all instances
- Click on an instance to manage it
- Use the action buttons to start/stop/restart
- Navigate to Backups tab to manage backups
See Getting Started Guide for detailed setup instructions.
# Full build
dotnet build
# Build specific project
dotnet build src/Core/PokManager.Domain/PokManager.Domain.csproj
# Clean build
dotnet clean && dotnet build# Run all tests
dotnet test
# Run specific test project
dotnet test tests/PokManager.Domain.Tests/PokManager.Domain.Tests.csproj
# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run tests with detailed output
dotnet test --logger "console;verbosity=detailed"This project uses TinyBDD for test-first development:
- Write TinyBDD tests describing the behavior
- Add minimal scaffolding to compile
- Implement the simplest code to pass tests
- Refactor while keeping tests green
- Add edge case coverage
Example test structure:
public class When_starting_an_instance : Feature
{
[Fact]
public void Should_return_success_when_instance_exists_and_stopped()
{
// Arrange
Given.An_existing_stopped_instance();
// Act
When.Starting_the_instance();
// Assert
Then.Operation_should_succeed();
And.Instance_should_be_running();
}
}- Visual Studio 2022 - Full IDE support with Blazor tooling
- JetBrains Rider - Excellent C# and test runner support
- VS Code - Lightweight with C# Dev Kit extension
See Development Guide for IDE configuration details.
- Total Tests: 904
- Passing: 903 (99.9%)
- Skipped: 1 (0.1%)
- Duration: ~1-2 seconds
- Domain Tests: 119 tests - Core logic, Result, value objects
- Application Tests: 390 tests - Use cases, validation, business rules
- Infrastructure Tests: 394 tests - POK Manager client, parsers, Docker
- Web Tests: 1 test - Blazor components
- TDD-First - Tests written before implementation
- Behavior-Driven - Tests describe expected behavior
- Fast - All tests run in under 2 seconds
- Isolated - No dependencies on external services
- Deterministic - Consistent results every run
# Run domain tests only
dotnet test tests/PokManager.Domain.Tests
# Run tests matching a pattern
dotnet test --filter "FullyQualifiedName~StartInstance"
# Run tests with detailed output
dotnet test --logger "console;verbosity=detailed"# Build Docker image
docker build -t pokmanagerapi:latest .
# Run container
docker run -d -p 7000:8080 pokmanagerapi:latestThe project uses .NET Aspire for cloud-native deployment:
# Run with Aspire orchestration
dotnet run --project src/Hosting/PokManager.AppHost- Configure reverse proxy (nginx, Caddy) for HTTPS
- Set up authentication/authorization
- Configure backup storage locations
- Set appropriate file permissions for pokuser
- Enable audit logging
- Configure monitoring and alerting
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow TDD workflow (write tests first!)
- Ensure all tests pass (
dotnet test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Clean Architecture principles
- Write TinyBDD tests before implementation
- Use Result for error handling (no exceptions for flow control)
- Add XML documentation for public APIs
- Follow C# naming conventions
- Use meaningful variable names
- Keep methods focused and small
- Ensure all tests pass
- Update documentation as needed
- Add tests for new functionality
- Follow the existing code style
- Provide clear PR description
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- POK Manager - Acekorneya/Ark-Survival-Ascended-Server
- TinyBDD - jerrettdavis/tinybdd
- .NET Aspire - Microsoft .NET Aspire
- Clean Architecture - Uncle Bob's Clean Architecture
- Documentation - docs/README.md
- Issues - GitHub Issues
- Discussions - GitHub Discussions
- ✅ Clean Architecture foundation
- ✅ Domain layer with Result monad
- ✅ Application layer use cases
- ✅ POK Manager integration
- ✅ Output parsers (5 parsers, 105 tests)
- ✅ 904 comprehensive tests
- ✅ Disk-based instance discovery (Phase 1)
- ✅ Container lifecycle management (Phase 2)
- ✅ Docker Compose integration
- 🔄 Blazor web UI components
- 🔄 REST API endpoints
- 🔄 Authentication/Authorization
- 🔄 Clone/Copy workflows (Phase 3)
- 📋 Scheduling system
- 📋 Real-time monitoring dashboard
- 📋 Multi-server management
- 📋 Backup encryption
- 📋 Email notifications
- 📋 Performance metrics
Built with ❤️ using .NET 10, Aspire 13.1.0, and Clean Architecture principles


