Codebase

Admin Panel admin-panel

The internal management interface for staff and publishers — an AngularJS single-page app that talks to the REST API.

Repository
macaroni-kid-2.admin-panel
Framework
AngularJS 1.5 + Angular Material 1.1.4, UI Router
Build tooling
Gulp 3 + Bower, built on Node 8 (legacy toolchain)
CSS
Sass / Angular Material theme
Hosting
Heroku — branch-based CI/CD pipeline
Production endpoint
admin.macaronikid.com

How 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

FactoryTalks to
StatisticFactoryThe REST API (statistic/townViewCount, subscriber counts, newsletter totals) → MongoDB
ArticleFactory / EventFactory / GuideFactory / TownFactory / UserFactoryTheir 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:

develop
Development app
staging
Staging app (exists but not actively used)
master
Production app (admin.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 installbower installgulp optimizegulp 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.

Matomo cleanup in progress
The admin panel historically queried a self-hosted Matomo server through an 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.