The Reference Implementation of the MehguViewer Core Node.
MehguViewer.Core is the high-performance, self-hostable server component of the MehguViewer Ecosystem. It handles content management, media streaming, and user progress tracking with an integrated web-based admin interface.
- Download the latest release for your platform from GitHub Actions β Build Artifacts
- Extract the downloaded archive
- Run the executable:
# Linux/macOS ./MehguViewer.Core # Windows .\MehguViewer.Core.exe
- Open your browser to
http://localhost:6230
That's it! The application includes everything needed - no additional setup required.
- Operating System: Linux, macOS, or Windows
- Memory: 512MB RAM minimum (1GB recommended)
- Storage: 100MB for application + storage for your content
- Network: Internet connection for initial setup (optional)
This repository implements the Core API defined in MehguViewer.Proto.
| Component | Technology | Description |
|---|---|---|
| Backend API | ASP.NET Core 9 (.NET 9) | High-performance REST API with Native AOT compilation |
| Database | Embedded PostgreSQL | Zero-configuration database (with memory fallback) |
| Admin Interface | Blazor WebAssembly | Integrated web dashboard for management |
| Authentication | JWT + JWKS | Stateless validation of tokens from Auth Server |
| File Serving | Native HTTP | Direct streaming of media assets |
- π Instant Startup: Native AOT compilation for sub-second startup times
- πΎ Flexible Storage: File-based JSON persistence with PostgreSQL support
- π₯οΈ Integrated Admin Panel: Built-in Blazor WebAssembly dashboard
- π Secure by Design: Role-based access control (Admin, Uploader, User)
- π Universal Content: Supports Manga, Anime, and Novels with URN addressing
- π·οΈ Rich Taxonomy: Authors, Scanlators, Groups, Tags, and Content Warnings
- π Localization Support: Multi-language series with localized versions
- β‘ Dual Delivery Modes: Proxy mode for security, CDN mode for performance
- π³ Container Ready: Optimized Docker images with multi-stage builds
- π§ Self-Contained: Single executable with no external dependencies
- .NET 9.0 SDK
- Git
MehguViewer.Core/
βββ MehguViewer.Core.csproj # Main ASP.NET Core application
βββ Program.cs # Application entry point
βββ appsettings.json # Configuration settings
βββ Dockerfile # Container build definition
β
βββ MehguViewer.Core.UI/ # Blazor WebAssembly admin interface
β βββ Pages/ # Routable pages (Series, Users, Settings, etc.)
β βββ Components/ # Reusable UI components and dialogs
β βββ Layout/ # Application layouts
β βββ Services/ # Client-side services (ApiService, Auth)
β βββ wwwroot/ # Static web assets
β βββ README.md # UI documentation
β
βββ MehguViewer.Core.Shared/ # Shared domain models and DTOs
β βββ Domain.cs # Public API models (Series, Units, etc.)
β βββ AdminModels.cs # Admin-specific models (Users, Jobs)
β βββ Problem.cs # RFC 7807 error handling
β βββ README.md # Shared models documentation
β
βββ Endpoints/ # API endpoint definitions
β βββ SeriesEndpoints.cs # Series CRUD operations
β βββ UserEndpoints.cs # User management
β βββ SystemEndpoints.cs # System and taxonomy endpoints
β βββ ... # Additional endpoint groups
β
βββ Services/ # Business logic and background services
β βββ FileBasedSeriesService.cs # File-based series storage
β βββ ImageProcessingService.cs # Image variant generation
β βββ AuthService.cs # Authentication logic
β βββ ... # Additional services
β
βββ Infrastructures/ # Data access layer
β βββ IRepository.cs # Repository interface
β βββ MemoryRepository.cs # In-memory implementation
β βββ PostgresRepository.cs # PostgreSQL implementation
β βββ DynamicRepository.cs # Dynamic repository selection
β
βββ Middlewares/ # Custom ASP.NET Core middleware
β βββ JwtMiddleware.cs # JWT validation
β βββ RateLimitingMiddleware.cs # Rate limiting
β βββ ServerTimingMiddleware.cs # Performance tracking
β
βββ Tests/ # Comprehensive test suite
β βββ Endpoints/ # Endpoint tests
β βββ Services/ # Service tests
β βββ Infrastructures/ # Repository tests
β βββ Integrations/ # Integration tests
β βββ Unit/ # Unit tests
β βββ README.md # Testing documentation
β
βββ Public/ # Static assets and branding
β βββ logo-light.png # Light theme logo
β βββ logo-dark.png # Dark theme logo
β βββ thumbnail.png # Application thumbnail
β
βββ data/ # Runtime data (auto-created)
βββ series/ # Series JSON files
βββ covers/ # Cover images
βββ users/ # User data
Documentation:
- MehguViewer.Core.UI Documentation - Blazor WebAssembly admin interface
- MehguViewer.Core.Shared Documentation - Shared domain models
- Testing Documentation - Test suite organization and usage
# Clone the repository
git clone https://github.com/MehguViewer/MehguViewer.Core.git
cd MehguViewer.Core
# Restore dependencies
dotnet restore
# Run in development mode (with hot reload)
dotnet watch run
# Or run normally
dotnet runThe application will be available at:
- Admin Dashboard:
http://localhost:6230 - API Endpoints:
http://localhost:6230/api/v1/...
The application uses sensible defaults and can be configured through the web interface. For advanced scenarios, create an appsettings.json file:
{
"EmbeddedPostgres": {
"Enabled": true,
"FallbackToMemory": true
},
"Logging": {
"LogLevel": {
"Default": "Information"
}
}
}# Run all tests
dotnet test
# Run with coverage
dotnet test /p:CollectCoverage=true
# Run specific category
dotnet test --filter "Category=Integration"Build and run with Docker:
# Build the optimized image
docker build -t mehguviewer-core .
# Run the container
docker run -p 6230:6230 \
-v /path/to/your/content:/app/content \
-v mehguviewer-data:/app/data \
mehguviewer-coreversion: '3.8'
services:
mehguviewer:
image: mehguviewer-core
ports:
- "6230:6230"
volumes:
- ./content:/app/content
- mehguviewer-data:/app/data
restart: unless-stoppedThe Core API follows the OpenAPI specification defined in MehguViewer.Proto.
| Endpoint | Description |
|---|---|
GET /api/v1/series |
List all series |
POST /api/v1/series |
Create a new series (Admin/Uploader) |
GET /api/v1/series/{id} |
Get series details |
PUT /api/v1/series/{id} |
Update series (Owner or Admin) |
DELETE /api/v1/series/{id} |
Delete series (Owner or Admin) |
GET /api/v1/system/taxonomy |
Get all authors, scanlators, groups, tags |
GET /api/v1/assets/{urn} |
Stream media assets |
GET /.well-known/mehgu-node |
Node metadata |
- Admin: Full access to all series and system settings
- Uploader: Can create series and edit/delete their own series
- User: Read-only access to series and personal library
The application provides comprehensive logging and monitoring:
- Application Logs: Available in console output and through
/api/v1/system/logs - Health Checks: Built-in health endpoints for monitoring
- Performance Metrics: Server timing headers and response compression
- Database Status: Automatic fallback to memory storage if PostgreSQL fails
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and add tests
- Run tests:
dotnet test - Submit a pull request
- Follow the MehguViewer.Proto specifications
- Use URN-based identifiers for all resources
- Implement proper error handling with RFC 7807 Problem Details
- Add integration tests for new endpoints
- Update documentation for API changes
This project is licensed under the terms specified in the LICENSE file.
- Documentation: MehguViewer.Proto
- Issues: GitHub Issues
- Discussions: GitHub Discussions
MehguViewer.Core Β© 2025

