How p33tr/minstances works
Main Components
a. Presentation Layer:
• MVC Components
• Controllers (BskyController, HomeController, TextSearchController)
• Views (Razor Pages in the Views directory)
• Models (Instance, InstX, Search, etc.)
• Static Content (wwwroot folder with CSS, JS, and client-side libraries)
b. Business Layer:
• Services
• InstancesService
• MastodonService
c. Data Layer:
• Repository Pattern Implementation
• IMinstancesRepository (interface)
• MinstancesRepository (concrete implementation)
• Database Context (MinstancesContext)
• Entity Models
┌─────────────────────────────────────────────┐
• Client Browser │
• ┬───┘
• ↕ HTTP
┌─────────────────────────────────────────┴───┐
• Presentation Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────┐ │
• Controllers │ │ Views │ │Models│ │
• ┘ └─────────────┘ └─────┘ │
• ┬───────────────────┘
• ↕
┌─────────────────────────┴───────────────────┐
• Business Layer │
• ┌─────────────┐ ┌──────────────────┐ │
• Instances │ │ Mastodon │ │
• Service │ │ Service │ │
• ┘ └──────────────────┘ │
• ┬───────────────────┘
• ↕
┌─────────────────────────┴───────────────────┐
• Data Layer │
• ┌─────────────┐ ┌──────────────────┐ │
• Repository │ │ Database │ │
• Interface │←────→│ Context │ │
• ┘ └──────────────────┘ │
• ┬───────────────────┘
• ↕
┌─────────────────────────┴───────────────────┐
• Database Storage │
• ┘
Additional Elements
a. External Services:
• A connection to the Mastodon API (since this appears to be a Mastodon instance listing service)
• SSE (Server-Sent Events) connections (noticed from SseClient model)
b. Cross-Cutting Concerns:
• Error handling (ErrorViewModel)
• Configuration (appsettings.json)
• Static file serving (wwwroot)
Important Relationships to Highlight
• Controller dependencies on Services
• Repository pattern implementation
• Database context relationships with models
• View models (VM) relationship with views
Technical Stack Indicators
• ASP.NET Core MVC
• Entity Framework Core (evident from Migrations folder)
• jQuery and Bootstrap (from wwwroot/lib)