A PHP recreation of NASA's Astronomy Picture of the Day experience, focused on accessibility, readable server-rendered pages, and a lightweight no-database architecture.
Live site: https://alanfullbeard.com/apod
- Accessible browsing for keyboard, screen reader, low-vision, zoomed-layout, and reduced-motion users.
- Simple deployment under
/apodon Apache/PHP. - No database dependency; APOD metadata is read from JSON.
- Source-only repository. Generated APOD media is intentionally not tracked.
.
├── app/
│ ├── includes/ # shared PHP includes and head/lightbox helpers
│ ├── pages/ # route-level page views
│ └── partials/ # header, footer, and shared layout fragments
├── assets/
│ ├── css/ # source and minified stylesheets
│ └── js/ # source and minified scripts
├── data/ # APOD JSON metadata and content helpers
├── scripts/ # local maintenance utilities
├── images/ # generated media, ignored by git
├── thumbs/ # generated thumbnails, ignored by git
├── .htaccess # Apache routing and access rules
└── index.php # front controller
Place the project at /opt/lampp/htdocs/apod or another Apache document path that serves it at /apod.
Set APOD_DEBUG=1 only in local development to render friendly PHP errors. Production should leave APOD_DEBUG unset or set to 0 so errors are logged server-side instead of displayed.
Useful checks after PHP changes:
scripts/php-lint.sh
scripts/check-source-only.sh
scripts/check-file-modes.sh
scripts/check-assets.sh
curl -A 'Mozilla/5.0' -I http://localhost/apod/images/ and thumbs/ are generated local assets and are excluded from git. The JSON data may reference those paths, but the media files themselves should be generated or deployed separately.
Shared UI chrome is implemented with PHP/CSS and tracked font assets so a source checkout does not depend on ignored image files.
The share-image utility lives at:
php scripts/generate-share-images.php- Gallery results are still rendered by JavaScript. Future work should move result and navigation markup to PHP to align with the project's no-JavaScript-rendering rule.
assets/js/lightbox.js.deprecatedis retained temporarily while confirming no behavior depends on the old standalone lightbox script.