HyPrism is a cross-platform launcher for the game Hytale, built with .NET 10 and Electron.NET. It provides mod management, multi-instance support, and an alternative to the official launcher.
The application follows a Console + IPC + React SPA pattern:
- Backend: .NET 10 console application with dependency injection
- Frontend: React 18 + TypeScript SPA rendered in Electron
- Communication: IPC bridge via Electron.NET socket (named channels:
hyprism:{domain}:{action}) - Logging: Serilog with custom
ElectronLogInterceptorfor Electron.NET framework messages
| Layer | Technology |
|---|---|
| Backend | .NET 10, ElectronNET.Core, Serilog, DiscordRichPresence |
| Frontend | React 18, TypeScript, Vite, TailwindCSS, Framer Motion, i18next |
| IPC | Electron.NET bridge with context isolation |
| DI | Microsoft.Extensions.DependencyInjection |
HyPrism/
├── Program.cs # Entry point, Electron bootstrap
├── Bootstrapper.cs # DI container setup
├── HyPrism.csproj # .NET project file
├── Frontend/ # React SPA source
│ ├── src/
│ │ ├── lib/ipc.ts # Generated IPC types (do not edit)
│ │ ├── components/
│ │ └── pages/
│ └── package.json
├── Services/ # Business logic layer
│ ├── Core/ # Infrastructure, IPC, Platform, Integration
│ ├── Game/ # Game-specific services (Launch, Mod, Version, etc.)
│ └── User/ # User profiles, authentication, skins
├── Docs/ # User and technical documentation (EN/RU)
├── Scripts/ # Build and codegen scripts
└── wwwroot/ # Built frontend (generated)
- .NET 10.0 SDK
- Node.js 20+ (for frontend build)
# Full build (includes frontend via npm ci + npm run build)
dotnet build
# Run the launcher
dotnet run
# Frontend development (separate terminal)
cd Frontend && npm run devThe .csproj file defines automatic frontend build targets:
NpmInstall— Runsnpm ciwhenpackage.jsonorpackage-lock.jsonchangesGenerateIpcTs— Runsnode Scripts/generate-ipc.mjsto generateFrontend/src/lib/ipc.tsfromIpcService.csBuildFrontend— Runsnpm run build(Vite) to producewwwroot/CopyFrontendDist— Copieswwwroot/to$(OutputPath)/wwwroot/
dotnet publish -c ReleaseRelease configuration enables:
- ReadyToRun AOT compilation
- Self-contained deployment
- Disabled asset compression
- Add/update .NET service in
Services/{Core|Game|User}/ - Register in
Bootstrapper.csif new service - Add IPC handler with
@ipcannotation inIpcService.cs - Add
@typeannotation if new TypeScript type needed - Regenerate IPC types:
node Scripts/generate-ipc.mjs - Create React component/page in
Frontend/src/ - Update documentation in
Docs/(both English and Russian)
Channels follow the pattern: hyprism:{domain}:{action}
Examples:
hyprism:game:launchhyprism:settings:gethyprism:i18n:set
- Async methods: Suffix with
Async - Interfaces: Prefix with
I, inject via constructor - Services: Registered as singletons
- No hardcoded values: Use config, theme tokens, or localization keys
- No manual edits to
Frontend/src/lib/ipc.ts(generated file)
| File | Purpose | Caution |
|---|---|---|
Program.cs |
App entry point, Electron bootstrap | Changes affect entire startup |
Bootstrapper.cs |
DI container setup | Breaking changes affect all services |
IpcService.cs |
IPC bridge between backend/frontend | Must stay in sync with frontend |
ClientPatcher.cs |
Game integrity | Never modify without explicit instruction |
All changes must include documentation updates:
- User docs (
Docs/*/User/) — UI or feature behavior changes - Developer docs (
Docs/*/Development/) — build/CI/workflow changes - API docs (
Docs/*/Technical/) — IPC channel changes
Both English (Docs/English/) and Russian (Docs/Russian/) versions should be updated.
# Frontend type checking
cd Frontend && npx tsc --noEmit
# Full build verification
dotnet build # Must complete with 0 errors- App ID:
io.github.HyPrismTeam.HyPrism - Icon source:
Frontend/public/icon.png→ generated toBuild/icons/during packaging - AppStream metadata:
Properties/linux/io.github.HyPrismTeam.HyPrism.metainfo.xml - Flatpak runtime:
24.08withorg.electronjs.Electron2.BaseApp
contextIsolation: true— renderer has no access to Node.jsnodeIntegration: false— norequire()in rendererpreload.jsexposes onlywindow.electron.ipcRendererviacontextBridge
The project uses several runtime optimizations in runtimeconfig.template.json and .csproj:
- Server GC disabled, concurrent GC enabled
- Large object heap compaction
- ReadyToRun compilation
- Disabled unnecessary features (EventSource, MetadataUpdater, etc.)