Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📻 Radio Stream Backend

A high-fidelity RTMP streaming server built with Node.js to act as the engine for a custom web radio station. It allows direct connections from OBS Studio and manages the real-time transmission lifecycle seamlessly.

🛠️ System Architecture

The project is designed following the MVC (Model-View-Controller) pattern, applying Dependency Injection (DI) and software engineering best practices:

  • Config: Centralization of environment variables (.env).
  • Models: Management of the internal transmission state (Online/Offline).
  • Controllers: Business logic handling network stream events.
  • Services: Core RTMP server management (node-media-server) and notification systems.

🚀 Installation & Setup

1. Environment Variables

Create a .env file in the root directory with the following structure:

RTMP_PORT=1935
STREAM_SECRET_KEY="SECRET KEY"
HTTP_PORT=8000
NODE_ENV=development

2. Install Dependencies

Install the required modules by running in your terminal:

npm install

🏃‍♂️ Execution Commands

Production / Normal Mode:

npm start

Development Mode (With auto-refresh via Nodemon):

npm run dev

🎥 Content Creator Guide: How to Stream via OBS Studio

If you are a content creator streaming on this radio station, follow these quick steps to configure your OBS Studio:

Step 1: Open Stream Settings

Open OBS Studio.

Click on Settings (Ajustes) in the bottom-right corner.

Select the Stream (Emisión) tab from the left menu.

Step 2: Configure Server Details

Set Service (Servicio) to Custom... (Personalizado).

Enter the following Server (Servidor) URL:

rtmp://localhost/live

(Note: If you are streaming from a different computer within the house, replace localhost with the host PC's Local IP address, e.g., rtmp://192.168.1.XX/live).

Step 3: Enter the Stream Key

In the Stream Key (Clave de retransmisión) field, paste your designated secret password:

dracogilga

Click Apply (Aplicar) and then OK (Aceptar).

Step 4: Go Live!

Set up your microphone or background music in OBS.

Click Start Streaming (Iniciar transmisión).

The status square in the bottom-right corner of OBS will turn green, indicating you are successfully live on the web radio!

👨‍💻 Author: Cesar Gonzalez Lopez (DracoGilga) - dracogilga.com

About

A high-fidelity Node.js RTMP streaming server built under MVC architecture for a custom web radio station. Features OBS Studio integration and lifecycle management.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages