This webapp is a simple diary app.
You can create, update and delete diary entries, and list all or filtered in descending order.
[ Browser / JS ]
|
| (fetch, POST, GET, JSON)
v
[ API endpoints (PHP files) ]
|
| (call Controller methods)
v
[ Controllers ] → [ Models ] → [ Database ]
| Layer | Purpose | File(s) |
|---|---|---|
| Frontend | UI and user interaction | index.php, assets/js/diary_entry.js |
| API | Interface between frontend & backend | api/diary_entry_xxx.php, ... |
| Controller | Business logic | app\controllers\diary_entry_controller.php |
| Model | Data logic (CRUD) | app\models\diary_entry.php |
| Database | Low-level SQL connection | app\core\database.php |
- index.php
- assets/js/diary_entry.js
- api/diary_entry_xxx.php
- app/controllers/diary_entry_controller.php
- app/models/diary_entry.php
- app/core/database.php
- app/models/diary_entry.php
- app/controllers/diary_entry_controller.php
- api/diary_entry_xxx.php
- assets/js/diary_entry.js
Run the SQL script config/createdb.sql.
The database credentials must be set in config/config.php.
This line in index.php need to be changed according to the directory where this app is placed.
const BASE_URL = "/diary"; // <--- This may need to be changed.
Can be switched on or off in config/debugging.php for PHP and config/debugging.js for JavaScript.

