Skip to content

Commit 826806d

Browse files
committed
Remove root-level Gradle configuration files and update project structure to reflect standalone backend and frontend modules. Adjust Makefile commands for building, running, and testing to streamline development processes. Update documentation to clarify usage and improve organization.
1 parent 17843a0 commit 826806d

26 files changed

Lines changed: 204 additions & 841 deletions

.cursor/rules/vaultstadio-backend.mdc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ Uses JWT secret as key placeholder. Not production-ready.
156156
Run from **repo root** (backend is part of root Gradle project).
157157

158158
```bash
159-
./gradlew :backend:api:run # Run backend
160-
./gradlew :backend:api:build -x test # Build without tests
161-
./gradlew :backend:core:test :backend:api:test # Run tests
162-
./gradlew :backend:api:flywayMigrate # Run migrations
163-
./gradlew :backend:api:flywayClean # Clean database (dev)
159+
cd backend && ./gradlew :api:run # Run backend (or: make backend-run)
160+
cd backend && ./gradlew :api:build -x test # Build without tests
161+
cd backend && ./gradlew :core:test :api:test # Run tests
162+
cd backend && ./gradlew :api:flywayMigrate # Run migrations
163+
cd backend && ./gradlew :api:flywayClean # Clean database (dev)
164164
# Or: make backend-run, make backend-build, make backend-test, make db-migrate
165165
```
166166

.cursor/rules/vaultstadio-commands.mdc

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ globs: ["*"]
88

99
Use these commands for build, run, test, quality, and Docker. See also [Makefile](Makefile), [frontend/Makefile](frontend/Makefile), [docs/getting-started/QUICK_START.md](docs/getting-started/QUICK_START.md), [docs/development/CODE_QUALITY.md](docs/development/CODE_QUALITY.md).
1010

11-
**Project layout**: Backend is part of the root Gradle project (`:backend:*`). Frontend is a **standalone** project in `frontend/` (run Gradle from `frontend/` or use `make frontend-*` from root).
11+
**Project layout**: No Gradle at repo root. **Backend** and **frontend** are **standalone** Gradle projects in `backend/` and `frontend/` (each has its own `gradlew`, `settings.gradle.kts`, `build.gradle.kts`). Use `make` from root or run Gradle from the project directory.
1212

1313
## Build
1414

1515
```bash
16-
# Full build (backend from root + frontend from frontend/)
16+
# Full build (backend + frontend, from root)
1717
make build
1818

19-
# Backend only (from repo root)
20-
./gradlew :backend:api:build -x test
19+
# Backend only (from root or from backend/)
2120
make backend-build
21+
# Or: cd backend && ./gradlew :api:build -x test
2222

23-
# Frontend – web WASM (from repo root or from frontend/)
23+
# Frontend – web WASM (from root or from frontend/)
2424
make frontend-web
2525
# Or from frontend/: ./gradlew :composeApp:wasmJsBrowserDistribution
2626

@@ -32,9 +32,9 @@ make frontend-web-dev
3232
cd frontend && ./gradlew :composeApp:compileKotlinDesktop
3333
# Or: make desktop-run (from root runs frontend desktop)
3434

35-
# Plugins (from repo root)
36-
./gradlew :backend:plugins:image-metadata:pluginJar :backend:plugins:video-metadata:pluginJar
35+
# Plugins (from root or backend/)
3736
make plugins-build
37+
# Or: cd backend && ./gradlew :plugins:image-metadata:pluginJar :plugins:video-metadata:pluginJar
3838

3939
# Android APK (from root or frontend/)
4040
make android-build
@@ -44,9 +44,9 @@ make android-build
4444
## Run (development and production)
4545

4646
```bash
47-
# Backend (from repo root; requires PostgreSQL)
48-
./gradlew :backend:api:run
47+
# Backend (from root or backend/; requires PostgreSQL)
4948
make backend-run
49+
# Or: cd backend && ./gradlew :api:run
5050

5151
# Frontend – desktop (from root or frontend/)
5252
make desktop-run
@@ -70,9 +70,9 @@ make dev
7070
# All tests (backend + frontend)
7171
make test
7272

