{"id":31206325,"url":"https://github.com/adygcode/php-demo-2025-s2","last_synced_at":"2025-09-20T19:42:53.538Z","repository":{"id":308500432,"uuid":"1032964237","full_name":"AdyGCode/php-demo-2025-s2","owner":"AdyGCode","description":"Sample PHP Experiments from Semester 2, 2025","archived":false,"fork":false,"pushed_at":"2025-08-27T07:57:24.000Z","size":87,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-27T11:59:08.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AdyGCode.png","metadata":{"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,"zenodo":null}},"created_at":"2025-08-06T05:22:12.000Z","updated_at":"2025-08-27T07:57:28.000Z","dependencies_parsed_at":"2025-08-06T09:36:18.354Z","dependency_job_id":"7d96cb1d-c458-48cb-a88b-616f391dbc53","html_url":"https://github.com/AdyGCode/php-demo-2025-s2","commit_stats":null,"previous_names":["adygcode/php-demo-2025-s2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdyGCode/php-demo-2025-s2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdyGCode%2Fphp-demo-2025-s2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdyGCode%2Fphp-demo-2025-s2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdyGCode%2Fphp-demo-2025-s2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdyGCode%2Fphp-demo-2025-s2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdyGCode","download_url":"https://codeload.github.com/AdyGCode/php-demo-2025-s2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdyGCode%2Fphp-demo-2025-s2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276150790,"owners_count":25593841,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-20T19:42:49.196Z","updated_at":"2025-09-20T19:42:53.530Z","avatar_url":"https://github.com/AdyGCode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n## Add Vite, Tailwindcss \u0026 FontAwesome Free\n\n```shell\ncd PROJECT_FOLDER\n```\n\n## Update .gitignore\n\nWe need to ignore composer based files (vendor folder) ready for later.\n\nOpen your /.gitignore file and at the end add:\n\n```text\n### Composer template\ncomposer.phar\n/vendor/\n\n# Comment the line below if you are going to ignore the composer lock file\n!/composer.lock\n\n```\n\n\n## Required Node Modules\n\nAdd following node modules:\n\n- vite\n- tailwindcss\n- @tailwindcss/forms\n- @tailwindcss/vite\n- concurrently - this allows the CLI to execute multiple commands simultaneously)\n- vite-plugin-php - allows vite to scan the PHP files for tailwind css\n\n```shell\ntouch src/style.css\nnpm i --save-dev vite \nnpm i @fortawesome/fontawesome-free\nnpm i --save-dev tailwindcss \nnpm i --save-dev @tailwindcss/forms\nnpm i --save-dev @tailwindcss/vite \nnpm i --save-dev vite-plugin-php\nnpm i --save-dev concurrently\n```\n\nCreate and edit the src/style.css file and add:\n```css\n@import \"tailwindcss\";\n@import \"@fortawesome/fontawesome-free/css/all.css\";\n```\n\n## Edit the vite.config.js\n\nupdate to read:\n\n```js\n// vite.config.js\nimport { defineConfig } from 'vite'\nimport tailwindcss from '@tailwindcss/vite'\n\nexport default defineConfig({\n  plugins: [tailwindcss()],\n})\n```\n\n### Update package.json\nEdit package.json and update to look similar to this:\n\n```json\n{\n  \"name\": \"php-demo-2025-s2\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"devDependencies\": {\n    \"vite\": \"^7.0.6\",\n    \"@tailwindcss/forms\": \"^0.5.10\",\n    \"@tailwindcss/vite\": \"^4.1.11\",\n    \"concurrently\": \"^9.2.0\",\n    \"tailwindcss\": \"^4.1.11\"\n  },\n  \"dependencies\": {\n    \"@fortawesome/fontawesome-free\": \"^7.0.0\"\n  }\n}\n```\n\n## Install composer packages\n\nWe are going to install the following PHP packages:\n\n- vlucas/phpdotenv\n\n```shell\ncomposer require vlucas/phpdotenv\n```\n- vlucas/phpdotenv provides the ability to read a .env file\n\n### Edit the composer.json file\n\nUpdate the file so that we have a scripts entry that reads:\n\n```json\n{\n  \"require\": {\n    \"vlucas/phpdotenv\": \"^5.6\"\n  },\n  \"scripts\": {\n    \"dev\": [\n      \"Composer\\\\Config::disableProcessTimeout\",\n      \"npx concurrently -c \\\"#93c5fd,#c4b5fd,#fdba74\\\" \\\"php -S localhost:8000 -t public\\\" \\\"npm run dev\\\" --names='server,vite'\"\n    ]\n  }\n}\n```\n\nWe are now ready to execute our improved dev environment:\n\n```shell\ncomposer run dev\n```\n\nYou will see that the PHP development server and vite will now execute and stay running at \nthe same time, in the same shell!\n\nTo access the site go to: https://localhost:8000\n\n```text\n\u003e Composer\\Config::disableProcessTimeout\n\u003e npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php -S localhost:8000 -t public\" \"npm run dev\" --names='server,vite'\n[server] [Wed Aug  6 16:55:30 2025] PHP 8.4.10 Development Server (http://localhost:8000) started\n[vite]\n[vite] \u003e php-demo-2025-s2@0.0.0 dev\n[vite] \u003e vite\n[vite]\n[vite] Port 5173 is in use, trying another one...\n[vite]\n[vite]   VITE v7.0.6  ready in 437 ms\n[vite]\n[vite]   ➜  Local:   http://localhost:5174/\n[vite]   ➜  Network: use --host to expose\n[server] [Wed Aug  6 16:55:46 2025] [::1]:56089 Accepted\n[server] [Wed Aug  6 16:55:46 2025] [::1]:56089 [200]: GET /experiments/exp-05.php\n```\n\n\u003e Note:\n\u003e  \n\u003e We cannot use the tailwind css node package to dynamically create the required styling for \n\u003e the experiments, so for now we will include the Tailwind CSS CDN for development ONLY.\n\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadygcode%2Fphp-demo-2025-s2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadygcode%2Fphp-demo-2025-s2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadygcode%2Fphp-demo-2025-s2/lists"}