Add plugin architecture foundation and Spring Boot backend scaffold - #1
Merged
Merged
Conversation
Bootstrap the fiely-backend Spring Boot module per docs/architecture.md: - Gradle (Kotlin DSL) build with Gradle Wrapper 8.11.1 - Spring Boot 3.4.1 on Java 21 - Starters: web, actuator, data-jpa, validation - Flyway migration engine with V1__init.sql baseline - Empty module packages (auth, files, sharing, users, ai, storage, common) as placeholders — features land in follow-up commits - Health smoke-test endpoint GET /api/ping - SpringBootTest + WebMvcTest running on in-memory H2 https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
MinIO is no longer planned. File storage will be implemented using the local filesystem initially. Updated README, architecture docs, package-info, and .gitignore accordingly. https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
Describes the PF4J-based plugin system with six extension points: AIProvider, StorageProvider, AuthProvider, FileProcessor, NotificationProvider, and FielyApp (third-party apps). Covers module structure (fiely-plugin-api + fiely-core), event system, plugin lifecycle, configuration, security/isolation, and a phased roadmap for implementation. https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
- Backend language is now Kotlin (updated README tech stack + architecture) - architecture.md: updated module structure to reflect plugin-api + core split, Kotlin code examples, link to plugin-architecture.md - plugin-architecture.md: resolved open questions — Kotlin for entire backend, third-party apps can ship frontend components via webapp/ directory with manifest.json and dynamic loading https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
- plugin-architecture.md: document first-party plugins in monorepo under fiely-backend/plugins/, dependency graph, first-party vs third-party comparison table, updated default plugins section, expanded 4-phase roadmap - architecture.md: module structure shows full multi-project layout including all first-party plugins - fiely-backend/README.md: rewritten for Kotlin multi-project build, updated run commands to :fiely-core:bootRun, project structure reflects plugin submodules https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
…itecture Major restructuring of fiely-backend: - Convert from single-module Java to Gradle multi-project Kotlin build - Root build.gradle.kts with shared Kotlin/JVM config for all submodules fiely-plugin-api (new): Kotlin module with PF4J extension point interfaces: AIProvider, StorageProvider, AuthProvider, FileProcessor, NotificationProvider, FielyApp, plus shared DTOs and event types. Zero Spring dependencies — keeps plugin JARs minimal. fiely-core (new): Spring Boot application migrated from Java to Kotlin. FielyApplication.kt, HealthController.kt, tests in Kotlin. Depends on fiely-plugin-api + pf4j-spring. plugins/ (new, 9 first-party stubs): fiely-auth-jwt, fiely-auth-oidc, fiely-auth-ldap, fiely-storage-local, fiely-ai-ollama, fiely-ai-openai, fiely-ai-claude, fiely-processor-text, fiely-notify-email. Each has build.gradle.kts with compileOnly(fiely-plugin-api). Old Java sources under src/main/java removed. All tests pass (2/2 green against H2). https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
- fiely-backend/Dockerfile: multi-stage build (gradle:8.11-jdk21 for build, eclipse-temurin:21-jre for runtime). Non-root fiely user, HEALTHCHECK against /actuator/health via curl. - fiely-backend/.dockerignore: excludes gradle caches, build outputs, IDE files. - .github/workflows/ci.yml: two jobs, build-and-test runs ./gradlew build and uploads the fiely-core JAR; docker-build depends on it and builds the container (pushes to GHCR only on main). Uses GitHub Actions cache for Gradle and buildx layers. https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc
benjaminLedel
pushed a commit
that referenced
this pull request
Apr 15, 2026
Adds the file tree the product revolves around, backed by a new pluggable storage layer. Covers items #1 and #2 of the next-priorities plan. Schema (V3, V4): - tenants table with max_upload_bytes setting; seeds a stable default tenant - auth_users.tenant_id with a DB default so the existing jwt-plugin UserRepository keeps working unmodified - files: single self-referential table, folder-XOR-blob CHECK, unique name per (owner, parent) + partial unique index for the root Core: - FileEntity / FileRepository / FileService / FileController with OpenAPI annotations matching AuthController's style - CurrentUserResolver factors bearer-token -> UserInfo + tenant lookup out of the controllers (no Spring Security; matches existing ad-hoc pattern) - Tenant entity + repository; per-tenant upload cap enforced in FileService - REST surface: POST /api/files (multipart), POST /api/files/folder, GET /api/files, GET /api/files/{id}, GET /api/files/{id}/content (streamed), PATCH /api/files/{id} (rename/move), DELETE /api/files/{id} (recursive) Plugin fiely-storage-local: - Implements StorageProvider with UUID-sharded filesystem layout (<root>/<tenant>/<xx>/<yy>/<fileId>/v<N>) - Atomic-move semantics so partial writes never materialise - Path-escape defenses on all ref resolutions Tests: - LocalStorageProviderTest: round-trip, prune-on-delete, path-escape, partial-write rejection - FileControllerTest: end-to-end via H2 + stubbed AuthProvider/StorageProvider; covers upload/list/download/delete, 401/409/413, folder nesting, rename, move-into-descendant rejection - FilePluginIntegrationTest: real Postgres + real plugin JARs + real JWT, round-trips bytes through the filesystem (skipped without Docker, same pattern as AuthPluginIntegrationTest) Build: - kotlin("plugin.jpa") applied to fiely-core so Hibernate can instantiate entities - copyTestPlugins now bundles fiely-storage-local alongside fiely-auth-jwt Configuration: - fiely.storage.provider (active provider id) - fiely.plugins.fiely-storage-local.root (blob root) - spring.servlet.multipart.max-file-size raised to 1GB as a transport ceiling; per-tenant limit is the real cap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR establishes the plugin architecture for Fiely and scaffolds the Spring Boot backend as a Gradle multi-module project. The backend is now organized into
fiely-plugin-api(shared interfaces) andfiely-core(Spring Boot application), with comprehensive documentation of the extensibility model.Key Changes
Plugin Architecture Documentation (
docs/plugin-architecture.md)Backend Project Structure
fiely-backendto a Gradle multi-module build withfiely-plugin-apiandfiely-coresubmodulesSpring Boot Application Scaffold (
fiely-core)FielyApplicationentry point with Spring Boot auto-configurationHealthControllerwith/api/pingsmoke-test endpointapplication.yml) with database and actuator setupcloud.fielyDatabase Setup
V1__init.sql) with schema info tableTesting
FielyApplicationTests) verifying Spring context loads and/api/pingrespondsHealthControllerTest) for the health controllerDocumentation
README.mdto reflect Kotlin backend and plugin architecturefiely-backend/README.mdwith prerequisites, run instructions, environment variables, and module layout.gitignoreto properly exclude Gradle build artifacts while preserving wrapper JARsNotable Implementation Details
fiely-plugin-api,fiely-core, and all first-party plugins, leveraging Spring Boot's excellent Kotlin supportfiely-plugin-apihas no Spring or heavy dependencies to keep plugin JARs small and reduce couplingapplication.ymlunderfiely.pluginsnamespace with environment variable substitution supporthttps://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc