This is the code repository for the Open-Source Angular Appointment Calendar Component (TypeScript + PHP/MySQL) tutorial by DayPilot.
- Includes DayPilot Lite for JavaScript - open-source calendar/scheduling components for JavaScript/Angular/React/Vue (Apache License 2.0).
- This project was generated using the DayPilot UI Builder, an online tool for configuring DayPilot components and generating starter projects.
- The code of this tutorial is licensed under Apache License 2.0.
- This tutorial may include third-party libraries available under their respective licenses.
- Install:
npm ci(uses the committedpackage-lock.json). - Development:
npm run start. - Build:
npm run build. - Lint: no
lintscript is provided. - Test:
npm run test.
frontend/ contains the Angular application, package files and configuration.
backend/ contains the PHP JSON API. Shared licensing and third-party notices
are kept at the repository root.
Use Node.js supported by Angular 22, npm, and PHP 8 with PDO SQLite enabled.
The commands below work in Windows PowerShell or Command Prompt, macOS, and Linux.
Make sure php, node, and npm are on PATH. On Windows, enable pdo_sqlite
in the active php.ini (locate it with php --ini).
From the sample root, start the PHP server:
cd backend
php -S 127.0.0.1:8090 -t publicIn a second terminal, starting at the sample root:
cd frontend
npm ci
npm startOpen http://localhost:4200. Angular serves the frontend and proxies /api/**
to PHP at http://127.0.0.1:8090 using frontend/proxy.conf.json.
Select a time range to create an appointment; drag to move or resize it and
hover to reveal the delete icon. The Navigator selects the visible week.
The database starts empty. Appointments are stored in backend/daypilot.sqlite,
created automatically on the first API request, and survive reloads and server
restarts. Keep this generated file out of source control and the download.
Only backend/public/ is served. The database, configuration, and API implementation
remain outside the document root; its entry point dispatches the allowed API routes.
From the sample root:
cd frontend
npm run buildThe static output is in frontend/dist/angular-appointment-calendar-component-typescript/browser/.
The development proxy is not part of the production build. Configure your web
server to serve that output and forward /api/ to PHP. Do not expose the
SQLite file. This tutorial has no authentication; add access control before
using it for private appointments.
Create a MySQL database named calendar and a user with permissions to create
and modify its events table. Enable PHP's PDO MySQL extension (pdo_mysql in
php.ini on Windows). Edit backend/config.php: set driver to mysql and
fill in host, port, database, username, and password in its mysql array.
Keep real credentials local. Restart PHP using the same command shown above;
no shell environment variables are needed on any platform.
The table initializes automatically with the same fields as SQLite. Existing SQLite appointments are not copied. SQLite is the tested local setup; optional MySQL configuration requires a running MySQL service.