How benargo/regrowth-website works
1. Overall shape
CompWatcher is a Laravel 11 monolith with an Inertia-style React frontend. The backend owns routing, domain logic, persistence, queues, caching, and API integrations; the resources/js layer is a UI shell for officer workflows rather than a separate frontend application.
2. Primary domain boundaries
The codebase is organized around four main business areas: raiding/attendance, loot council, guild roster/permissions, and Discord automation. Each area has its own controllers, models, policies, resources, jobs, and events, which keeps the architecture centered on domain workflows instead of generic CRUD.
3. Web request flow
Browser requests enter through routes/web.php and are handled by Laravel controllers in app/Http/Controllers. Requests are validated by dedicated form request classes, authorized by policies, and serialized through API resources before being rendered into React pages under resources/js/Pages.
4. Front-end composition
The UI is server-driven via Inertia, with reusable React components in resources/js/Components, shared layout in resources/js/Layouts, and page-specific features grouped by domain. This means the frontend mostly consumes backend-provided data models and permissions rather than maintaining its own independent API state layer.
5. Persistence layer
Data is stored in MySQL through Eloquent models in app/Models, with migrations showing the main schema: users/Discord identity, characters, guild ranks/tags, raids and reports, event assignments/groups, loot council items/comments/priorities, planned absences, spells/markers, and supporting lookup tables like zones and classes. Casts and custom Eloquent helpers are used heavily to normalize Warcraft/Discord-specific value shapes.
6. Integration services
External dependencies are abstracted behind service namespaces: Blizzard, Discord, RaidHelper, and Warcraft Logs. These services encapsulate authentication, API clients, payload/resource mapping, and domain-specific exceptions, so the rest of the app interacts with stable application services instead of raw HTTP calls.
7. Background processing
Non-interactive work is pushed to jobs in app/Jobs and executed via Laravel queues/Horizon. Examples include fetching guild rosters, syncing Discord roles/users, processing GRM uploads, fetching RaidHelper events, rebuilding loot council cache, and importing Warcraft Logs attendance/reports. This is a key boundary: user actions trigger jobs, and jobs later update domain models and cached projections.
8. Event-driven side effects
The app uses a sizable event/listener layer to decouple write operations from follow-up work. Domain events such as character updates, report changes, comment actions, and assignment changes fan out to listeners that flush caches, prefetch media, schedule addon builds, or trigger roster refreshes. That pattern keeps controllers and jobs focused on primary state changes.
9. Caching and derived views
Cache invalidation is treated as part of the architecture, not an implementation detail. Separate listeners and cache-flush contracts exist for attendance, permissions, raiding, reports, Warcraft Logs, and loot council, indicating that many screens are backed by computed or preprocessed data rather than direct database reads.
10. Discord as an operational surface
Discord is both an identity provider and an output channel. OAuth login goes through Discord auth controllers, Discord roles/users are synchronized from guild state, and a custom notification driver plus Discord-specific notification classes post updates to channels. This makes Discord an extension of the application’s workflow, not just an integration.
11. Raid analytics pipeline
Attendance and reporting features are built around a data pipeline from external logs into internal analytical views. Warcraft Logs data is fetched into reports/guild-tag structures, then attendance services transform that raw data into matrix, graph, scatter, and dashboard-friendly projections for the React views.
12. Loot council subsystem
Loot council is its own mini-domain with items, priorities, comments, reactions, notes, and raid-context views. It includes cache rebuilds, media prefetching, and resource classes for item/boss presentation, which suggests a write-heavy collaborative workflow with computed read models and UI-centric formatting.
13. Addon/export and guild administration
Administrative features include addon settings, phase/rank management, permissions, and export file generation. The BuildAddonExportFile command/job pair and related scheduling contract show that the app periodically produces guild-facing artifacts consumed outside the web UI.
14. Tests as architecture signals
The repo has broad feature, unit, and smoke coverage across controllers, jobs, listeners, services, policies, resources, and models. That test structure mirrors the production boundaries closely, reinforcing that the app is designed as a set of coordinated domains with clear seams between HTTP, async work, integrations, and persistence.
Main entry points: Controllers Controllers · Services Domain services · Jobs Jobs · Models Models
Components 20
Laravel backend
HTTP, domain logic, jobs, events, and persistence
- Web routes · Browser entrypoints and page routing
routes/web.php - Controllers · Main request handlers for raiding, loot council, dashboard, roster, auth, and reports
app/Http/Controllers - Form requests · Dedicated request validation and input shaping
app/Http/Requests - Policies · Access control for dashboard and domain actions
app/Policies - API resources · Response transformers for characters, raids, reports, loot council, and permissions
app/Http/Resources - Domain services · Attendance, roster, Blizzard, Discord, RaidHelper, and Warcraft Logs service layers
app/Services - Jobs · Queued sync and import tasks for roster, logs, Discord, and addon exports
app/Jobs - Listeners · Cache flushes, follow-up sync, media prefetch, and scheduled exports
app/Listeners - Domain events · Write-side signals for character, report, comment, assignment, and guild changes
app/Events - Console commands · Operator commands for roster sync, logs refresh, raid helper fetches, and addon export build
app/Console/Commands
External integrations
Service adapters for Blizzard, Discord, RaidHelper, and Warcraft Logs
- Discord adapter · OAuth, guild member/role sync, notifications, and message payloads
app/Services/Discord - Blizzard adapter · Battle.net auth, media fetching, and playable class/race normalization
app/Services/Blizzard - RaidHelper adapter · Raid event fetching and composition payload mapping
app/Services/RaidHelper - WCL adapter · Warcraft Logs auth, guild tags, reports, and attendance retrieval
app/Services/WarcraftLogs
Inertia UI
React pages and reusable UI shell
- Inertia shell · Server-driven React entry, layouts, shared components, and permissions hook
resources/js - Pages · UI pages for raiding, loot council, dashboard, roster, quests, and auth
resources/js/Pages - UI components · Reusable controls, tables, loot widgets, event widgets, and charting pieces
resources/js/Components - Master layout · Shared application frame and navigation chrome
resources/js/Layouts/Master.jsx
Schema layer
Database models, migrations, and seeders
- Models · Core domain entities for raids, loot council, roster, permissions, and logs
app/Models - Migrations · Database schema for users, characters, raids, reports, loot council, and supporting lookup tables
database/migrations
Connections 21
- Web routes → Controllers: dispatches · Web routes resolve into Laravel controllers
- Controllers → Form requests: validates with · Controllers delegate validation to form requests
- Controllers → Policies: authorizes via · Domain actions are gated by policies
- Controllers → API resources: serializes with · Responses are shaped before reaching the UI
- Controllers → Domain events: emits · Primary state changes raise domain events
- Domain events → Listeners: fan out to · Listeners handle cache and follow-up side effects
- Listeners → Jobs: dispatches · Listeners can schedule async work
- Console commands → Jobs: kicks off · Console entrypoints often enqueue or run background tasks
- Jobs → Models: updates · Queued work persists synced state and projections
- Jobs → Domain services: calls · Jobs use application services for external data fetches
- Domain services → Discord adapter: adapts · Discord-specific workflows are isolated behind an adapter
- Domain services → Blizzard adapter: adapts · Blizzard data and media are normalized in one place
- Domain services → RaidHelper adapter: adapts · RaidHelper payloads and event sync are encapsulated
- Domain services → WCL adapter: adapts · Warcraft Logs sync and analytics are encapsulated
- Models → Migrations: persisted by · Models are backed by the schema layer
- Controllers → Models: reads/writes · Controllers operate on Eloquent entities
- API resources → Models: maps · Resources transform domain objects into view data
- Inertia shell → Pages: renders · The React shell loads domain pages
- Pages → UI components: composes · Pages reuse shared UI components
- Inertia shell → Master layout: wraps with · Shared layout frames all pages
- Controllers → Inertia shell: serves · Controllers return Inertia responses to the React shell