How mattsplat/logger-app works
Project Type and Purpose
• This is a full‐stack desktop logging app ("Desktop Logger App") built on a NativePHP (Laravel) backend with a Vue + TailwindCSS frontend.
• It wraps the Opcodes Log Viewer library to scan and display Laravel log files from any local project folder, without requiring those projects to install extra dependencies.
Main Architectural Components
a. User (Developer)
b. Frontend
– Vue.js SPA (resources/js, components in .vue files)
– TailwindCSS styling (resources/css/app.css, tailwind.config.js)
– Vite.js build pipeline (vite.config.js)
c. HTTP Server / Native App Host
– NativePHP’s embedded HTTP server (artisan native:serve)
– Public folder serving entry point (public/index.php)
d. Laravel Application
– Routing layer (routes/web.php, routes/api.php)
– Middleware stack (app/Http/Middleware)
– Controllers (DashboardController, ProjectController)
– Service Providers (NativeAppServiceProvider, AppServiceProvider, etc.)
– Composer dependencies (composer.json)
e. Log Viewer Service
– Opcodes Log Viewer library integration (invoked by controllers)
f. Storage Layer
– Local file system scanning (config/filesystems.php, storage/app or any user‐selected log folder)
g. Optional Data Stores
– Default Laravel database (config/database.php) for any internal persistence (not central to log viewing)
h. Development Tooling
– Node/npm (package.json)
– PHPUnit tests (tests/)
– Artisan CLI scripts
Component Interactions and Data Flow
1) User opens the desktop app in a browser window.
2) Vue SPA loads static assets from public/ via the NativePHP server.
3) SPA makes HTTP requests (API calls) to endpoints (e.g., /api/projects, /api/logs) through routes defined in routes/api.php or routes/web.php.
4) Requests pass through Laravel middleware (authentication, CSRF protection, etc.).
5) Controllers call into the Opcodes Log Viewer service to scan the selected log directory on disk.
6) The service reads log files via the file system.
7) JSON responses containing log entries or project lists return to the SPA.
8) SPA renders the logs in interactive tables and modals (ProjectTable.vue, ProjectFormModal.vue).
Architectural Patterns and Principles
• MVC pattern within Laravel (Models are minimal here—Project model may simply represent a log directory).
• Layered architecture: Presentation (Vue), Application/API (Controllers & Routes), Service (Opcodes Log Viewer), Infrastructure (File System).
• Dependency injection and service providers for extensibility (NativeAppServiceProvider registers the embedded server).
• Single‐Page Application on the frontend with RESTful API backend.
Elements
• Version of key frameworks/libraries (Laravel/NativePHP, Vue, TelerikCSS).
• Data stores like the local file system and optional DB.
• Build tools (Node/npm, Vite) as a side cluster.