Skip to content
Snippets Groups Projects
Commit deb570b4 authored by samsarj's avatar samsarj
Browse files

better install experience

parent 7d5e8cac
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,60 @@ ...@@ -2,6 +2,60 @@
An on-air timer screen that displays the active Rundown Creator's rundown on-air item and countdown. An on-air timer screen that displays the active Rundown Creator's rundown on-air item and countdown.
## Getting Started
### Prerequisites
- Node.js
### Installation
Clone the repo and install NPM dependencies:
```sh
git clone https://gitlab.surrey.ac.uk/dmm/UoS-Studio-Clock.git
cd UoS-Studio-Clock
npm install:all
```
#### API Information
In order for the backend to connect to Rundown Creator, the backend requires a `.env` file in the backend directory with the API information from your login URL's settings page:
```text
API_URL=
API_KEY=
API_TOKEN=
```
#### Backend and Frontend on Different Server
If the backend and frontend are run from different machines, change the WebSocket target in `frontend/vite.config.js` to be the backend's IP address:
```javascript
proxy: {
'/ws': {
target: 'ws://<backend-server-ip>:8080',
ws: true,
},
},
```
## Usage
- Start backend:
```sh
npm start --prefix backend
```
- Start frontend (in separate shell):
```sh
npm run dev --prefix frontend
```
## How It Works ## How It Works
### Backend ### Backend
...@@ -15,8 +69,7 @@ Node.js with Express, RxJS, and WebSocket. ...@@ -15,8 +69,7 @@ Node.js with Express, RxJS, and WebSocket.
Files: Files:
- `index.js`: Sets up an Express server and starts the polling service. - `index.js`: Polls the Rundown Creator API for active rundowns and broadcasts updates via WebSocket.
- `poller.js`: Polls the Rundown Creator API for active rundowns and broadcasts updates via WebSocket.
- `rundownService.js`: Contains functions to fetch rundowns and rows from the Rundown Creator API. - `rundownService.js`: Contains functions to fetch rundowns and rows from the Rundown Creator API.
### Frontend ### Frontend
...@@ -30,18 +83,6 @@ Uses React with Vite. ...@@ -30,18 +83,6 @@ Uses React with Vite.
Files: Files:
- `main.jsx`: Entry point that renders the React app. - `main.jsx`: Entry point that renders the React app.
- `App.jsx`: Sets up React Router with routes for different pages. - `App.jsx`: Sets up React Router with routes for different pages (coming soon).
- `TimerPage.jsx`: Displays the active rundown item and countdown timer. - `TimerPage.jsx`: Displays the active rundown item and countdown timer.
- `index.css`: Contains the CSS styles for the application. - `index.css`: Contains the CSS styles for the application.
## Requirements
### Rundown Creator API
In order for the backend to connect to Rundown Creator, the backend requires a `.env` file in the backend directory with the API information from your login URL's settings page:
```text
API_URL=
API_KEY=
API_TOKEN=
```
{
"scripts": {
"install:all": "cd frontend && npm install && cd ../backend && npm install"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment