Skip to content

Add plugin architecture foundation and Spring Boot backend scaffold - #1

Merged
benjaminLedel merged 7 commits into
mainfrom
claude/create-spring-boot-project-GhCyA
Apr 14, 2026
Merged

Add plugin architecture foundation and Spring Boot backend scaffold#1
benjaminLedel merged 7 commits into
mainfrom
claude/create-spring-boot-project-GhCyA

Conversation

@benjaminLedel

Copy link
Copy Markdown
Owner

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) and fiely-core (Spring Boot application), with comprehensive documentation of the extensibility model.

Key Changes

  • Plugin Architecture Documentation (docs/plugin-architecture.md)

    • Comprehensive guide to PF4J-based plugin system with extension points for AI providers, storage backends, authentication, file processors, notifications, and third-party apps
    • Security model, permission system, and plugin lifecycle documentation
    • Frontend plugin mechanism via Module Federation for dynamic UI component loading
    • Detailed roadmap across three phases (Foundation, AI & Processing, Third-Party Apps)
  • Backend Project Structure

    • Converted fiely-backend to a Gradle multi-module build with fiely-plugin-api and fiely-core submodules
    • Added Gradle wrapper (8.11.1) for reproducible builds
    • Configured Spring Boot 3.4.1 with Java 21, PostgreSQL, Flyway migrations, and JPA
  • Spring Boot Application Scaffold (fiely-core)

    • FielyApplication entry point with Spring Boot auto-configuration
    • HealthController with /api/ping smoke-test endpoint
    • Module placeholders for auth, files, sharing, users, ai, storage, and common packages
    • Application configuration (application.yml) with database and actuator setup
    • Test profile with H2 in-memory database for unit tests
    • Dev profile with SQL logging and debug-level logging for cloud.fiely
  • Database Setup

    • Baseline Flyway migration (V1__init.sql) with schema info table
    • PostgreSQL 15+ as primary database with pgvector extension support
  • Testing

    • Integration test (FielyApplicationTests) verifying Spring context loads and /api/ping responds
    • Unit test (HealthControllerTest) for the health controller
    • Test configuration with H2 and Flyway disabled in test profile
  • Documentation

    • Updated README.md to reflect Kotlin backend and plugin architecture
    • Added fiely-backend/README.md with prerequisites, run instructions, environment variables, and module layout
    • Updated .gitignore to properly exclude Gradle build artifacts while preserving wrapper JARs

Notable Implementation Details

  • Kotlin-first backend: The architecture document specifies Kotlin as the language for fiely-plugin-api, fiely-core, and all first-party plugins, leveraging Spring Boot's excellent Kotlin support
  • Minimal plugin API: fiely-plugin-api has no Spring or heavy dependencies to keep plugin JARs small and reduce coupling
  • Built-in defaults: JWT auth, local filesystem storage, and in-app notifications are always available without plugins, ensuring Fiely works out of the box
  • Modular monolith: Feature modules own their own controllers, services, repositories, and migrations; cross-module access goes through public APIs
  • Plugin configuration: Plugins read configuration from application.yml under fiely.plugins namespace with environment variable substitution support

https://claude.ai/code/session_01UhAXSeBGsN7VFq7KvvsECc

claude added 7 commits April 11, 2026 17:22
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
benjaminLedel merged commit 5fa0ccd into main Apr 14, 2026
2 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants