Skip to content
/ rain Public

An extremely minimalist video delivery platform made with Rust and React

License

Notifications You must be signed in to change notification settings

gatomod/rain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6f1972a Â· Feb 3, 2025

History

13 Commits
Dec 2, 2022
Oct 16, 2023
Dec 15, 2022
Dec 8, 2022
Oct 16, 2023
Oct 16, 2023
Feb 3, 2025
Oct 11, 2023

Repository files navigation

Rain

An extremely minimalist video delivery platform made with React and Rust.

Note

This was my first project in Rust, I made it a few years ago to use that language in a real project, but the code is too messy and inneficient so please, don't bother me with that.

I have the intention to rewrite it with the same stack and using it for my Final Degree Project, organizing it better, documenting it and using another libraries.

Technologies

Frontend

Backend

Getting started

To start using Rain you need to install certain programs and build it.

Configuration

Before build Rain, you need to configure server.toml

  • In server.toml set the port and the file limit (in bytes)
ip = [0, 0, 0, 0]
port = 3000
file_limit = 10_000_000_000 # In bytes

Docker

To use docker, run the following commands.

# Clone the repo
git clone https://github.com/gatomod/rain && cd rain

# Build Dockerfile
docker build -t gatomo/rain:latest .

# Run the container
# - Choose a port. 80 is the default one
# - Volumes are used to preserve data. Choose a path
docker run --name rain -p 80:80 -v /route/to/store/cdn:/server/cdn gatomo/rain

Manual build

Prerequisites

  • FFmpeg
  • FFmpeg Thumbnailer
  • Rust and Cargo
  • Node.js and Yarn

If you have all installed, update all to latest versions (not required but recommended).

Building

Run the following command to build server and client

# build client
cd client && yarn build

# build server
cd server && cargo build --release

Run

Run the server

cd server && cargo run --release

API Endpoints

  • / - GET Web
  • /assets/:asset - GET Web assets
  • /api - API endpoints
    • /cdn - Video delivery (HLS)
      • / - POST upload multipart
      • /:uuid/video.m3u8 - GET M3U8 file
      • /:uuid/video#.ts - GET Video segments
    • /data - Video data (JSON)
      • / - GET All UUID videos
      • /:uuid - GET Video data
    • /thumbnail - Get thumbnails (PNG)
      • /lg/:uuid - GET Large
      • /sm/:uuid - GET Small

License

Rain is licensed under the GPL-3 license.

Usage

There are some security and performance issues, so is recommended to personal use at home or testing.

Contribute

🥳 Any PR is welcome! Rain is a small project, so please follow the code style and avoid making insane proposals.

Gátomo - AGPL-3 License

About

An extremely minimalist video delivery platform made with Rust and React

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published