This guide describes the usual development workflow for the OsmoWeb BTS Demo.
Install dependencies from the repository root:
npm installThe root package uses npm workspaces for:
backendfrontend
The backend start script runs compiled JavaScript:
node dist/main.jsBuild it before the first run or after changing backend TypeScript:
npm run build --prefix backendFor continuous backend TypeScript compilation:
npm run watch --prefix backendRecommended split-port setup:
npm run build --prefix backend
PORT=4001 npm run start --prefix backendIn another terminal:
VITE_DEV_PORT=4000 VITE_API_URL=http://localhost:4001 npm run dev --prefix frontendOpen:
http://localhost:4000
The root scripts are:
npm run start
npm run dev
npm run build
npm run testnpm run dev starts backend and frontend through concurrently.
Because both the backend and Vite dev server default to port 4000, prefer explicit ports when using both in development.
Build both packages:
npm run buildThis runs:
- frontend build
- backend build
After a successful build:
- frontend assets are in
frontend/dist - backend output is in
backend/dist - backend static serving points at
frontend/dist
Start the compiled backend:
npm run start --prefix backendCommon frontend files:
| File | Purpose |
|---|---|
frontend/src/main.ts |
Vue application entry point. |
frontend/src/App.vue |
Root Vue component. |
frontend/src/components/OsmoMain.vue |
Main BTS runtime screen. |
frontend/src/components/BtsControlPanel.vue |
Start/stop panel and runtime metrics. |
frontend/src/components/StatisticsModal.vue |
Nested statistics viewer. |
frontend/src/osmoBtsTrx.ts |
Local wrapper around the shared TRX manager. |
frontend/src/osmoBtsStats.ts |
Statistics normalization helpers. |
frontend/src/styles/ |
Local SCSS styles. |
Frontend commands:
npm run dev --prefix frontend
npm run build --prefix frontend
npm run serve --prefix frontendCommon backend files:
| File | Purpose |
|---|---|
backend/src/main.ts |
NestJS bootstrap and runtime setup. |
backend/src/app.module.ts |
Root NestJS module composition. |
backend/src/app.controller.ts |
Local guarded example controller. |
backend/src/app.service.ts |
Local example service. |
backend/src/common/ |
Optional debugging middleware and filters. |
Backend commands:
npm run build --prefix backend
npm run start --prefix backend
npm run watch --prefix backendThe backend includes optional debugging helpers:
RequestLoggerMiddlewareAllExceptionsFilter
They are currently imported as commented-out helpers in backend/src/main.ts. Enable them temporarily when diagnosing request routing or backend exceptions.
Use a browser that supports the runtime APIs required by the shared SDR stack.
Important browser-side capabilities:
- WebUSB
- cross-origin isolation
SharedArrayBuffer- WebSocket support
In development, Vite sets the COOP/COEP headers required for cross-origin isolation. Verify with:
window.crossOriginIsolatedBuild the backend:
npm run build --prefix backendRun them on separate ports:
PORT=4001 npm run start --prefix backend
VITE_DEV_PORT=4000 VITE_API_URL=http://localhost:4001 npm run dev --prefix frontendCheck that the backend is running and that VITE_API_URL points to the backend origin.
Example:
VITE_API_URL=http://localhost:4001Check:
- the browser supports WebUSB
- the page is opened from a secure context
- the device is connected
- the browser permission prompt was accepted
- another application is not already using the device
Check the browser console:
window.crossOriginIsolatedIf it returns false, verify that the dev server is serving the COOP/COEP headers and that loaded resources are compatible with cross-origin isolation.
Statistics are polled only while the BTS state is connected. Start the BTS runtime first, then open the statistics modal.
The current test scripts are placeholders. The root npm run test command calls backend and frontend test scripts, but automated tests are not fully wired yet for this demo.