Files
DorkNet/server/README.md
T
Alexa bcc5fe1bcb Add initial documentation and structure for DorkNet project
- Create README.md for project overview and setup instructions
- Add admin-ui/README.md for admin UI details and development setup
- Introduce client-mod/README.md explaining the MelonLoader mod functionality
- Establish docker/README.md for Docker setup and configuration
- Create docs/README.md to index project documentation
- Implement advanced-setup.md for Docker stack configuration
- Document architecture in architecture.md
- Provide easy-setup.md for hosting instructions
- Add FAQ.md for common questions and legal considerations
- Create joining-a-server.md for player connection instructions
- Establish troubleshooting.md for common issues and resolutions
- Introduce easy-app/README.md for the unified desktop application
- Add server/README.md for ASP.NET Core backend details
- Document tools/README.md for CLI helper scripts
2026-05-21 13:26:46 +03:00

58 lines
1.6 KiB
Markdown

# server/
The ASP.NET Core backend.
Built two ways:
- **Standalone Postgres-backed** for advanced mode (Docker), via
`dotnet run` or the `dorknet-server` container.
- **In-process SQLite-backed** for the Easy desktop app, hosted as a
library inside `easy-app/`.
## Code layout (TBC)
```
server/
├── Controllers/ HTTP endpoints, sliced by subdomain → service
├── Services/ Business logic (presence, notifications, levels, ...)
├── Hubs/ SignalR NotifyHub
├── Data/ DbContext + EntityFramework entity classes
├── Auth/ JWT issuance, Photon CustomAuth handler
├── Middleware/ SubdomainRouter, request logging, error handling
└── Program.cs Boot: migrations, seeds, canonical overrides, DI
```
## Building
```bash
dotnet build -c Release
dotnet run # localhost:5000
```
## Provider switch
The DbContext is provider-agnostic. `appsettings` picks one:
```jsonc
{
"ConnectionStrings": {
// Postgres for advanced mode
"Default": "Host=localhost;Database=dorknet;Username=dorknet;Password=..."
// OR SQLite for easy mode
// "Default": "Data Source=dorknet.db"
},
"Database": {
"Provider": "Postgres" // or "Sqlite"
}
}
```
Easy app boots with `Provider=Sqlite` baked in; standalone defaults to
`Provider=Postgres`.
## See also
- [docs/architecture.md](../docs/architecture.md) — request flow,
subdomain routing, Photon relationship
- [docs/advanced-setup.md](../docs/advanced-setup.md) — production setup
- [CONTRIBUTING.md](../CONTRIBUTING.md) — style + PR rules