Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ mvn clean install

# Frontend coverage
cd frontend
npm test -- --coverage
npm test
# View: coverage/lcov-report/index.html
```

Expand Down
33 changes: 19 additions & 14 deletions docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -165,12 +165,22 @@ 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 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 LOGIC: string = 'classical';
```

## Running Tests
Expand All @@ -187,7 +197,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
```
Expand All @@ -196,22 +206,17 @@ 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**:
```powershell
npm test -- --coverage
```

Coverage report: `frontend/coverage/lcov-report/index.html`

**Run specific test file**:
```powershell
npm test -- Expressions.test.tsx
npm test -- --testPathPattern=Expressions
```

## Docker Deployment
Expand Down Expand Up @@ -345,7 +350,7 @@ cd frontend
npm start
```

Access at: http://localhost:3000 (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

Expand Down
4 changes: 1 addition & 3 deletions frontend/src/constant.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

export const BASE_URL: string = "http://localhost:8080/"
export const LOGIC: string = "classical"
export const LOGIC: string = "classical"
5 changes: 5 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
publicDir: 'public',
server: {
proxy: {
'/logic': 'http://localhost:8080',
},
},
});
Loading