Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ These are all environment variables that can be used to configure the applicatio
| INACTIVE_USER_DAYS | server | 365 | Number of days of inactivity after which student accounts are automatically disabled. |
| LIQUIBASE_CONTEXTS | server | prod | Comma-separated list of Liquibase contexts to execute on startup. **Must be `prod` (or unset) in production** — the value `dev` activates the `23_seed_dev_test_data.xml` changelog, which seeds fake users, topics, applications, and theses, and `application-dev.yml` already sets this to `dev` for the dev profile. Never set this to `dev` (or include `dev`) on a production deployment. |
| CHAIR_NAME | client | Thesis Management | Chair name |
| CHAIR_URL | client | window.origin | URL to chair website |
| CHAIR_URL | client | window.origin | URL to chair website |
| AI_FEATURES_ENABLED | server | false | Master switch for the AI feedback module (`/v2/ai-review/**`, `ReviewService`, `PdfService`). **Work in progress — not yet fully integrated or guaranteed to work.** Leave at `false` in production. When `true`, also set `OPENAI_API_KEY` / `OPENAI_BASE_URL` / `OPENAI_CHAT_MODEL` to point at a reachable LLM endpoint. Enabled by default in `application-dev.yml` for local development. |
| OPENAI_API_KEY | server | | API key used by Spring AI's OpenAI client. Only consulted when `AI_FEATURES_ENABLED=true`; the prod default placeholder exists only so the OpenAI auto-configuration can construct its bean. |
| OPENAI_BASE_URL | server | https://gpu.aet.cit.tum.de/api | Base URL of the OpenAI-compatible endpoint used by the AI feedback module. |
| OPENAI_CHAT_MODEL | server | google/gemma-4-26B-A4B-it | Chat model name passed to the OpenAI-compatible endpoint. |
18 changes: 18 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,24 @@ Open the Mailpit web UI to browse captured emails:

All emails (including attachments) sent by the application are available there for inspection. This replaces the previous console-only logging approach and makes it easy to verify email content, formatting, and recipients during development and testing.

## AI Feedback (Experimental)

> **Status: work in progress.** The AI feedback module (`/v2/ai-review/**`, `ReviewService`, `PdfService`) is being developed and is **not necessarily working or integrated end-to-end yet**. Treat it as an opt-in preview, not a supported feature.

The module is gated by a single feature flag implemented as a Spring `Condition` (`de.tum.cit.aet.thesis.feedback.config.AIFeaturesEnabled`). When the flag is off, the controller and services are not registered with the application context and the `/v2/ai-review/**` endpoints return 404.

| Setting | Default | Notes |
|----------------------------------|---------|--------------------------------------------------------------------------------------|
| `thesis-management.ai.enabled` | `false` | Master switch. Env var: `AI_FEATURES_ENABLED`. Set to `true` in `application-dev.yml`. |
| `spring.ai.openai.api-key` | — | Env var: `OPENAI_API_KEY`. Required when the flag is on so Spring AI can build the chat model. |
| `spring.ai.openai.base-url` | `https://gpu.aet.cit.tum.de/api` | Env var: `OPENAI_BASE_URL`. Point at any OpenAI-compatible endpoint. |
| `spring.ai.openai.chat.model` | `google/gemma-4-26B-A4B-it` | Env var: `OPENAI_CHAT_MODEL`. |

Notes for local dev:
- The `dev` profile already sets `thesis-management.ai.enabled: true`, so `./gradlew bootRun --args='--spring.profiles.active=dev'` exposes the endpoints. You still need to point `spring.ai.openai.*` at a reachable LLM (e.g. a local model on `http://localhost:1234/v1`) for actual responses.
- The `test` profile keeps the flag off by default; the only test that exercises the controller (`ReviewControllerTest`) re-enables it via `@TestPropertySource`.
- Spring AI's `OpenAiChatAutoConfiguration` instantiates `openAiChatModel` eagerly whenever the Spring AI jars are on the classpath, regardless of this flag. That is why `application.yml` ships a non-empty `OPENAI_API_KEY` placeholder and the test config sets a stub key — neither is used unless the flag is on, but both are needed so the autoconfig can build the bean.

## Database Migrations (Liquibase)

Liquibase migrations run automatically when the server starts. All migrations are defined under `server/src/main/resources/db/changelog/changes`.
Expand Down
4 changes: 4 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework.boot:spring-boot-starter-actuator"

implementation platform("org.springframework.ai:spring-ai-bom:2.0.0")
implementation "org.springframework.ai:spring-ai-pdf-document-reader"
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
Comment thread
bensofficial marked this conversation as resolved.

developmentOnly "org.springframework.boot:spring-boot-devtools"

implementation "org.hibernate.orm:hibernate-core"
Expand Down
2 changes: 1 addition & 1 deletion server/sbom/.input-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29644e2af5d9f81c4e3cbf69c45f7c05d7dbeedf66ac4a7a0a4b91b38d2916c8
5311d3f6f85f234fc055712e0909a38e0e114bc0a47dce67a43c2d8e180e7110
Loading
Loading