Home

Awesome

<img src="https://nititech.de/kosmo-header.png" style="width: 100%;" />

PHP-Vite Starter Repo

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.

Features

Usage

  1. Clone the Repository: Start by cloning this repository to your local machine.
git clone https://github.com/nititech/php-vite-starter.git
  1. Install Dependencies: Navigate into the project directory and install the necessary dependencies using npm or yarn.
cd php-vite-starter
npm install
npm run php-install

Development

  1. Start the development server, just run the following command:
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.

Project Structure

/bin
├── bin
│   ├── composer.phar
│   ├── **/*
/index.php

This is the new entry point ⚠️

/pages
├── pages
│   ├── **/*.php
/partials
├── partials
│   ├── **/*.php
/public
├── public
│   ├── **/*
/raw
├── raw
│   ├── .htaccess
│   ├── **/*
/src
├── src
│   ├── scripts
│   │   ├── **/*
│   ├── styles
│   │   ├── **/*
/system
├── system
│   ├── **/*
/vendor
├── vendor
│   ├── **/*

Production Build

To generate a production build of your project, use:

npm run build

Output

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)

Configuration

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:

License

This project is licensed under the MIT license, see LICENSE.

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please feel free to open an issue or submit a pull request.

<table> <tr> <th> via Ko-Fi </th> <th> Buy me a coffee </th> <th> via PayPal </th> </tr> <tr> <td> <a href="https://ko-fi.com/Y8Y2ALMG" target="_blank"> <img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="ko-fi" width="174"> </a> </td> <td> <a href="https://www.buymeacoffee.com/donnikitos" target="_blank"> <img src="https://nititech.de/donate-buymeacoffee.png" alt="Buy Me A Coffee" width="174"> </a> </td> <td> <a href="https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW" target="_blank"> <img src="https://nititech.de/donate-paypal.png" alt="PayPal" width="174"> </a> </td> </tr> </table>

Acknowledgments

Special thanks to the developers of Vite, Tailwind CSS, and other tools used in this starter repository for their fantastic work.