From 95607c42dbe88f2392919824b151154de7b12c12 Mon Sep 17 00:00:00 2001 From: dnl232 Date: Mon, 23 Mar 2026 01:13:47 +0100 Subject: [PATCH 1/3] Update docs --- README.md | 2 +- docs/DEVELOPMENT.md | 2 +- docs/SETUP.md | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 91887ccad..f24502ce7 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Complete documentation is available in the [docs/](./docs/) folder: ## Technology Stack - **Backend**: Java 21, Spring Boot 3.3.2 -- **Frontend**: React 18, TypeScript +- **Frontend**: React 19, TypeScript, Vite - **Build**: Maven - **Testing**: JUnit 5, Jest, PIT mutation testing - **Quality**: SonarCloud, JaCoCo diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 1df2002bf..327248ca3 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -440,7 +440,7 @@ mvn clean install # Frontend coverage cd frontend -npm test -- --coverage +npm test # View: coverage/lcov-report/index.html ``` diff --git a/docs/SETUP.md b/docs/SETUP.md index 181a62270..06d671312 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -130,7 +130,7 @@ cd frontend npm start ``` -This starts a development server on http://localhost:3000 with live reloading. +This starts a development server on http://localhost:5173 with live reloading. **Note**: The development server needs the backend running separately on port 8080. @@ -168,9 +168,8 @@ Main configuration files: Edit `frontend/src/constant.ts`: ```typescript -export const API_BASE_URL = process.env.REACT_APP_API_URL || 'http://localhost:8080'; -export const CLASSICAL_API = `${API_BASE_URL}/api/classical`; -export const MODAL_API = `${API_BASE_URL}/api/modal`; +export const BASE_URL: string = import.meta.env.VITE_API_URL || 'http://localhost:8080/'; +export const LOGIC: string = 'classical'; ``` ## Running Tests @@ -187,7 +186,7 @@ mvn clean test mvn test -pl domain/logic-language/framework ``` -**Run with coverage**: +**Run with coverage (coverage is collected by default)**: ```powershell mvn clean install ``` @@ -202,16 +201,16 @@ cd frontend npm test ``` -**Run with coverage**: +**Run with coverage (coverage is collected by default)**: ```powershell -npm test -- --coverage +npm test ``` Coverage report: `frontend/coverage/lcov-report/index.html` **Run specific test file**: ```powershell -npm test -- Expressions.test.tsx +npm test -- --testPathPattern=Expressions ``` ## Docker Deployment @@ -345,7 +344,7 @@ cd frontend npm start ``` -Access at: http://localhost:3000 (frontend will proxy API calls to backend) +Access at: http://localhost:5173 (frontend will proxy API calls to backend) ## Integration with IDEs From 90cae48b9c4bc0c345f44dad232314beca57223e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 02:45:29 +0100 Subject: [PATCH 2/3] docs: collapse redundant frontend test commands in SETUP.md (#87) * Initial plan * Collapse redundant frontend test commands into single instruction Co-authored-by: dan323 <32780500+dan323@users.noreply.github.com> Agent-Logs-Url: https://github.com/dan323/natural-deduction/sessions/c75973e4-b1cd-4677-92a2-fb1ef3782a06 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dan323 <32780500+dan323@users.noreply.github.com> --- docs/SETUP.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/SETUP.md b/docs/SETUP.md index 06d671312..9e63f5883 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -195,17 +195,12 @@ Coverage reports are generated in: `target/site/jacoco/index.html` ### Frontend Tests -**Run all tests**: +**Run all tests** (coverage is collected by default): ```powershell cd frontend npm test ``` -**Run with coverage (coverage is collected by default)**: -```powershell -npm test -``` - Coverage report: `frontend/coverage/lcov-report/index.html` **Run specific test file**: From 09bb4003661d8d7d6d73f5eb0a4e8f7a462b5b62 Mon Sep 17 00:00:00 2001 From: dnl232 Date: Mon, 23 Mar 2026 03:02:37 +0100 Subject: [PATCH 3/3] Fix dev proxy config and docs: add Vite proxy for /logic, remove unused BASE_URL --- docs/SETUP.md | 17 ++++++++++++++--- frontend/src/constant.ts | 4 +--- frontend/vite.config.ts | 5 +++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/SETUP.md b/docs/SETUP.md index 9e63f5883..fcb76366b 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -165,10 +165,21 @@ Main configuration files: **API Endpoint Configuration**: -Edit `frontend/src/constant.ts`: +The frontend uses relative API paths (e.g. `/logic/...`). When served by the Spring Boot JAR both frontend and API share the same origin, so no extra configuration is needed. + +During local frontend development (Vite dev server on port 5173), `vite.config.ts` proxies `/logic` requests to the backend on port 8080: + +```typescript +server: { + proxy: { + '/logic': 'http://localhost:8080', + }, +}, +``` + +The only frontend constant that controls behaviour is the logic type in `frontend/src/constant.ts`: ```typescript -export const BASE_URL: string = import.meta.env.VITE_API_URL || 'http://localhost:8080/'; export const LOGIC: string = 'classical'; ``` @@ -339,7 +350,7 @@ cd frontend npm start ``` -Access at: http://localhost:5173 (frontend will proxy API calls to backend) +Access at: http://localhost:5173 — Vite proxies `/logic` requests to the backend on port 8080 (configured in `frontend/vite.config.ts`). ## Integration with IDEs diff --git a/frontend/src/constant.ts b/frontend/src/constant.ts index 3b082537d..0fdf63aae 100644 --- a/frontend/src/constant.ts +++ b/frontend/src/constant.ts @@ -1,3 +1 @@ - -export const BASE_URL: string = "http://localhost:8080/" -export const LOGIC: string = "classical" \ No newline at end of file +export const LOGIC: string = "classical" diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 150d61810..941390a77 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -5,4 +5,9 @@ import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], publicDir: 'public', + server: { + proxy: { + '/logic': 'http://localhost:8080', + }, + }, });