A modern blog application built with Inertia.js, Svelte 5, and PHP without any framework dependencies.
# Download the repository
npx degit https://github.com/dashpilot/inertia-vanilla-php-svelte-sqlite
# Install PHP dependencies
composer install
# Install JavaScript dependencies
npm install
# Start the development servers
npm run dev
This will start:
Build your assets for production:
# Build optimized assets
npm run build
Set $isProduction
in config.php
to true
Then deploy your application to your production server. In production, all assets are served directly from the public/assets
directory.
inertia-blog/
├── composer.json
├── package.json
├── vite.config.js
├── database/
│ └── blog.sqlite
├── public/
│ ├── index.php
│ ├── assets/
│ └── .htaccess
├── resources/
│ ├── js/
│ │ ├── app.js
│ │ ├── Pages/
│ │ │ ├── Home.svelte
│ │ │ ├── Posts/
│ │ │ ├── About.svelte
│ │ │ ├── Contact.svelte
│ │ │ └── Dashboard.svelte
│ │ └── Components/
│ │ ├── Layout.svelte
│ │ └── PostCard.svelte
│ └── views/
│ └── app.php
├── routes/
│ └── web.php
├── src/
│ ├── Inertia.php
│ ├── Database.php
│ ├── Middleware/
│ │ └── Auth.php
│ └── Models/
│ ├── Post.php
│ └── User.php
└── bootstrap.php
routes/web.php
Inertia::render()
to return data to the clientThis project demonstrates that you can build modern, reactive web applications without heavy framework dependencies. By combining vanilla PHP with Inertia.js and Svelte, you get: