A simple, minimal template for building single-page applications with PHP using the PhpSPA Framework.
composer create-project phpspa/phpspa MyApp
cd MyApp
composer startphp -S localhost:8000 -t public- Point your Apache document root to the
public/directory - Or create a virtual host:
<VirtualHost *:80>
DocumentRoot /path/to/project/public
ServerName myapp.local
<Directory /path/to/project/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>To run with Tailwind CSS in watch mode (rebuilds CSS on changes):
npm run devThen in another terminal run either:
composer start(PHP server)- Or access via Apache at your configured domain
- 2 Simple Pages: Home and About
- Clean Layout: Minimal HTML structure
- Tailwind CSS: For styling
- Responsive: Works on all devices
src/
├── index.php # App entry point
├── layout/
└── Layout.php # Main layout
└── pages/
├── HomePage.php # Home page
└── AboutPage.php # About page
- Edit content in
pages/files - Modify styles by updating Tailwind classes
- Add new pages by creating new files and registering routes in
index.php
That's it! Simple and ready to go.
Built with PhpSPA Framework