How fenixedu/bennu works
Project type and purpose
• This is a modular Java web‐application framework (monorepo) called “Bennu” built on top of the Fenix-Framework.
• It provides foundational services (authentication, REST API, job scheduling, file storage, search indexing, theming) and ready‐to‐use frontend modules (admin UI, portal, toolkit, OAuth/CAS/SAML flows).
File structure
• Top‐level POM orchestrates multiple Maven submodules:
• bennu-core: core bootstrap, filters, Jersey REST endpoints, domain model.
• bennu-io: file storage API and adapters (local FS, Drive API).
• bennu-scheduler: job/task scheduling runtime and REST monitoring API.
• bennu-search: domain indexing services.
• bennu-oauth, bennu-cas-client, bennu-saml-client: authentication flows and servlet filters.
• bennu-spring: Spring-MVC integration wrappers.
• bennu-admin, bennu-portal, default-theme, bennu-toolkit: frontend webapps (JSP, HTML templates, JS).
• bennu-maven-plugin: build‐time code generation.
• bennu-test: integration/unit test cases.
• Each module uses DML mapping files, Java packages under org.fenixedu.bennu.* and web fragments (META-INF/web-fragment.xml) to auto-register servlet components.
README for additional insights
• It states Bennu’s goal: build modular Java web apps without reinventing authentication, scheduling, user management.
a. Main components
• Web Container (e.g., Tomcat) hosting the unified WAR
• Core Module (bennu-core)
• Submodules:
• Authentication Clients (CAS, OAuth, SAML)
• File Storage Service (bennu-io)
• Scheduler Service (bennu-scheduler)
• Search Index Service (bennu-search)
• Spring Integration (bennu-spring)
• Maven Plugin (bennu-maven-plugin)
• Frontend Applications (bennu-admin, portal, default-theme, toolkit)
• Database (backing domain model persisted by FenixFramework)
• External Services: CAS Server, OAuth Provider, SAML IdP, Drive API
b. Relationships and interactions
• Clients (browser) → Static assets & JS from frontend modules.
• Frontend modules → REST/API endpoints in core and submodules.
• Core Module registers Jersey application and servlet filters.
• Authentication filters redirect to external CAS/OAuth/SAML providers and ingest callbacks.
• Scheduler polls domain tasks and executes them in background threads.
• FileStorage API adapters write/read to DB or external Drive API.
• Search module reacts to domain object events (Signal EventBus) to update indices.
• Maven plugin runs at build time to generate DML/domain scaffolding.
c. Architectural patterns / design principles
• Modular Monolith using Servlet 3.x web fragments and SPI for auto-registration.
• Plugin architecture: each feature is a module that plugs into the core.
• RESTful services with Jersey (JAX-RS).
• Domain events via Signal EventBus for decoupling.
• DML mapping defines domain model; FenixFramework ORM for persistence.
• Background scheduling thread pool.
• Spring Adapter module exposes MVC controllers.
d. Key technologies / frameworks
• Java 8+, Maven multi-module
• Servlet 3.x, web fragments
• Jersey (JAX-RS)
• FenixFramework (DML + ORM)
• Jackson/Gson for JSON adapters
• Spring MVC (optional)
• JavaScript/CSS libraries in frontend (CodeMirror, Fancytree, Moment.js)
Essential elements
• Module names and their responsibilities
• Data flows (HTTP calls, DB reads/writes, event publications)
• Initialization paths (ServletContainerInitializer → module bootstrapper)
• Key REST resources and filters
• Scheduling and task execution flow
• File storage adapters and chosen storage backend