Skip to content

feat: migrate server to spring boot#31

Merged
MaximilianAnzinger merged 17 commits into
mainfrom
feature/migrate-server-side-to-spring-boot
Jan 27, 2026
Merged

feat: migrate server to spring boot#31
MaximilianAnzinger merged 17 commits into
mainfrom
feature/migrate-server-side-to-spring-boot

Conversation

@vtotalova

@vtotalova vtotalova commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Description

Complete migration from Node.js/Prisma backend to Spring Boot microservices architecture. This PR replaces the original TypeScript/Prisma backend with a production-ready Spring Boot application featuring PostgreSQL, Keycloak authentication, and Docker Compose orchestration. The frontend has been updated to use TanStack Query with Axios for API communication while preserving the original UI design.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 Style/formatting changes (no functional changes)
  • ♻️ Code refactoring (no functional changes)
  • ⚡ Performance improvements
  • 🔧 Configuration changes
  • 🧪 Test additions or modifications
  • 🚀 Deployment/DevOps changes

Related Issues

  • Related to backend migration initiative

Changes Made

Server

  • New Spring Boot 3.4.1 backend with Java 17
    • REST API controllers with OpenAPI/Swagger documentation
    • Spring Data JPA with PostgreSQL 16
    • Flyway database migrations
    • Spring Security with OAuth2/JWT via Keycloak
    • Docker Compose orchestration (app, postgres, keycloak)
    • Management script (server/server-manage.sh) for common operations
    • Gradle 8.11.1 build system

Client

  • API Integration Layer

    • New lib/api/ directory with Axios-based API clients
    • TanStack Query (React Query) for server state management
    • TypeScript types matching Spring Boot DTOs
    • Proper error handling and loading states
  • Session Page Rewrite

    • Migrated from server actions to client-side React Query
    • Full CRUD operations for competencies and relationships
    • Preserved original UI/UX design
  • Authentication

    • Simplified AuthProvider to guest mode (Keycloak integration ready but not enforced)
    • Removed sign-in requirement for demo purposes
  • Infrastructure

    • Added QueryClientProvider to app layout
    • Fixed import paths from domain_core to lib/utils
    • Updated all UI components for new architecture

Database

  • PostgreSQL 16 with volume persistence
  • Flyway migrations in server/src/main/resources/db/migration/
  • JPA entities for Competency, CompetencyRelationship, LearningResource, User

Removed

  • Deleted domain_core/ TypeScript backend
  • Deleted prisma/ directory and schema
  • Deleted app/actions/ server actions
  • Removed old database migration files

Other

  • Updated CLAUDE.md with new architecture documentation
  • New server/README.md with Spring Boot setup instructions
  • Docker configuration for multi-container orchestration
  • Environment files for local development

Testing

Test Cases

  • Existing functionality still works
  • New functionality works as expected
  • Edge cases handled appropriately

Manual Testing

  • Tested in development environment

    • Spring Boot server starts successfully on port 8080
    • PostgreSQL running on port 5433 with persistent volumes
    • Keycloak running on port 8081 with admin access
    • Next.js frontend on port 3000 communicating with backend
  • Tested core functionality

    • Session page loads random competencies from Spring Boot API
    • Creating competency relationships via API
    • Undo functionality with API delete
    • Skip functionality maintaining local state
    • Keyboard shortcuts (Space, Enter, Cmd+Shift+Z) working
  • Tested build processes

    • ./server-manage.sh build successfully builds Spring Boot JAR
    • npm run build successfully builds Next.js production bundle
    • No TypeScript compilation errors
    • No ESLint errors

Known Issues Fixed

  • ✅ Gradle version compatibility with Java 25 (downgraded to Java 17)
  • ✅ PostgreSQL 18 volume mount structure
  • ✅ Keycloak healthcheck configuration
  • ✅ Spring Boot dependency conflicts (springdoc-openapi)
  • ✅ QueryClient provider missing from layout
  • ✅ Import path resolution for UI components

Screenshots/Videos

Before

  • Node.js/TypeScript backend with Prisma ORM
  • Server actions for data fetching
  • PostgreSQL via Prisma migrations

After

Deployment Notes

Starting the application:

# Backend (from root)
cd server && ./server-manage.sh up

# Frontend (from root)
npm run dev
Environment requirements:

Java 17+
Node.js 18+
Docker & Docker Compose
8080, 8081, 5433, 3000 ports available
First-time setup:

Database migrations run automatically on startup
Keycloak realm auto-imported with demo users
Default credentials in server/README.md


This PR description accurately reflects all the migration work completed, including the technical changes, testing performed, and deployment instructions.

@vtotalova vtotalova self-assigned this Jan 13, 2026
Copilot AI review requested due to automatic review settings January 13, 2026 23:05
@vtotalova vtotalova linked an issue Jan 13, 2026 that may be closed by this pull request
@vtotalova vtotalova added security fix Security fix generated by Mend refactor ♻️ Code refactoring server ⚙️ Server-side/API changes dependencies 📦 Dependency updates security 🔒 Security related labels Jan 13, 2026
@vtotalova vtotalova added this to the v0.1.0 milestone Jan 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR represents a complete architectural migration from a Node.js/TypeScript backend using Prisma ORM to a Spring Boot microservices architecture with Java 17, PostgreSQL, and Keycloak authentication. The frontend has been updated to use TanStack Query with Axios for API communication, replacing the previous server actions approach.

