Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 4668

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 27, 20242024-11-27T02:08:09+00:00 2024-11-27T02:08:09+00:00

Build a Web3 Movie Streaming dApp using NextJs, Tailwind, and Sia Renterd: Part One

  • 61k

Introduction

The web is evolving, and Web3 technologies are revolutionizing traditional industries, including video streaming. Platforms like Odysee are leading the charge, offering decentralized alternatives to YouTube and Rumble. Similarly, unlike legacy providers like Google Drive and Dropbox, Sia is transforming data storage, providing a privacy-focused and user-centric approach.

Join us on a journey to build a cutting-edge Web3 movie streaming dApp using NextJs, TypeScript, Tailwind CSS, and Sia Renterd. This tutorial series will guide you in creating a decentralized application that leverages Sia's blockchain technology to ensure user data ownership and privacy.

By the end of this tutorial, you'll gain the expertise to:

  • Build a fully functional movie streaming platform to share with friends or use as a school project
  • Launch your own SaaS (Software as a Service) application
  • Unlock the potential of Web3 technologies in the video streaming industry

Watch the demo video below to see the project in action and subscribe to our channel for more innovative content like this!

Prerequisites

To follow along, ensure you have the following tools installed, and familiarity with the stacks will also enhance your understanding:

  • NodeJs
  • NextJs
  • Tailwind CSS
  • TypeScript
  • Docker (required)

This three-part series will cover:

  • Part 1: Project Setup – Renterd Zen testnet, Package Installations, and environment variables.
  • Part 2: Backend Development – Building the Backend Service
  • Part 3: Frontend Development – Integrating the Frontend with the Backend service.

If you prefer watching the entire development process, I recommend watching this playlist, in the playlist, everything that is written here and more are captured in the videos.

With that said, let’s jump into setting up this project.

Project Setup

We'll start by cloning a prepared repository which includes the Sia Renterd docker compose script, the backend, and frontend services. Run the following commands:

$ git clone https://github.com/Daltonic/sia_vid_tv $ cd sia_vid_tv 
Enter fullscreen mode Exit fullscreen mode

Now, it's crucial that we switch to our starter branch on this newly cloned GitHub project, and run the below command to have that done.

$ git checkout 01_starter_branch 
Enter fullscreen mode Exit fullscreen mode

Next, let’s set up the associated environment variable for this Renterd service. Create a .env file at the root of this project and apply the keys below:

RENTERD_SEED=<RENTERD_SEED_PHRASE> RENTERD_API_PASSWORD=<YOUR_PREFERED_PASSWORD> RENTERD_LOG_LEVEL=debug RENTERD_LOG_DATABASE_LEVEL=error 
Enter fullscreen mode Exit fullscreen mode

To get these API keys you will need to have Sia Renterd installed on your machine, please watch this short video below, it pretty much summarizes it all.

Generate a seed phrase with the Renterd application as seen in the above video and include it inside your environment variable as instructed in the above video. Replace the password with something you can easily remember.

Next, we need to install Docker by downloading it from the official website if you haven't already. Alternatively, use a free online platform like Gitpod or a VPS to run a Docker instance, if possible. Otherwise, install it on your local computer.

Finally, we can spin up a docker container by running the following docker command at the root of this project, ensure that the terminal is at the same directory location as this docker-compose.yml file.

$ docker compose -f "docker-compose.yml" up -d --build 
Enter fullscreen mode Exit fullscreen mode

Note the command to pull down the container: $ docker compose -f "docker-compose.yml" down. Run this when you want to shut down your Docker instance (but not now).

If you performed the above instructions correctly, you should see the interface below when you visit your browser at http://localhost:9880.

Sia Renterd Login interface

Enter your password (from your environment variable) to log in. Then, follow the configuration procedure in the video below to set up your Sia Renterd instance for file uploads, downloads, and streaming.

The above video starts at the 6:41 minute mark, please stop at the 20:01 mark, this part will visually guide you through the Renterd configuration process.

Take note that the blockchain synchronization process along with host matching takes up to 25 min to be ready, so you will have to be patient with the whole process.

Please create a new bucket on Renterd called vidtv, where all our files for this project will be stored. if you have executed the above instructions successfully, your Renterd node should be ready for upload and download, see the image below.

Renterd on Zen testnet

Amazing, at this point, our Renterd service is now ready to start receiving files, but we need to communicate with it programmatically.

Let's round this part one of this tutorial by having the packages and environment variables set up as well for the Backend and Frontend.

Backend Project Setup
Perform the following instructions to have the backend service packages installed and ready for further development.

Navigate to the backend directory from a new terminal instance using the following commands:

$ cd backend $ yarn install #you can also use npm install $ touch .env #or mannually create it at the root of the backend directory 
Enter fullscreen mode Exit fullscreen mode

Next, supply the following information into the environment variables.

SIA_API_BUCKET=vidtv SIA_API_PASSWORD=<YOUR_PREFERED_PASSWORD> SIA_API_BASE_URL=http://localhost:9880 ORIGIN=http://localhost:9000 PORT=9000 
Enter fullscreen mode Exit fullscreen mode

And now, run $ yarn build && yarn start to spin up the backend and to also confirm that it's free from any bug.

Frontend Project Setup
Lastly, run the following commands to install the packages associated with the frontend, afterwards, we will run it.

Navigate to the backend directory from a new terminal instance using the following commands:

$ cd frontend $ yarn install #you can also use npm install $ touch .env #or mannually create it at the root of the backend directory 
Enter fullscreen mode Exit fullscreen mode

Next, supply the following information into the environment variables.

NEXT_PUBLIC_PROJECT_ID=<YOUR_WALLET_CONNECT_ID> NEXT_PUBLIC_FILE_SERVICE_URL=http://localhost:9000 
Enter fullscreen mode Exit fullscreen mode

Sign up and create a project with Walletconnect to get your project ID. After you have supplied the project ID to the environment variable, run $ yarn build && yarn start to spin up the backend and to also confirm that it's free from any bug.

At this point, you will see the interface below when you visit the browser at http://localhost:3000.

VidTv Homepage

Movie Poster

Next Step
Congratulations on reaching this milestone! Proceed to Part 2 to complete the backend service development. If you encounter any issues, refer to the following resources for troubleshooting:

  • 🏠 Sia Website
  • 🔥 Sia Renterd
  • 👨‍💻 Sia Renterd API
  • 🚀 Sia Discord Channel
  • 💡 YouTube Video Playlist

About Author

I am a web3 developer and the founder of Dapp Mentors, a company that helps businesses and individuals build and launch decentralized applications. I have over 8 years of experience in the software industry, and I am passionate about using blockchain technology to create new and innovative applications. I run a YouTube channel called Dapp Mentors where I share tutorials and tips on web3 development, and I regularly post articles online about the latest trends in the blockchain space.

programmingtutorialweb3webdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.