You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default `dev` profile uses an in-memory H2 database and seeds 10 sample bulletins through `DataInitializer`, so the API works immediately after startup.
6
+
7
+
API documentation is available via Swagger UI at `http://localhost:8080/swagger-ui/index.html`.
8
+
9
+
## Requirements
10
+
11
+
- JDK 21+.
12
+
- Gradle 9.2.1.
13
+
- PostgreSQL only if you run the `prod` profile with an external database.
14
+
- Make.
15
+
16
+
## Running
17
+
18
+
### Local profile
19
+
1. Start the application:
20
+
```bash
21
+
22
+
make run
23
+
```
24
+
3. Explore the API:
25
+
- All bulletins: `GET http://localhost:8080/api/bulletins`
2. Install dependencies and start the Vite dev server:
56
+
```bash
57
+
cd frontend
58
+
make install
59
+
make start
60
+
```
61
+
3. The dev server proxies `/api` requests to `http://localhost:8080`, so keep the backend running via `make run` (or `./gradlew bootRun`) in another terminal.
62
+
63
+
### Build and serve from the Java app
64
+
65
+
1. Build the production bundle:
66
+
```bash
67
+
cd frontend
68
+
make install # run once
69
+
make build # outputs to frontend/dist
70
+
```
71
+
2. Copy the compiled assets into Spring Boot’s static resources (served from `src/main/resources/static`):
72
+
```bash
73
+
rm -rf src/main/resources/static
74
+
mkdir -p src/main/resources/static
75
+
cp -R frontend/dist/* src/main/resources/static/
76
+
```
77
+
3. Restart the backend (`make run`) and open `http://localhost:8080/` — the React app will now be served directly by the Java application.
0 commit comments