Architecture Overview
Lesli is built with a clear focus on modularity, scalability, and maintainability. It follows the principles of modern Rails architecture while introducing its own conventions to simplify the development of SaaS platforms.
At its core, Lesli provides a modular structure where new features and components are delivered through Rails engines. This approach ensures clean separation of concerns, easy maintenance, and flexibility to scale your application as needed.
Core Concepts
Core Gem (Lesli)
The Lesli core gem is responsible for providing shared infrastructure, conventions, and utilities across your entire application. It offers:
- Configuration management
- Common helpers and components
- Shared domain models (when appropriate)
- Standardized generator tools
- Support for multi-tenancy (optional)
Engines (Modules)
Modules in Lesli are Rails engines that can be developed and maintained independently. Each engine is isolated and encapsulates a specific domain or feature set. Examples of official engines include:
- LesliShield for roles, privileges, and user management
- LesliDashboard for dashboards and reporting tools
Engines can include:
- Their own models, controllers, views
- Migrations
- Assets (JavaScript, CSS)
- Services and background jobs
- API endpoints
High-Level Architecture
Your Rails App
├── Lesli Core (Gem)
│ ├── Configurations
│ ├── Utilities
│ └── Generators
│
├── Engines (Modules)
│ ├── LesliShield (Authentication / Roles)
│ ├── LesliDashboard (Dashboards / Reporting)
│ └── Custom Engines (Your features)
│
└── Shared Resources
├── Design System (Components, Bulma, SASS)
├── Database (PostgreSQL)
└── API (Optional)
Key Technologies
Layer | Technology |
---|---|
Backend | Ruby on Rails |
Database | PostgreSQL |
Frontend | AlpineJS, Bulma |
Styling | SASS |
Authentication | Devise (via LesliShield) |
How It All Comes Together
- Your App serves as the host Rails application.
- Lesli Core provides the foundation: conventions, generators, and utilities.
- Engines extend your app’s functionality in isolated, reusable modules.
- Frontend Components are shared across modules via LesliView, LesliAssets gems.
- PostgreSQL handles data persistence with clean isolation between core app and engines.
This modular design allows you to grow your SaaS product by simply adding or creating new engines as your needs evolve.
Architecture Diagram
+------------------------------------------------------------+
| Your Rails App |
| |
| +---------------------+ +---------------------------+ |
| | Lesli Core Gem | | Shared Frontend | |
| | (Configuration, | | (Bulma, SASS, Components) | |
| | Utilities, | +---------------------------+ |
| | Generators) | |
| +---------------------+ |
| |
| +---------------------+ +---------------------------+ |
| | LesliShield | | LesliDashboard | |
| | (User Roles, Auth) | | (Dashboards, Widgets) | |
| +---------------------+ +---------------------------+ |
| |
| +---------------------+ |
| | Custom Engines | |
| | (Your Features) | |
| +---------------------+ |
| |
| Database: PostgreSQL |
+------------------------------------------------------------+
Benefits of This Architecture
✅ Clean separation of concerns
✅ Easy to extend and maintain
✅ Scalable for growing SaaS products
✅ Encourages best practices and consistency
✅ Supports both monolithic and modular deployments
Last Update: 2025/07/15