Giter VIP home page Giter VIP logo

video-streaming's Introduction

Video streaming - Next.js + ScyllaDB application

This repository contains a sample video streaming application built with Blitz.js, Material-UI and ScyllaDB.

Prerequisites

Get started

Clone the repository

git clone https://github.com/scylladb/video-streaming

Configuration file

Create a new configuration file named .env.local in the project's root folder. This file contains your ScyllaDB cluster credentials:

# .env.local
APP_BASE_URL="http://localhost:8000"
SCYLLA_HOSTS="node-0.aws_eu_central_1.xxxxx.clusters.scylla.cloud"
SCYLLA_USER="scylla"
SCYLLA_PASSWD="xxxxx"
SCYLLA_KEYSPACE="streaming"
SCYLLA_DATACENTER="AWS_EU_CENTRAL_1"

You can copy the SCYLLA_HOSTS, SCYLLA_USER, SCYLLA_PASSWD and SCYLLA_DATACENTER values from your ScyllaDB Cloud dashboard. Keyspace should be streaming.

Install project requirements

npm install

Create database schema and tables

Run the following command to migrate the database and load sample data.

npm run migrate

This creates the following structure in your database:

CREATE KEYSPACE IF NOT EXISTS streaming WITH replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': '3' };

CREATE TABLE streaming.video (
    id TEXT,
    content_type TEXT,
    title TEXT,
    url TEXT,
    thumbnail TEXT,
    created_at TIMESTAMP,
    PRIMARY KEY (id, created_at)
);

CREATE TABLE streaming.watch_history (
	user_id UUID,
	video_id TEXT,
	progress INT,
	watched_at TIMESTAMP,
	PRIMARY KEY (user_id, video_id)
);

Start the app:

npm run dev
> [email protected] dev
> blitz dev

✔ Next.js was successfully patched with a React Suspense fix
✔ Routes manifest was successfully generated
- ready started server on 0.0.0.0:3000, url: http://localhost:3000

Go to http://localhost:3000 to open the app.

app screenshot

video-streaming's People

Contributors

danielhe4rt avatar zseta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

video-streaming's Issues

App Structure: Minor improvements needed

Hey! I truly liked the concept of the project and sure it will be helpful on my studies.

When I was testing it I found out a few things to improve on the app structure, to give more readability and use some types:

  • Recover the Progress in the ListVideos page and not only at ContinueVideos;
    • Since everytime that I join a video that I started to watch, it goes back to zero and it's kinda annoying.
  • Add validations if there's no video on ContinueVideos list. Now it's crashing if there's no video.
  • Missing a core type for Video and WatchHistory;
  • Segregate Back-end from Front-end (I think that it will improve it a lot);
  • Resize cards to a minimum width since there's huge titles to cover;
  • Replace all statements to PreparedStataments;
  • Give some cool spacing for code readability;
  • Add a progress bar into ListVideos and ContinueVideos page.

Probably there's many more things that I missed but the app itself works perfectly!

I started to work on these same points btw, I'll open a draft for now and we can check it together!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.