logo

Project Structure and Architecture

Directory Structure

For smaller projects, we entirely adhere to the Laravel's directory and naming structure as outlined in the official documentation. This structure offers clarity and predictability. However, for larger projects that require advanced modularization, we slightly modify the default Laravel structure to adhere to Domain Driven Design (DDD) principles. Specifically:

  • Domains are housed within the /domain directory.
  • Each domain within the /domain directory follows the standard Laravel application structure, promoting consistent conventions even as the codebase grows.

Frameworks and Libraries

  • Backend: We typically use Laravel for the backend. For full-stack Laravel applications, we leverage Laravel Livewire combined with AlpineJS.
  • Frontend: For situations requiring a separate frontend, we opt for Vue.js 3, making use of the composition API and script setup. This is often combined with InertiaJS for seamless integration with Laravel.
  • Admin Panels: Depending on the project's complexity and requirements, we either use FilamentPHP or Laravel Nova.

Architecture

Our inclination is towards monolithic architectures. For larger projects, this monolith is modularized using DDD principles. We generally avoid microservices, reserving their use only for specific scenarios where they're absolutely necessary.

Codebase Modularity

For small-scale applications, the conventional Laravel structures are our guide. In contrast, expansive projects are organized by domain, ensuring separation of concerns and better code manageability.

We recommend the excellent Guide to Domain-Driven Design called Laravel Beyond Crud by Spatie. We will provide you with a copy of this course if you are working on a project that requires this approach.

Database Design

Our approach to databases is simple: stick to Laravel's conventions. Custom implementations or divergences from these conventions are discouraged.

APIs and Endpoints

API versioning is done sparingly. When required, versions are indicated using URL prefixes, e.g., /v1/.

Environment & Configurations

For ensuring security and consistency across environments:

  • Remote environment configurations are managed via Laravel Forge or Laravel Vapor, depending on the hosting solution.
  • Access to production servers and remote environment files is restricted to a select group within the project, emphasizing security.

Documentation

All essential documentation resides within the /documentation directory. In cases where domains are used, each domain will have a dedicated .readme file. The project's primary entry point for documentation is the main README file.

Deployment & Hosting

For applications requiring high scalability, we trust Laravel Vapor. Most projects, however, are hosted using Laravel Forge on servers provided by Hetzner Cloud. Cloudflare serves as our preferred Content Delivery Network (CDN) and Web Application Firewall (WAF).

External Integrations

We're avid users of Fathom Analytics for insightful, privacy-focused web analytics. However, our philosophy leans towards minimizing reliance on third-party services unless absolutely indispensable. In terms of payment integrations, we utilize both Stripe and Lemon Squeezy as our trusted payment providers. Regarding search, we use Algolia for its robust search capabilities.