73-
# Backend only (from repo root)
74-
./gradlew :backend:core:test :backend:api:test
73+
# Backend only (from root or backend/)
7574
make backend-test
75+
# Or: cd backend && ./gradlew :core:test :api:test
7676

7777
# Frontend only (from root or frontend/)
7878
make frontend-test
@@ -85,19 +85,19 @@ make test-coverage
8585
## Code Quality (run before commit)
8686

8787
```bash
88-
# 1. Format
89-
./gradlew ktlintFormat
88+
# 1. Format (run in each project)
89+
cd backend && ./gradlew ktlintFormat
9090
cd frontend && ./gradlew ktlintFormat
9191

9292
# 2. Check no FQN in type positions
9393
./scripts/check-no-fqn.sh
9494

9595
# 3. Static analysis (runs ktlintCheck then detekt)
96-
./gradlew detekt
96+
make lint # backend detekt
9797
cd frontend && ./gradlew detektMain
9898
```
9999

100-
Quick: `./gradlew ktlintFormat && ./scripts/check-no-fqn.sh && ./gradlew detekt`
100+
Quick: `make lint` then `./scripts/check-no-fqn.sh`; format in backend/ and frontend/ with ktlintFormat.
101101

102102
## Docker
103103

@@ -125,10 +125,8 @@ make docker-down
125125
## Database
126126

127127
```bash
128-
./gradlew :backend:api:flywayMigrate # migrate
129-
make db-migrate
130-
./gradlew :backend:api:flywayClean # clean (dev)
131-
make db-clean
128+
make db-migrate # or: cd backend && ./gradlew :api:flywayMigrate
129+
make db-clean # or: cd backend && ./gradlew :api:flywayClean
132130
```
133131

134132
## Release / Clean

.cursor/rules/vaultstadio-core.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ VaultStadio is a **self-hosted storage platform** with plugin architecture:
2424