Changes:

  • Replaced Node.js/Prisma backend with Spring Boot 3.4.1 application featuring REST APIs, JPA/Hibernate, and Flyway migrations
  • Migrated frontend data layer from server actions to TanStack Query with Axios-based API clients
  • Introduced Docker Compose orchestration for PostgreSQL, Keycloak, and the Spring Boot application
  • Removed all Prisma-related code, domain_core directory, and server actions

Reviewed changes

Copilot reviewed 115 out of 118 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
server/build.gradle Gradle build configuration with Spring Boot 3.4.1, Java 17, and required dependencies
server/src/main/resources/db/migration/V1__init_schema.sql Flyway migration creating database schema with enums and tables
server/src/main/java/.../entity/* JPA entities for User, Competency, LearningResource, and relationships
server/src/main/java/.../service/* Business logic layer with transactional service methods
server/src/main/java/.../controller/* REST API controllers with OpenAPI documentation
server/src/main/java/.../security/SecurityConfig.java Spring Security configuration with OAuth2/JWT via Keycloak
server/docker-compose.yml Multi-container setup for app, PostgreSQL 18.1, and Keycloak 26.4
lib/api/* TypeScript API clients using Axios with proper typing
lib/auth/* Keycloak integration and simplified AuthProvider
lib/providers.tsx QueryClient configuration for TanStack Query
package.json Updated dependencies removing Prisma, adding TanStack Query, Axios, and Keycloak

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/src/main/resources/db/migration/V1__init_schema.sql Outdated
Comment thread server/src/main/resources/db/migration/V1__init_schema.sql Outdated
Comment thread server/src/main/java/de/tum/cit/memo/util/IdGenerator.java
Comment thread server/src/main/java/de/tum/cit/memo/security/SecurityConfig.java Outdated
Comment thread lib/api/learning-resources.ts Outdated
Comment thread lib/auth/AuthProvider.tsx Outdated
Comment thread server/README.md Outdated
Comment thread app/session/page.tsx Outdated
@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request client-application 🎨 Client-side/UI changes database 🗃️ Database related changes docker 🐳 Docker/deployment changes configuration ⚙️ Configuration file changes and removed refactor ♻️ Code refactoring security 🔒 Security related labels Jan 13, 2026
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

⚠️ Found console statements - consider removing for production
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

⚠️ Found console statements - consider removing for production
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@vtotalova vtotalova changed the title migrate server to spring boot feat: migrate server to spring boot Jan 13, 2026
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

⚠️ Found console statements - consider removing for production
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

⚠️ Found console statements - consider removing for production
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

Comment thread src/lib/api/session-helpers.ts Outdated
Comment thread src/lib/api/types.ts Outdated
Comment thread src/lib/api/types.ts Outdated
Comment thread README.md
Comment thread README.md Outdated
Comment thread server/src/main/java/de/tum/cit/memo/service/CompetencyRelationshipService.java Outdated
@MaximilianAnzinger

Copy link
Copy Markdown
Collaborator

Please remember to get rid of Next.js entirely.

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@markstockhausen
markstockhausen self-requested a review January 19, 2026 09:40

@markstockhausen markstockhausen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally, this works. I've tested everything locally and the migration seems successful.

That said, I'm honestly feeling a bit overwhelmed by the sheer size of this PR. It's really hard for me to guarantee I've caught every issue because besides the backend migration it also swaps our frontend from Next.js to Vite. I did spot some UI regressions (colors/fonts), but those can be adjusted in a follow-up PR.

Open to discuss: Did we really mean to remove Next.js from the frontend as well?

Comment thread dist/assets/index-BZrfDNs6.js Outdated
Comment thread dist/assets/index-BZrfDNs6.js.map Outdated
Comment thread dist/assets/index-CPH0O57W.css Outdated
Comment thread dist/file.svg Outdated
Comment thread dist/globe.svg Outdated
Comment thread dist/index.html Outdated
Comment thread dist/index.html Outdated
Comment thread dist/next.svg Outdated
Comment thread src/components/theme-provider.tsx Outdated
Comment thread .vscode/settings.json Outdated
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

1 similar comment
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

📊 Code Statistics

🚨 Potential Issues

✅ No console statements found
⚠️ Found 'any' or 'unknown' types - consider using more specific types

@markstockhausen markstockhausen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with reference to this: #31 (review)

@MaximilianAnzinger
MaximilianAnzinger merged commit c861104 into main Jan 27, 2026
12 checks passed
@MaximilianAnzinger
MaximilianAnzinger deleted the feature/migrate-server-side-to-spring-boot branch January 27, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-application 🎨 Client-side/UI changes configuration ⚙️ Configuration file changes database 🗃️ Database related changes dependencies 📦 Dependency updates docker 🐳 Docker/deployment changes documentation Improvements or additions to documentation enhancement New feature or request security fix Security fix generated by Mend server ⚙️ Server-side/API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: migrate server-side to spring boot

4 participants