Admin Panel admin-panel
The internal management interface for staff and publishers — an AngularJS single-page app that talks to the REST API.
macaroni-kid-2.admin-paneladmin.macaronikid.comHow it works
The app is a classic AngularJS SPA: client/app/ holds feature modules (dashboard, article, guide, event, town, user, statistic, admin, …), each with controllers, factories, and HTML templates. Factories wrap REST API calls; UI Router (core/config.route.js) defines the routes/states. Everything renders client-side and reads/writes through the API.
Data factories
| Factory | Talks to |
|---|---|
StatisticFactory | The REST API (statistic/townViewCount, subscriber counts, newsletter totals) → MongoDB |
ArticleFactory / EventFactory / GuideFactory / TownFactory / UserFactory | Their respective REST API resources |
The dashboards (admin overview and per-town) and the /admin/statistic/pageView report all source their numbers from StatisticFactory → the API → MongoDB's TownViewCount.
Build & deployment
The admin panel is deployed on Heroku via a branch-based CI/CD pipeline — a commit to a branch rebuilds the corresponding app automatically:
developstagingmasteradmin.macaronikid.com)The Heroku build is driven by app.json (Angular SPA buildpack) and the Procfile (web: bin/www); the postdeploy hook runs bin/setup (npm install → bower install → gulp optimize → gulp copy). A pr-predestroy hook indicates Heroku review apps are configured per pull request. Required env vars include API_URL, API_PREFIX_PATH, API_IMAGE_URL, APP_ENV, FORCE_HTTPS, NODE_ENV.
A Dockerfile and docker.yml workflow also exist in the repo (used by the local Docker Compose stack), but production hosting is Heroku, not a container host.
AnalyticsFactory (one Dashboard widget) and a dead statistics.macaronikid.com helper. Those references are being removed as part of the analytics decommission; the live pageview reporting (via StatisticFactory) is unaffected.
Legacy toolchain caveat
This is the oldest toolchain in the stack: AngularJS (end-of-life), Node 8 build, Gulp 3, and Bower. It builds and runs in a container, but modernizing or even rebuilding it requires the pinned legacy environment. Flagged in Gaps & Open Questions.