2525
```
2626
vaultstadio/
27-
├── backend/ # Root Gradle project (:backend:*)
27+
├── backend/ # Standalone Gradle project (run from backend/)
2828
│ ├── core/ # Domain: models, services, repositories (interfaces), events
2929
│ ├── plugins-api/ # Plugin SDK: Plugin interface, PluginContext, hooks
3030
│ ├── api/ # Ktor: routes, DTOs, config, middleware

.cursor/rules/vaultstadio-plugins.mdc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ai-classification/→ AIClassificationPlugin.kt
4444
## Commands
4545

4646
```bash
47-
./gradlew :kotlin-backend:plugins:image-metadata:pluginJar
48-
./gradlew :kotlin-backend:plugins:video-metadata:pluginJar
47+
cd backend && ./gradlew :plugins:image-metadata:pluginJar :plugins:video-metadata:pluginJar
48+
# Or: make plugins-build (from root)
4949
make plugins-build
5050
```

.cursor/rules/vaultstadio-quality.mdc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ See [docs/development/CODE_QUALITY.md](docs/development/CODE_QUALITY.md) for ful
1111
## Formatting – ktlint
1212

1313
- **Config**: [.editorconfig](.editorconfig). Max line length 120, indent 4, no trailing whitespace, final newline.
14-
- **Fix**: `./gradlew ktlintFormat`
15-
- **Check**: `./gradlew ktlintCheck` (CI runs this before detekt).
14+
- **Fix**: `cd backend && ./gradlew ktlintFormat` (and same in frontend/).
15+
- **Check**: `cd backend && ./gradlew ktlintCheck` (CI runs this before detekt).
1616
- **No wildcard imports** – explicit imports only (enforced by project rules and detekt).
1717

1818
## No FQN in type positions
@@ -23,8 +23,8 @@ See [docs/development/CODE_QUALITY.md](docs/development/CODE_QUALITY.md) for ful
2323

2424
## Static analysis – detekt
2525

26-
- **Config**: [config/detekt/detekt.yml](config/detekt/detekt.yml).
27-
- **Run**: `./gradlew detekt` (after ktlintCheck). Use `detektMain` for main source only; `detektBaseline` to generate baseline.
26+
- **Config**: Backend: [backend/config/detekt/detekt.yml](backend/config/detekt/detekt.yml). Frontend: [frontend/config/detekt/](frontend/config/detekt/).
27+
- **Run**: `make lint` (backend); `cd frontend && ./gradlew detektMain`. Use `detektBaseline` to generate baseline.
2828
- **Make**: `make lint`, `make lint-report`, `make lint-baseline`.
2929

3030
## File size guidelines
@@ -37,12 +37,12 @@ See [docs/development/CODE_QUALITY.md](docs/development/CODE_QUALITY.md) for ful
3737
## Testing
3838

3939
- **Stack**: JUnit 5, MockK, Testcontainers for integration tests.
40-
- **Run**: `./gradlew test`, `make backend-test`, `make test-coverage`.
40+
- **Run**: `make test`, `make backend-test`, `make test-coverage`.
4141
- Add unit tests for non-trivial logic; document in structural changes.
4242

4343
## Pre-commit / CI order
4444

45-
1. `./gradlew ktlintFormat`
45+
1. `cd backend && ./gradlew ktlintFormat` (and frontend if needed)
4646
2. `./scripts/check-no-fqn.sh`
47-
3. `./gradlew detekt`
48-
4. `./gradlew test`
47+
3. `make lint` (backend + frontend detekt)
48+
4. `make test`

.cursor/rules/vaultstadio.mdc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Project rules are split into several `.mdc` files for better context and classif
2626
### Code Quality (run before every commit)
2727

2828
```bash
29-
./gradlew ktlintFormat && ./scripts/check-no-fqn.sh && ./gradlew detekt
29+
make lint # backend detekt; then cd frontend && ./gradlew detektMain
30+
./scripts/check-no-fqn.sh
31+
# Format: cd backend && ./gradlew ktlintFormat; cd frontend && ./gradlew ktlintFormat
3032
```
3133

3234
### Key Constraints

.github/workflows/ci.yml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- name: Setup Gradle
3535
uses: gradle/gradle-build-action@v3
3636
with:
37+
project-root: backend
3738
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
3839

3940
- name: Ensure Docker is available (for Testcontainers)
@@ -59,35 +60,38 @@ jobs:
5960
fi
6061
6162
- name: Build backend modules
63+
working-directory: backend
6264
run: |
63-
./gradlew :backend:core:build \
64-
:backend:plugins-api:build \
65-
:backend:infrastructure:build \
66-
:backend:api:build \
65+
./gradlew :core:build \
66+
:plugins-api:build \
67+
:infrastructure:build \
68+
:api:build \
6769
-x test
6870
6971
- name: Run backend tests
72+
working-directory: backend
7073
run: |
71-
./gradlew :backend:core:test \
72-
:backend:api:test \
73-
:backend:infrastructure:test \
74-
:backend:plugins-api:test \
75-
:backend:plugins:image-metadata:test \
76-
:backend:plugins:video-metadata:test \
77-
:backend:plugins:fulltext-search:test \
78-
:backend:plugins:ai-classification:test \
74+
./gradlew :core:test \
75+
:api:test \
76+
:infrastructure:test \
77+
:plugins-api:test \
78+
:plugins:image-metadata:test \
79+
:plugins:video-metadata:test \
80+
:plugins:fulltext-search:test \
81+
:plugins:ai-classification:test \
7982
--continue
8083
8184
- name: Generate backend coverage reports
85+
working-directory: backend
8286
run: |
83-
./gradlew :backend:core:jacocoTestReport \
84-
:backend:api:jacocoTestReport \
85-
:backend:infrastructure:jacocoTestReport \
86-
:backend:plugins-api:jacocoTestReport \
87-
:backend:plugins:image-metadata:jacocoTestReport \
88-
:backend:plugins:video-metadata:jacocoTestReport \
89-
:backend:plugins:fulltext-search:jacocoTestReport \
90-
:backend:plugins:ai-classification:jacocoTestReport \
87+
./gradlew :core:jacocoTestReport \
88+
:api:jacocoTestReport \
89+
:infrastructure:jacocoTestReport \
90+
:plugins-api:jacocoTestReport \
91+
:plugins:image-metadata:jacocoTestReport \
92+
:plugins:video-metadata:jacocoTestReport \
93+
:plugins:fulltext-search:jacocoTestReport \
94+
:plugins:ai-classification:jacocoTestReport \
9195
--continue
9296
9397
- name: Upload test results
@@ -217,13 +221,16 @@ jobs:
217221

218222
- name: Setup Gradle
219223
uses: gradle/gradle-build-action@v3
224+
with:
225+
project-root: backend
220226

221227
- name: Build plugins
228+
working-directory: backend
222229
run: |
223-
./gradlew :backend:plugins:image-metadata:build \
224-
:backend:plugins:video-metadata:build \
225-
:backend:plugins:fulltext-search:build \
226-
:backend:plugins:ai-classification:build \
230+
./gradlew :plugins:image-metadata:build \
231+
:plugins:video-metadata:build \
232+
:plugins:fulltext-search:build \
233+
:plugins:ai-classification:build \
227234
-x test
228235
229236
# Build Android app
@@ -256,7 +263,7 @@ jobs:
256263
- name: Build Android APK (debug)
257264
run: cd frontend && ./gradlew :androidApp:assembleDevDebug
258265

259-
# Code quality checks
266+
# Code quality checks (no root Gradle; backend and frontend are standalone)
260267
lint:
261268
name: Lint & Code Quality
262269
runs-on: [self-hosted, macOS, X64]
@@ -280,14 +287,16 @@ jobs:
280287
"platforms;android-34" \
281288
"build-tools;34.0.0"
282289
283-
- name: Setup Gradle
284-
uses: gradle/gradle-build-action@v3
285-
286290
- name: Check no FQN in type positions
287291
run: ./scripts/check-no-fqn.sh
288292

289-
- name: Run Detekt
290-
run: ./gradlew detekt --continue
293+
- name: Run Detekt (backend)
294+
working-directory: backend
295+
run: ./gradlew detektMain --continue
296+
297+
- name: Run Detekt (frontend)
298+
working-directory: frontend
299+
run: ./gradlew detektMain --continue
291300

292301
- name: Upload Detekt report
293302
uses: actions/upload-artifact@v4

.github/workflows/docker.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ jobs:
3636

3737
- name: Setup Gradle
3838
uses: gradle/gradle-build-action@v3
39+
with:
40+
project-root: backend
3941

4042
- name: Build backend JAR
41-
run: ./gradlew :backend:api:build -x test
43+
working-directory: backend
44+
run: ./gradlew :api:build -x test
4245

4346
- name: Set up Docker Buildx
4447
uses: docker/setup-buildx-action@v3
@@ -158,10 +161,12 @@ jobs:
158161

159162
- name: Setup Gradle
160163
uses: gradle/gradle-build-action@v3
164+
with:
165+
project-root: backend
161166

162167
- name: Build release artifacts
163-
run: |
164-
./gradlew :backend:api:distZip -x test
168+
working-directory: backend
169+
run: ./gradlew :api:distZip -x test
165170

166171
- name: Create Release
167172
uses: softprops/action-gh-release@v1

.github/workflows/security.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,11 @@ jobs:
2929
java-version: '21'
3030
distribution: 'temurin'
3131

32-
- name: Setup Gradle
33-
uses: gradle/actions/setup-gradle@v3
32+
- name: Run dependency check (backend)
33+
run: cd backend && ./gradlew dependencies --no-daemon || true
3434

35-
- name: Run dependency check
36-
run: ./gradlew dependencyCheckAnalyze || true
37-
38-
- name: Upload dependency check report
39-
uses: actions/upload-artifact@v4
40-
if: always()
41-
with:
42-
name: dependency-check-report
43-
path: build/reports/dependency-check/
35+
- name: Run dependency check (frontend)
36+
run: cd frontend && ./gradlew dependencies --no-daemon || true
4437

4538
# ==================== Code Security Scan ====================
4639
code-scan:
@@ -64,7 +57,9 @@ jobs:
6457
distribution: 'temurin'
6558

6659
- name: Build for analysis
67-
run: ./gradlew assemble --no-daemon || true
60+
run: |
61+
cd backend && ./gradlew :api:build -x test --no-daemon || true
62+
cd frontend && ./gradlew :composeApp:compileKotlinDesktop --no-daemon || true
6863
6964
- name: Perform CodeQL Analysis
7065
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)