Skip to content

About

JavaScript Scheduler Quick Start Project (PHP Backend)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

JavaScript Scheduler Quick Start Project (PHP Backend)

This is the code repository for the JavaScript Scheduler Quick Start Project (PHP Backend) tutorial by DayPilot.

Description

  • Includes a Vite-based frontend in frontend/, generated from the DayPilot UI Builder javascript-npm target.
  • 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.

Requirements

  • Node.js 20+
  • npm
  • PHP 8+ with PDO SQLite support
  • Optional: pdo_mysql for MySQL or pdo_pgsql for PostgreSQL

Development

Install the frontend dependencies:

cd frontend
npm install

Start the PHP backend:

php -S 127.0.0.1:8000 backend/router.php

Start the Vite development server:

cd frontend
npm run dev

Open the frontend URL printed by Vite (usually http://127.0.0.1:5173). Vite proxies /api/... calls to the PHP server automatically.

Optional MySQL and PostgreSQL Configuration

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.sqlite

To 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=postgres

The backend applies the matching schema file from backend/database/ on startup.

Production Preview

Build the frontend:

cd frontend
npm run build

Then start the PHP server again:

php -S 127.0.0.1:8000 backend/router.php

When frontend/dist/ exists, backend/router.php serves the built frontend and the /api/... routes from the same host.

License

  • The code of this tutorial is licensed under Apache License 2.0.
  • This tutorial may include third-party libraries available under their respective licenses.

About

JavaScript Scheduler Quick Start Project (PHP Backend)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages