This is the code repository for the JavaScript Scheduler Quick Start Project (PHP Backend) tutorial by DayPilot.
- Includes a Vite-based frontend in
frontend/, generated from the DayPilot UI Builderjavascript-npmtarget. - Uses the open-source DayPilot Lite for JavaScript package.
- Keeps the PHP 8 JSON API in
backend/so the frontend/backend split stays explicit. - Loads Scheduler resources and events from the backend and persists event create, move, resize, rename, and delete actions.
- Uses SQLite by default and supports optional MySQL and PostgreSQL configuration through PDO.
- Node.js 20+
- npm
- PHP 8+ with PDO SQLite support
- Optional:
pdo_mysqlfor MySQL orpdo_pgsqlfor PostgreSQL
Install the frontend dependencies:
cd frontend
npm installStart the PHP backend:
php -S 127.0.0.1:8000 backend/router.phpStart the Vite development server:
cd frontend
npm run devOpen the frontend URL printed by Vite (usually http://127.0.0.1:5173). Vite proxies /api/... calls to the PHP server automatically.
Copy backend/.env.example to backend/.env and change the database settings.
SQLite works out of the box:
DB_DRIVER=sqlite
DB_SQLITE_PATH=backend/storage/quick-start.sqliteTo use MySQL instead:
DB_DRIVER=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=daypilot_quick_start
DB_USER=root
DB_PASSWORD=To use PostgreSQL instead:
DB_DRIVER=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_NAME=daypilot_quick_start
DB_USER=postgres
DB_PASSWORD=postgresThe backend applies the matching schema file from backend/database/ on startup.
Build the frontend:
cd frontend
npm run buildThen start the PHP server again:
php -S 127.0.0.1:8000 backend/router.phpWhen frontend/dist/ exists, backend/router.php serves the built frontend and the /api/... routes from the same host.
- The code of this tutorial is licensed under Apache License 2.0.
- This tutorial may include third-party libraries available under their respective licenses.