{"id":13607942,"url":"https://github.com/nititech/php-vite-starter","last_synced_at":"2025-04-09T20:03:35.761Z","repository":{"id":228805984,"uuid":"758920197","full_name":"nititech/php-vite-starter","owner":"nititech","description":"A modern vanilla PHP-Vite starter repo, utilizing vite-plugin-php","archived":false,"fork":false,"pushed_at":"2025-03-04T10:04:19.000Z","size":1054,"stargazers_count":36,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:03:27.428Z","etag":null,"topics":["development","php","php7","php8","starter","starter-kit","starter-template","vite","vite-php","vite-plugin-php","vitejs","website"],"latest_commit_sha":null,"homepage":"https://github.com/nititech/php-vite-starter","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/nititech.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":["donnikitos"],"patreon":null,"open_collective":null,"ko_fi":"donnikitos","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"donnikitos","custom":["https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW"]}},"created_at":"2024-02-17T13:19:57.000Z","updated_at":"2025-03-28T20:17:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc1376b3-4052-4626-9a5d-3e7e470cb8bb","html_url":"https://github.com/nititech/php-vite-starter","commit_stats":null,"previous_names":["nititech/php-vite-starter"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nititech%2Fphp-vite-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nititech%2Fphp-vite-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nititech%2Fphp-vite-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nititech%2Fphp-vite-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nititech","download_url":"https://codeload.github.com/nititech/php-vite-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103864,"owners_count":21048245,"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":["development","php","php7","php8","starter","starter-kit","starter-template","vite","vite-php","vite-plugin-php","vitejs","website"],"created_at":"2024-08-01T19:01:23.011Z","updated_at":"2025-04-09T20:03:35.733Z","avatar_url":"https://github.com/nititech.png","language":"PHP","funding_links":["https://github.com/sponsors/donnikitos","https://ko-fi.com/donnikitos","https://buymeacoffee.com/donnikitos","https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW","https://ko-fi.com/Y8Y2ALMG","https://www.buymeacoffee.com/donnikitos"],"categories":["Integrations with Backends"],"sub_categories":["PHP"],"readme":"\u003cimg src=\"https://nititech.de/kosmo-header.png\" style=\"width: 100%;\" /\u003e\n\n\u003ch1 style=\"margin-bottom:0\"\u003ePHP-Vite Starter Repo \u003cspan style=\"font-size:1rem;\"\u003eby \u003ca href=\"https://nititech.de\" target=\"_blank\"\u003enititech\u003c/a\u003e\u003c/span\u003e\u003c/h1\u003e\n\nphp-vite-starter is a modern vanilla PHP-Vite starter repository designed to provide developers with the essential tools to kickstart their development of modern PHP applications.\\\nThis repository utilizes [Vite](https://vitejs.dev/) and the [`vite-plugin-php` plugin](https://github.com/donnikitos/vite-plugin-php) to improve developer experience and provide various features to streamline development.\n\n## Features\n\n-   **Auto-refresh / auto-reloading**\n-   **JS environmental variables in PHP**: Use environmental variables supplied in `.env` or to Vite in your PHP code.\n-   **FastRoute router**: Fast and simple preconfigured router.\n-   **TypeScript / JavaScript Transpilation**: Write modern JavaScript or TypeScript code, which will be automatically transpiled to browser-compatible JavaScript.\n-   **Tailwind CSS Implementation**: Utilize Tailwind CSS for rapid UI development with utility-first classes.\n-   **SASS / SCSS Support**: Write styles using SASS or SCSS syntax, with built-in support for compilation.\n-   **EJS Template Language Support**: Use the EJS (Embedded JavaScript) templating language for using JavaScript pieces in your PHP-files.\n-   **Image Transform Tools**: Easily manage and transform images as needed for your application.\n-   **SVG Loader**: Load SVG files directly into your project, allowing for scalable vector graphics usage.\n\n## Usage\n\n1. **Clone the Repository**: Start by cloning this repository to your local machine.\n\n```bash\ngit clone https://github.com/nititech/php-vite-starter.git\n```\n\n2. **Install Dependencies**: Navigate into the project directory and install the necessary dependencies using npm or yarn.\n\n```bash\ncd php-vite-starter\nnpm install\nnpm run composer install\n```\n\n## Development\n\n3. Start the development server, just run the following command:\n\n```bash\nnpm run dev\n```\n\nNow you can access your application. Once the server is running, you can access your application by navigating to http://localhost:3000/ in your web browser.\n\n## Project Structure\n\n##### /bin\n\n```\n├── bin\n│   ├── composer.phar\n│   ├── **/*\n```\n\n-   This folder is supposed to hold binaries that are needed for project compilations and such\n-   Currently holds only `composer.phar` for the `composer` command\n\n##### /index.php\n\nThis is the app entry point ⚠️\n\n-   Routing is now programmatic and uses [nikic' `FastRoute`](https://github.com/nikic/FastRoute) router -\u003e for configuration see the `/configs/routes.php` file\n-   Non-PHP files will not go through this router\n-   Nonexisting files and paths will go through this router\n\n##### /configs\n\n```\n├── configs\n│   ├── env.php\n│   ├── routes.php\n│   ├── **/*\n```\n\n-   `env.php` will be transpiled using Vite and the `vite-plugin-php` plugin -\u003e here you can store tokens or other constants that should be reused through the app.\\\n    We use it to define the constants that we import from Vite.\n-   `routes.php` holds the routing configuration that is being used by FastRoute\n\n##### /pages\n\n```\n├── pages\n│   ├── **/*.php\n```\n\n-   This `.php` files will be transpiled using Vite and the `vite-plugin-php` plugin\n\n##### /partials\n\n```\n├── partials\n│   ├── **/*.php\n```\n\n-   Includable files (like components)\n-   These `.php` files will be transpiled using Vite and the `vite-plugin-php` plugin\n\n##### /public\n\n```\n├── public\n│   ├── **/*\n```\n\n-   Publicly accessible files should be placed here\n-   Can be accessed by `/example-file.extension` in image, script, style, ... tags\n-   Files will not be transpiled\n\n##### /raw\n\n```\n├── raw\n│   ├── .htaccess\n│   ├── **/*\n```\n\n-   These files will be copied into the root of your build\n-   Usually used for configurations, routers and so on (like the included `.htaccess`)\n\n##### /src\n\n```\n├── src\n│   ├── scripts\n│   │   ├── **/*\n│   ├── styles\n│   │   ├── **/*\n```\n\n-   This folder should be used for files that need be handled by Vite\n-   Files can be accessed for example by `/src/styles/example-style.scss` or `/src/scripts/some-script.ts`\n\n##### /system\n\n```\n├── system\n│   ├── **/*\n```\n\n-   `.php` files in this folder will not be transpiled\n-   Usually used for autoloaders, database connections etc.\n\n##### /vendor\n\n```\n├── vendor\n│   ├── **/*\n```\n\n-   Vendor files installed by Composer\n-   `.php` Files will not be transpiled\n\n## Production Build\n\nTo generate a production build of your project, use:\n\n```bash\nnpm run build\n```\n\n#### Output\n\nAll files will be generated and copied into the `/dist` folder.\n\n```\n├── dist\n│   ├── configs (Files copied from the ./configs folder)\n│   │   ├── env.php (Transpiled to include environmental variables)\n│   │   ├── routes.php\n│   │   ├── **/*\n│   ├── pages\n│   │   ├── **/* (Transpiled PHP files from your ./pages folder)\n│   │\n│   ├── partials\n│   │   ├── **/* (Transpiled PHP files from your ./partials folder)\n│   │\n│   ├── public (Publicly accessible files, usually assets)\n│   │   ├── **/* (Files copied from the ./src/public folder)\n│   │\n│   ├── system\n│   │   ├── **/* (Files copied from the ./system folder)\n│   │\n│   ├── vendor\n│   │   ├── **/* (Files copied from the ./vendor folder, usually Composer packages)\n│   │\n│   ├── .htaccess\n│   ├── **/* (Files copied from the ./raw folder)\n```\n\n## Configuration\n\nThis starter repository comes with default configurations for various tools. However, you can customize these configurations according to your project requirements. Key configuration files include:\n\n-   **configs/routes.php**: Routing configuration.\n-   **configs/env.php**: Globally accessible constants for PHP.\n-   **tsconfig.json**: TypeScript configuration file. Modify this file to adjust TypeScript compiler options.\n-   **.prettierrc**: Prettier configuration file for code formatting. Modify this file to customize code formatting rules.\n-   **vite.config.ts**: Contains configuration settings for Vite, such as plugins, build options, and server settings.\n-   **tailwind.config.ts**: Configuration file for Tailwind CSS. Customize this file to adjust Tailwind CSS settings.\n-   **postcss.config.cjs**: Configuration for PostCSS, which is used for processing CSS. Modify this file to include additional PostCSS plugins or settings.\n\n## License\n\nThis project is licensed under the MIT license, see LICENSE.\n\n## Contributing\n\nContributions are welcome! If you have any suggestions, improvements, or bug fixes, please feel free to open an issue or submit a pull request.\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003e\n\t\t\tvia Ko-Fi\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tBuy me a coffee\n\t\t\u003c/th\u003e\n\t\t\u003cth\u003e\n\t\t\tvia PayPal\n\t\t\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003ca href=\"https://ko-fi.com/Y8Y2ALMG\" target=\"_blank\"\u003e\n\t\t\t\t\u003cimg src=\"https://ko-fi.com/img/githubbutton_sm.svg\" alt=\"ko-fi\" width=\"174\"\u003e\n\t\t\t\u003c/a\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003ca href=\"https://www.buymeacoffee.com/donnikitos\" target=\"_blank\"\u003e\n\t\t\t\t\u003cimg src=\"https://nititech.de/donate-buymeacoffee.png\" alt=\"Buy Me A Coffee\" width=\"174\"\u003e\n\t\t\t\u003c/a\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW\" target=\"_blank\"\u003e\n\t\t\t\t\u003cimg src=\"https://nititech.de/donate-paypal.png\" alt=\"PayPal\" width=\"174\"\u003e\n\t\t\t\u003c/a\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n## Acknowledgments\n\nSpecial thanks to the developers of Vite, Tailwind CSS, FastRoutes, and other tools used in this starter repository for their fantastic work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnititech%2Fphp-vite-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnititech%2Fphp-vite-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnititech%2Fphp-vite-starter/lists"}