Giter Club home page Giter Club logo

yii2-youtube-clone's Introduction

FreeCodeTube - Yii2 Youtube Clone


The project was created while recording video for FreeCodeCamp

Features

  • Login and Registration
  • Email confirmation
  • Upload videos
  • Provide thumbnail, title, description, tags
  • Status of the video: Published or Unlisted
  • Dashboard with analitics:
    • Latest video
    • Number of total views
    • Number of total subscribers
    • Latest subscribers
  • View videos
  • Leave a like/dislike
  • Find similar videos
  • Channel page
  • View videos only for specific channel
  • Subscribe on channel or unsubscribe
  • Sending email when user subscribes to channel
  • Global search to search videos by title, description or tags
  • History page

Demo

If you want to see working demo of the application click here

Installation

Requirements

The minimum requirement by this project template is that your Web server supports PHP 5.6.0.

Installing using Composer

Clone the repository from github.
git clone [email protected]:thecodeholic/Yii2-Youtube-Clone.git [YourDirectoryName]

The command installs the project in a directory named YourDirectoryName. You can choose a different directory name if you want.

Install dependencies

For this we need composer to be installed on our operating system. If you do not have Composer, follow the instructions in the Installing Yii section of the definitive guide to install it.

With Composer installed, navigate to the project folder from command line and run

composer install

Preparing application

Follow the steps from yii2 advanced template to prepare installation.

After doing all the steps from yii2 advanced template open common/config/params-local.php and add your frontend domain on key frontendUrl. Example:

return [
    'frontendUrl' => 'http://frontend.test/'
];

yii2-youtube-clone's People

Contributors

thecodeholic avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-youtube-clone's Issues

Video not appearing

Hello, Zura !!
I appreciate your hard work and believe me when i say it saved me irl.
But i am having this issue of video not working.
what i meant from video not working is, my page is showing all the video controls and responsive but the video is not playing and because of this my thumbnails are not working.
i think they may work when the video thing work.
I'm attesting my problem.
I hope my problem will get a solution finally.

Thanks you!!
Screenshot (16)

Cannot use positional argument after named argument at 04:04:13

Hi,

At first I like to say I love your Video an learn a lot of things.
But now I have a Problem.

With your Video I like to create a Youtubeclon for myself. Till now I can solve every Problem by myself. But now at 04:04:13 I have a Problem i can´t solve by myself.

If I write this code:

   return $this->render(view: 'view', 
   ['model' => $video
]);

like you explaind, it will create that error: Cannot use positional argument after named argument

I think it will be a Problem with PHP8 and some new features, but I didn´t know what I can do to solve it.

Maybe you can help me, please.

Greets gismo2005

php-gd in require

I think you meant "ext-gd" in the composer.json. My composer errors on install with "php-gd" in require.

Love your work Zura... have learnt so much.
Thank you.

backend site

I meet this issue
Forbidden
You don't have permission to access this resource.
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.1.25 Server at studio.freecodetube.test Port 80
I don't know how can I do

Some questions

Hello Zura!

Thanks a lot for your 7 hour tutorial. It really helps!

However I have some issues with it. If you don't mind I will post my questions here in one place as I go through your video.

And the first one is about Gii. Before it everything was smooth and clear.
Time stamp is about here - https://youtu.be/whuIf33v2Ug?t=6658

In your code in rules method you have this line:

