Backend Project for Stage Stream: An all-in-one zero-latency streaming solution built on MediaMTX.
Follow the Setup Guide for detailed instructions.
- NodeJS: Version 20 or newer
- TypeScript
-
Install Dependencies:
npm install
-
Build the Project:
Run the TypeScript compiler:npm tsc
To enable watch mode for automatic rebuilds:
npm tsc -w
-
Start the Server:
After building, navigate to the/builddirectory and start the server:node build
There are two ways to configure the environment:
- Edit the
defaults.jsonfile: Located in thesrc/directory. - Set Environment Variables: Use your system or
.envfile.
| Variable | Description |
|---|---|
| WEB_PORT | Port for the Express server to bind to. |
| JWT_SECRET | Secret for JSON Web Tokens. |
| Variable | Description |
|---|---|
| USE_MYSQL | Enable MySQL (true for MySQL, false for SQLite). |
| MYSQL_HOST | Host IP or domain for the MySQL database. |
| MYSQL_USER | Username for MySQL login. |
| MYSQL_PASSWORD | Password for the MySQL user. |
| MYSQL_DATABASE | Database name in MySQL. |
| SQLITE_PATH | Filepath for the SQLite database. |
| SQLITE_FILE | Filename for the SQLite database. |
| Variable | Description |
|---|---|
| ADMIN_USERNAME | Username for the admin account. |
| ADMIN_PASSWORD | Password for the admin account. |
| Variable | Description |
|---|---|
| LOG_PATH | Filepath for log files. |
| VIDEO_URL | URL where MediaMTX runs. |
| VIDEO_API | URL for MediaMTX's API. |
| Variable | Description |
|---|---|
| FRONT_END_URL | URL where the frontend is hosted. |
The compiled project will be placed in the /build folder. You can start the server directly from there.