How benefactorum/app works
Based on your project’s file tree and README, Benefactorum is a full-stack non-profit donation platform designed to let French donors discover and support causes they care about. Its tech stack comprises a Ruby on Rails backend (with SQLite as the database) and a React with TypeScript frontend, bridged by Inertia.js for SSR capabilities. It also uses TailwindCSS and shadcn/ui for styling, and modern build/deployment tooling (Vite, Kamal, GitHub Actions, and dev containers).
Main Components
• Frontend Client: Represent the React with TypeScript application.
• Use of Inertia.js for handling server-side rendering and bridging with Rails.
• Role of assets, shared UI components (including those from shadcn/ui), hooks, and pages.
• Backend API: Capture the Ruby on Rails application.
• Controllers (including auth-related and resource-specific ones such as Contributions, Osbl, Users, etc.), models, serializers, jobs, mailers, and services.
• Architectural patterns like MVC and service objects (for contribution and osbl import logic).
• Database: Include the SQLite database and any replication features (Litestream).
• External Integrations:
• Deployment: Kamal hooks, Docker setup (from both the root Dockerfile and the .devcontainer folder), GitHub Actions workflows for CI/CD.
• APIs/External Services: Note any integration modules (e.g., GitHub API, French Address API) visible under the lib folder.
• Additional Components:
• Asynchronous processing: Jobs that handle tasks like osbl_import processing and creation.
• Testing environment: Separate test directories for frontend and backend testing (RSpec, system tests, etc.).
• DevOps and Containerization: Dev container configuration along with Docker-related files.
• Static assets and public files: Represent the public folder contents (error pages, robots.txt, and assets like PDFs).
Relationships and Interactions
• API calls and data flows that occur between these layers.
• Backend Internal Flows:
• How Rails controllers interact with models and services.
• Detail asynchronous workflows (jobs processing and external API interactions).
• Mailers for notifications.
• Data Storage:
• Rails backend to the SQLite database.
• Optionally detail migration flows for setting up and updating data schemas.
• CI/CD Pipeline & DevOps:
• Build processes like Vite bundling for frontend assets and containerization steps.
• External APIs:
• Link from the services (and lib modules) to external APIs (e.g., GitHub, Firecrawl, or French Address API).
Architectural Patterns and Design Principles
• That the backend uses Rails’ MVC pattern, supplemented with service objects and background jobs.
• The frontend leverages component-based architecture with a clear separation between layout, pages, and shared UI components.
• Separation of concerns between the development environment (containerized setup), build pipeline (using Vite and GitHub Actions), and production deployment.
• Use of Dependency Injection – for example, the use of hooks and context in React, as well as decoupled services in Rails.
Technologies, Frameworks, and Libraries
• Ruby on Rails 8 for Backend.
• SQLite (and Litestream replication if relevant) for the database.
• React with TypeScript, Inertia.js, TailwindCSS, and shadcn/ui for the frontend.
• Vite for asset bundling.
• Kamal for deployment.
• Containerization using Docker and Dev Containers.
• CI/CD with GitHub Actions.