{"id":15583172,"url":"https://github.com/tanhongit/yl-mvc-structure","last_synced_at":"2025-04-24T02:53:29.176Z","repository":{"id":40669047,"uuid":"455435027","full_name":"tanhongit/yl-mvc-structure","owner":"tanhongit","description":"YL MVC Structure (PHP MVC) is a pattern made in PHP used to implement user interfaces, data, and controlling logic. It is built based on the combination of ideas from the Yii framework and Laravel framework (yl).","archived":false,"fork":false,"pushed_at":"2023-12-30T16:37:41.000Z","size":349,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T02:53:24.023Z","etag":null,"topics":["mvc","mvc-application","mvc-architecture","mvc-core","mvc-pattern","mvc-sample","php","php-mvc","php-mvc-pattern","php-structures","structure","tanhongit","tanhongit-mvc"],"latest_commit_sha":null,"homepage":"https://yl-mvc-structure.tanhongit.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanhongit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["tanhongit"],"custom":["https://paypal.me/tanhongcom"]}},"created_at":"2022-02-04T05:40:20.000Z","updated_at":"2024-06-10T18:02:31.000Z","dependencies_parsed_at":"2024-10-23T04:06:53.606Z","dependency_job_id":null,"html_url":"https://github.com/tanhongit/yl-mvc-structure","commit_stats":{"total_commits":59,"total_committers":5,"mean_commits":11.8,"dds":0.576271186440678,"last_synced_commit":"6a0583f951a1031fa8d19e584d2d20a6b9dcf3be"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fyl-mvc-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fyl-mvc-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fyl-mvc-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fyl-mvc-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanhongit","download_url":"https://codeload.github.com/tanhongit/yl-mvc-structure/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552037,"owners_count":21449162,"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":["mvc","mvc-application","mvc-architecture","mvc-core","mvc-pattern","mvc-sample","php","php-mvc","php-mvc-pattern","php-structures","structure","tanhongit","tanhongit-mvc"],"created_at":"2024-10-02T20:05:17.163Z","updated_at":"2025-04-24T02:53:29.152Z","avatar_url":"https://github.com/tanhongit.png","language":"PHP","funding_links":["https://github.com/sponsors/tanhongit","https://paypal.me/tanhongcom"],"categories":[],"sub_categories":[],"readme":"# Welcome to YL MVC Structure by TanHongIT\n\n**YL MVC Structure (PHP MVC)** is a pattern made in PHP used to implement user interfaces, data, and controlling logic. \n\nIt's built based on the combination of ideas from the **Yii framework** and **Laravel framework** (YL).\n\n# Configuration requirements\n\n    - PHP \u003e= 8.0\n    - OpenSSL PHP Extension\n\n# Technology\n- Pure PHP language\n- Using MVC model\n- Using MariaDB/MySQL database\n- Webpack for compile Javascript modules and compile Sass/SCSS files to css\n\n# Setup assets folder\n\nThis Project is using webpack in order to compile Javascript modules and compile Sass/SCSS files to css. Run the following commands in the project's asset directory:\n\nRun:\n\n```shell\ncd public/frontend/assets\nnpm install\nnpm run build\n```\n\n# 4. Edit Connect Database\n\nYou need to change the connection information to the database if you want to store and use data for the website.\n\nPath: [`/config/database.php.example`](https://github.com/tanhongit/yl-mvc-structure/tree/main/config)\n\nCopy the file `database.php.example` to `database.php`.\n\n```bash\ncd config\ncp database.php.example database.php\n```\n\nEdit the file `database.php` and change the following lines with your database information:\n\n```php\nconst DB_HOST = '127.0.0.1'; # this is ip of mysql in your local\nconst DB_PORT = 3306; # this is port of mysql in your local\n\nconst DB_USER = 'root';\nconst DB_PASSWORD = 'rootpassword';\n\nconst DB_NAME = 'mvc-structure';\n```\n\n# 5. Install and using ssl certificate (optional)\n\nUsing **mkcert** to create ssl certificate for this project.\n\n### Install mkcert\n\n#### On Ubuntu\n\n```shell\nsudo apt install libnss3-tools\n\nsudo wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64 \u0026\u0026 \\\nsudo mv mkcert-v1.4.3-linux-amd64 mkcert \u0026\u0026 \\\nsudo chmod +x mkcert \u0026\u0026 \\\nsudo cp mkcert /usr/local/bin/\n```\n\nNow that the mkcert utility is installed, run the command below to generate and install your local CA:\n\n```shell\nmkcert -install\n```\n\n#### On other OS\n\nPlease refer to the instructions at the following link: [https://github.com/FiloSottile/mkcert](https://github.com/FiloSottile/mkcert)\n\n### Create ssl certificate for this project\n\nRun:\n\n```shell\ncd /var/www/certs\nmkcert local.yl_mvc_structure.com\n```\n\n### Update configuration\n\nSetup conf file if you are using Apache2:\n\nChange **local.yl_mvc_structure.com.conf** file (/apache2/sites-available/ to this)\n\n```\n\u003cVirtualHost *:80\u003e\n\tServerAdmin localserver@localhost\n\tServerName local.yl_mvc_structure.com\n\tServerAlias www.yl_mvc_structure.vdx.com\n\tDocumentRoot /var/www/yl_mvc_structure\n\tErrorLog /var/www/logs/error-yl_mvc_structure.log\n    CustomLog /var/www/logs/access-yl_mvc_structure.log combined\n\u003c/VirtualHost\u003e\n\n\u003cVirtualHost *:443\u003e\n    ServerAdmin localserver@localhost\n    ServerName local.yl_mvc_structure.com\n    ServerAlias www.local.yl_mvc_structure.com\n    DocumentRoot /var/www/yl_mvc_structure\n\n    ErrorLog /var/www/logs/error-yl_mvc_structure.log\n    CustomLog /var/www/logs/access-yl_mvc_structure.log combined\n\n    SSLEngine on\n\tSSLCertificateFile /var/www/certs/local.yl_mvc_structure.com.pem\n\tSSLCertificateKeyFile /var/www/certs/local.yl_mvc_structure.com-key.pem\n\n    \u003cDirectory /var/www/yl_mvc_structure\u003e\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n```\n\n\u003e **_Note_**: Please make sure your local or your host has been configured to use the domain name `local.yl_mvc_structure.com` (or another domain name you want to use) to point to the project folder.\n\n# 6. Run project\n\nWhen done, you can test the website by opening the browser and typing the following URL:\n\n```shell\nhttp://localhost\n\nhttp://localhost/product\nhttp://localhost/product/all\nhttp://localhost/product/show/1\nhttp://localhost/category\n...\n```\n\n\u003e **_Note_**: If using Apache, make sure the `mod_rewrite` module is enabled.\n\nYou can also use the following command to check if the module is enabled (for Apache on Ubuntu):\n\n```shell\nsudo a2enmod rewrite\n```\n\n**If you can't enable the `mod_rewrite` module, you can use the following URL to run the project:**\n\n```shell\nhttp://localhost/index.php?controller=product\u0026action=index\nhttp://localhost/index.php?controller=product\u0026action=all\nhttp://localhost/index.php?controller=product\u0026action=show\u0026id=1\nhttp://localhost/index.php?controller=category\u0026action=index\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhongit%2Fyl-mvc-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanhongit%2Fyl-mvc-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhongit%2Fyl-mvc-structure/lists"}