How frikishaan/tiny-crm works
Project Type and Purpose
• This project is an open-source CRM application called “Tiny CRM” built with Laravel and Filament PHP.
• Its purpose is to provide a CRM system with modules for managing accounts, contacts, deals, leads, products, and users. The project leverages Filament PHP to deliver an admin panel/dashboard experience.
File Structure
• The top-level directories (app, config, database, public, resources, routes) indicate a standard Laravel MVC structure.
• The “app” directory contains Controllers, Models, Events, Enums, Providers, and additional features (like Observers and Listeners) which reveal the modularity and event-driven aspects of the design.
• The “app/Filament” directory holds the Filament-specific files (pages, resources, widgets) used to define the admin panel interface and resource CRUD operations.
• The “public” and “resources” directories contain assets (CSS, JS, etc.) that support the frontend.
• Routing is handled by files in the “routes” directory indicating separation of API, web, and console commands.
• The database folder (migrations, factories, seeders) clearly shows the persistence layer using a relational database (configured for PostgreSQL).
README for Additional Insights
• The README confirms the tech stack (PHP, Laravel, Filament PHP) and indicates that this is a full-stack web application.
• It includes instructions for installing dependencies, running migrations, and seeding the database, affirming the importance of the database layer.
• The screenshot reference suggests a strong UI component in the admin dashboard.
a. Frontend Client:
• Represented by the browser or client devices accessing the Tiny CRM UI.
• Connects to the Laravel backend which serves pages (e.g., Filament dashboard, login page, etc.).
b. Laravel Web Server / Backend:
• Handle HTTP requests routed via “routes/web.php” (and “routes/api.php” for API endpoints, if any).
• Contains Controllers in “app/Http/Controllers” that mediate between the incoming requests and business logic.
• The Middleware layer (in “app/Http/Middleware”) handles authentication, CSRF protection, and other HTTP concerns.
c. Filament Admin Panel:
• A specialized module within the backend for admin interface and dashboard functionalities.
• It includes Filament Pages, Resources, Widgets, and Panels as seen in the “app/Filament” directory.
• This component manages CRUD operations for resources such as accounts, contacts, deals, leads, products, and users.
d. Business Logic & Domain Layer:
• Models (in “app/Models”) represent the core entities of the CRM (Account, Contact, Deal, etc.).
• Enums (in “app/Enums”) define constants for statuses (like DealStatus, LeadStatus, etc.).
• Observers, Listeners, and Events (e.g., in “app/Observers” and “app/Events”) capture domain events and process business logic (like rollup aggregations for sales).
e. Persistence / Database:
• The database layer is managed via Laravel’s migrations, seeders, and factories.
• A PostgreSQL database is used (as configured in the provided .env example).
• The Models interact with the relational database using Laravel’s ORM (Eloquent).
f. Assets & Frontend Build Process:
• The “public” and “resources” directories contain the compiled assets (JS, CSS, etc.) built with tools like Vite and Tailwind CSS.
• These assets are served to the browser to render the UI.
Relationships and Interactions
• Routing layer (web routes, api routes, console commands) as part of the backend entry points.
• Controllers interacting with models and the database.
• Demonstrate the admin panel (Filament) as an integral part of the Laravel application, handling user interactions for CRM functionalities.
• Event listeners and observers connecting to model events – which in turn may trigger further business logic or background jobs.
• If needed, include a component for storage/logging as part of the operational or debugging layer.
Architectural Patterns and Design Principles
• MVC Pattern: Emphasize that the project is organized around Model, View, and Controller components.
• Event-Driven Architecture: Indicate that events and observers are used for decoupled background processing (e.g., real-time updates or sales rollup operations).
• Modular and Extensible Design via Filament: The Filament-specific resources allow easy extension of the admin panel functionalities.
• Separation of Frontend and Backend: Although they reside in the same application, clearly delineate the UI (assets and view templates) from the business logic and persistence layers.