php-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.\
This repository utilizes Vite and the vite-plugin-php
plugin to improve developer experience and provide various features to streamline development.
git clone https://github.com/nititech/php-vite-starter.git
cd php-vite-starter
npm install
npm run php-install
npm run dev
Now 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.
├── bin
│ ├── composer.phar
│ ├── **/*
composer.phar
for the php-install command
This is the new entry point ⚠️
├── pages
│ ├── **/*.php
.php
files will be transpiled using Vite and the vite-plugin-php
plugin.php
file extension
/index.php
├── partials
│ ├── **/*.php
.php
files will be transpiled using Vite and the vite-plugin-php
plugin├── public
│ ├── **/*
/example-file.extension
in image, script, style, ... tags├── raw
│ ├── .htaccess
│ ├── **/*
.htaccess
)├── src
│ ├── scripts
│ │ ├── **/*
│ ├── styles
│ │ ├── **/*
/src/styles/example-style.scss
or /src/scripts/some-script.ts
├── system
│ ├── **/*
.php
files in this folder will not be transpiled├── vendor
│ ├── **/*
.php
Files will not be transpiledTo generate a production build of your project, use:
npm run build
All files will be generated and copied into the /dist
folder.
├── dist
│ ├── pages (Publicly accessible by name without .php file extension)
│ │ ├── **/* (Transpiled PHP files from your ./pages folder)
│ │
│ ├── partials
│ │ ├── **/* (Transpiled PHP files from your ./partials folder)
│ │
│ ├── public (Publicly accessible files, usually assets)
│ │ ├── **/* (Files copied from the ./src/public folder)
│ │
│ ├── system
│ │ ├── **/* (Files copied from the ./system folder)
│ │
│ ├── vendor
│ │ ├── **/* (Files copied from the ./vendor folder, usually Composer packages)
│ │
│ ├── .htaccess
│ ├── **/* (Files copied from the ./raw folder)
This starter repository comes with default configurations for various tools. However, you can customize these configurations according to your project requirements. Key configuration files include:
This project is licensed under the MIT license, see LICENSE.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please feel free to open an issue or submit a pull request.
via Ko-Fi | Buy me a coffee | via PayPal |
---|---|---|
Special thanks to the developers of Vite, Tailwind CSS, and other tools used in this starter repository for their fantastic work.