LocalNet now uses a separated frontend and backend::
- React + Vite frontend in the project root.
- Java Spring Boot backend in backend.
Prerequisite: Node.js
- Install dependencies:
npm install - Start the frontend:
npm run dev
The Vite dev server proxies /api requests to http://localhost:8080 by default.
Prerequisite: Java 17+ and Maven
- Open a terminal in backend
- Start the Spring Boot API:
mvn spring-boot:run
The backend exposes the same API surface the UI expects:
GET /api/statusGET /api/peersPOST /api/peers/broadcastGET /api/messages/{peerId}?viewerPeerId=...POST /api/messages/sendDELETE /api/messages/{id}?requesterPeerId=...GET /api/messages/unread-counts?viewerPeerId=...POST /api/files/requestPOST /api/files/uploadGET /api/files/download/{id}
Realtime updates are delivered over:
WS /ws
- Uploaded files are stored under
backend/storage/uploads. - Message state is currently in-memory, so restarting the Spring Boot app clears peers and messages.
- The frontend prefers WebSocket updates and automatically falls back to polling if
/wsis unavailable. - The old Node mock server is still available with
npm run dev:mockif you need the previous preview flow.