{"id":15680282,"url":"https://github.com/ebebbington/copytube","last_synced_at":"2026-01-07T08:51:21.738Z","repository":{"id":43686902,"uuid":"207920588","full_name":"ebebbington/copytube","owner":"ebebbington","description":"PHP focussed app. Learning project: HTML, SASS, JS, PHP, Laravel, Docker, SQL, Blade Redis Pub/Sub \u0026 DB Cache, Deno WS Sockets","archived":false,"fork":false,"pushed_at":"2023-10-17T19:37:53.000Z","size":144939,"stargazers_count":0,"open_issues_count":28,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-05T11:38:06.551Z","etag":null,"topics":["css","deno","docker","html","javascript","nginx","php","php-fpm","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebebbington.png","metadata":{"funding":{"github":["ebebbington"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-11T22:54:54.000Z","updated_at":"2023-07-24T09:03:12.000Z","dependencies_parsed_at":"2024-10-03T16:51:32.653Z","dependency_job_id":null,"html_url":"https://github.com/ebebbington/copytube","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebebbington%2Fcopytube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebebbington%2Fcopytube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebebbington%2Fcopytube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebebbington%2Fcopytube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebebbington","download_url":"https://codeload.github.com/ebebbington/copytube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246300872,"owners_count":20755443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","deno","docker","html","javascript","nginx","php","php-fpm","sql"],"created_at":"2024-10-03T16:41:20.011Z","updated_at":"2026-01-07T08:51:21.713Z","avatar_url":"https://github.com/ebebbington.png","language":"PHP","funding_links":["https://github.com/sponsors/ebebbington"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eCopyTube\u003c/h1\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ebebbington/copytube/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/ebebbington/copytube/master?label=ci\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/dashboard?id=ebebbington_copytube\"\u003e\n    \u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=ebebbington_copytube\u0026metric=alert_status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/ebebbington/copytube\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/ebebbington/copytube/branch/master/graph/badge.svg?token=7USBVKOUKQ\"/\u003e\n  \u003c/a\u003e \n\u003c/p\u003e\n\n---\n\n*(Note this is a learning project)*\n\nCopyTube is an impersonation of YouTube, utilising videos, comments, a login system and sessions. This project provides an application that uses the tools below so it can act as a training ground to further develop knowledge in those tools.\n\n* Docker\n\n* Linux\n\n* Nginx\n\n* MySQL\n\n* PHP\n    * Laravel\n    * Blade\n\n* Deno\n    \n* Redis\n    * DB Caching\n    * Pub/Sub\n    \n* Testing\n    * Unit\n    * Feature\n    * Browser (Laravel Dusk)\n    \n# Ports\n\nNginx: 9002\n\nPHP-FPM: 9000\n\nRealtime: 9008\n\nRedis: 6379\n\nSQL: 3007\n    \n# Features\n\n* Database Caching inside PHP using Redis\n\n* Laravel Authorisation\n\n* Realtime updates using Laravel jobs, Redis and a Deno WebSocket\n\n* Testing all around\n    \n# CI\n\nCI is setup for the following:\n\n    * Testing\n        * Run all tests for each app (realtime, copytube and socket)\n            * The respective workflows start the environment and run the tests for the container\n            \n    * Upgrader\n        * Checks and upgrades all dependencies each week\n\n# Containers\n\nCopyTube is currently split into many applications (with the use of Nginx handling PHP-FPM and passing requests to the PHP container):\n\n## Copytube (Main App)\n\nThis is the main application that holds the majority of this project, such as the views, database querying, PHP files, javascripts etc.\nIt's the brain essentially.\n\nSee the `README.md` for the main app [here](https://github.com/ebebbington/copytube/blob/master/src/copytube/README.md)\n\n## SQL\n\nThis is our database for the application, automatically seeded in the docker process\n\n## Realtime\n\nThis is our realtime socket implementation. Similar to the Socket component, but also different in that this\nis responsible for giving realtime updates for users. For example, a new comment for a video is posted. This\nis sent through Redis, the Realtime app listens and retrieves the message, and sends it to the clients of the realtime\nconnection.\n\nI should note that although this is a web socket server, it does not receive any events or messages. It only\nsends down what redis brings.\n\nSee the `README.md` for the Realtime app [here](https://github.com/ebebbington/copytube/blob/master/src/realtime/README.md)\n\n## Redis\n\nRedis is included inside this application. It is used by Laravel for caching database queries, and to send messages using\na Pub/Sub architecture to the Realtime app, from the Laravel app to give realtime updates\n\n## Nginx\n\nOur proxy server for handling PHP requests to be passed to the PHP-FPM process, and passes all requests to the PHP container\n\n# Prerequisites\n\nHave Docker installed. This can be for Windows or for Mac - as long as you have Docker accessible in the command line. Docker knowledge is also essential to know commands such as `docker-compose down` and `docker system prune`.\n\n## Ports\n\nMake sure all the above ports are open\n\n# Run the Project\n\nClone the repository\n\n```\ncd /your/chosen/dir\ngit clone https://github.com/ebebbington/copytube.git\ncd copytube\n```\n\nBuild and start Docker\n\n```\n$ docker-compose build \u0026\u0026 docker-compose up -d\n$ cd src/copytube\n$ npm ci \u0026\u0026 composer install \u0026\u0026 npm run dev\n```\n\nCheck the Docker containers are running\n\n```\ndocker-compose ps\n```\n\nThe output should look similar to the below\n\n```\n$ docker-compose ps\n     Name                    Command              State                Ports\n------------------------------------------------------------------------------------------\ncopytube_nginx    nginx -g daemon off;            Up      80/tcp, 0.0.0.0:9002-\u003e9002/tcp\ncopytube_phpfpm   docker-php-entrypoint php-fpm   Up      0.0.0.0:9000-\u003e9000/tcp\ncopytube_sql      docker-entrypoint.sh mysqld     Up      0.0.0.0:3007-\u003e3006/tcp, 3306/tcp\n```\n\nFinally, go to the website\n\n* Mac\n     `0.0.0.0:9002`\n     \n* Windows\n     `127.0.0.1:9002`\n\n# Built With\n\n* [PHP](http://www.php.net) - Server Side Language\n* [Nginx](https://nginx.com) - Proxy server\n* [Docker](https://docker.com) - Used for Building the Environment\n\n# Authors\n\n* **Edward Bebbington** - *Initial work* - [Place website name here](Place website url here)\n\n# Acknowledgments\n\n* Thanks to Adam for helping me learn all that I know that ended up turning the knowledge gained into this project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febebbington%2Fcopytube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febebbington%2Fcopytube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febebbington%2Fcopytube/lists"}