[['created_by'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['created_by' => 'id']],

I don't have it, rules end with:

[['video_id'], 'unique'],

attributeLabels() looks fine, just like yours and then my code ends with find() method. I don't have getCreatedBy() method generated.

My first though was about DB, maybe I had some mismatches there, so I've completed migration several times, and followed your gii generation about 3 times, but without any luck, my code is generated differently from yours. I've even copy-pasted your migration code and tried one more time.

My Yii version is 2.0.38, but you've used 2.0.34. Could it be the reason?

getting this error at 2:42:12 in tutorial while clicking the open video link

An Error occurred while handling another error:
ReflectionException: Class yii\bootstrap\BootstrapAsset does not exist in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php:508
Stack trace:
#0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(508): ReflectionClass->__construct('yii\bootstrap\B...')
#1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(386): yii\di\Container->getDependencies('yii\bootstrap\B...')
#2 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(171): yii\di\Container->build('yii\bootstrap\B...', Array, Array)
#3 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\BaseYii.php(365): yii\di\Container->get('yii\bootstrap\B...', Array, Array)
#4 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(264): yii\BaseYii::createObject(Array)
#5 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(237): yii\web\AssetManager->loadBundle('yii\bootstrap\B...', Array, true)
#6 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(287): yii\web\AssetManager->getBundle('yii\bootstrap\B...')
#7 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(292): yii\web\View->registerAssetBundle('yii\bootstrap\B...', NULL)
#8 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetBundle.php(125): yii\web\View->registerAssetBundle('frontend\assets...')
#9 G:\WAMP64\www\Youtube-Clone\frontend\views\layouts\main.php(13): yii\web\AssetBundle::register(Object(yii\web\View))
#10 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(348): require('G:\WAMP64\www\Y...')
#11 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('G:\WAMP64\www\Y...', Array)
#12 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(425): yii\base\View->renderFile('G:\WAMP64\www\Y...', Array, Object(frontend\controllers\SiteController))
#13 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(411): yii\base\Controller->renderContent('<div class="sit...')
#14 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(139): yii\base\Controller->render('error', Array)
#15 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(118): yii\web\ErrorAction->renderHtmlResponse()
#16 [internal function]: yii\web\ErrorAction->run()
#17 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Action.php(94): call_user_func_array(Array, Array)
#18 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\Action->runWithParams(Array)
#19 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('error', Array)
#20 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorHandler.php(109): yii\base\Module->runAction('site/error')
#21 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\ErrorHandler.php(135): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#22 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#23 {main}

Next yii\di\NotInstantiableException: Failed to instantiate component or class "yii\bootstrap\BootstrapAsset". in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php:510
Stack trace:
#0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(386): yii\di\Container->getDependencies('yii\bootstrap\B...')
#1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(171): yii\di\Container->build('yii\bootstrap\B...', Array, Array)
#2 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\BaseYii.php(365): yii\di\Container->get('yii\bootstrap\B...', Array, Array)
#3 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(264): yii\BaseYii::createObject(Array)
#4 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(237): yii\web\AssetManager->loadBundle('yii\bootstrap\B...', Array, true)
#5 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(287): yii\web\AssetManager->getBundle('yii\bootstrap\B...')
#6 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(292): yii\web\View->registerAssetBundle('yii\bootstrap\B...', NULL)
#7 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetBundle.php(125): yii\web\View->registerAssetBundle('frontend\assets...')
#8 G:\WAMP64\www\Youtube-Clone\frontend\views\layouts\main.php(13): yii\web\AssetBundle::register(Object(yii\web\View))
#9 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(348): require('G:\WAMP64\www\Y...')
#10 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('G:\WAMP64\www\Y...', Array)
#11 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(425): yii\base\View->renderFile('G:\WAMP64\www\Y...', Array, Object(frontend\controllers\SiteController))
#12 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(411): yii\base\Controller->renderContent('<div class="sit...')
#13 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(139): yii\base\Controller->render('error', Array)
#14 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(118): yii\web\ErrorAction->renderHtmlResponse()
#15 [internal function]: yii\web\ErrorAction->run()
#16 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Action.php(94): call_user_func_array(Array, Array)
#17 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\Action->runWithParams(Array)
#18 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('error', Array)
#19 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorHandler.php(109): yii\base\Module->runAction('site/error')
#20 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\ErrorHandler.php(135): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#21 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#22 {main}
Previous exception:
yii\base\InvalidRouteException: Unable to resolve the request "/storage/videos/d0qSe90p.mp4". in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php:537
Stack trace:
#0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('/storage/videos...', Array)
#1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 G:\WAMP64\www\Youtube-Clone\frontend\web\index.php(17): yii\base\Application->run()
#3 {main}

Next yii\web\NotFoundHttpException: Page not found. in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\Application.php:116
Stack trace:
#0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 G:\WAMP64\www\Youtube-Clone\frontend\web\index.php(17): yii\base\Application->run()
#2 {main}

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.