StoryTeller/.cursor/rules/story-teller-project.mdc
Konrad Neitzel 7302cc52a7 Add initial project structure with Maven, Quarkus, and React setup
- Created .gitignore to exclude build artifacts and IDE files.
- Added pom.xml for Maven project configuration, including dependencies for Quarkus, OpenAPI, and testing.
- Introduced project documentation outlining development workflow, architecture, and coding standards.
- Implemented core business logic with services for authentication, scenario management, story lifecycle, and user management.
- Established security context for JWT-based authentication.
- Generated API specifications and client code for frontend integration.
- Set up initial database entities and repositories for user, scenario, and story management.
2026-02-25 04:17:40 +01:00

70 lines
2.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
description: StoryTeller project context, architecture, and coding standards (Java/Quarkus, Maven, frontend)
alwaysApply: true
---
# StoryTeller Project Instructions
## Project context
- **Project**: StoryTeller
- **Java**: 21
- **Build**: Maven
- **Framework**: Quarkus (latest stable)
- **GroupId**: de.neitzel | **ArtifactId**: storyteller
- **Base package**: `de.neitzel.storyteller`
- **Sub-packages**: `business`, `common`, `data`, `fascade`
- Startup code lives in the base package.
- **DB migrations**: Liquibase; scripts in `src/main/resources/db/migration`.
## Architecture and package rules
- **Startup/bootstrap**: `de.neitzel.storyteller`
- **Business logic**: `de.neitzel.storyteller.business`
- **Shared utilities, cross-cutting types**: `de.neitzel.storyteller.common`
- **Persistence / data access**: `de.neitzel.storyteller.data`
- **External-facing facades (REST, API)**: `de.neitzel.storyteller.fascade`
- Keep clear package boundaries; avoid circular dependencies.
## Coding standards (Java)
- Use Lombok to reduce boilerplate where it helps.
- Prefer immutability: `final` fields, constructor injection.
- Use Quarkus idioms; avoid heavyweight frameworks.
- Keep methods small and focused; one responsibility per class.
- Use Java 21 features when they improve clarity.
- Add concise comments only for non-obvious logic.
- All classes, fields, and methods (including private) must have JavaDoc describing purpose and usage.
## Testing
- Add or update unit tests for new or changed logic.
- Use JUnit 5 and Mockito; ArrangeActAssert; keep tests deterministic.
- Mock external dependencies; add integration tests only when requested.
## Maven and dependencies
- Target Java 21 in the Maven toolchain.
- Use the latest stable Quarkus platform BOM.
- Keep dependencies minimal; no new libraries without need.
- Keep versions up to date (especially for security).
- Put plugin and dependency versions in the `properties` section of `pom.xml`.
- Use `quarkus-maven-plugin` for build/run; `maven-surefire-plugin` for tests (JUnit 5); `maven-compiler-plugin` with Java 21.
## Frontend (React / Vite)
- Frontend lives under `src/main/web` (React, TypeScript, Vite, MUI).
- OpenAPI TypeScript client is generated into `src/main/web/src/api/generated/` by Maven (`mvn generate-sources`); do not edit by hand.
- Production build output: `target/web-dist`; copied to `META-INF/resources` by `maven-resources-plugin` for the Quarkus SPA.
## Do and dont
- **Do**: keep code in the correct package; add tests for business logic.
- **Dont**: put startup code outside the base package; add unnecessary abstraction layers.
## Output expectations
- Provide complete, compilable code with package declarations and imports.
- Prefer Quarkus-friendly APIs and annotations.
- When adding or changing logic, update or add unit tests.