Architecture

Architecture & Data Flow

How the public website, admin panel, API, worker, and data stores fit together — and how a request and a piece of content move through the system.

The shape of the system

There are two front-end applications — the public website and the admin panel — and both talk to a single core REST API. The API owns all business logic and data access. A separate worker process, sharing the API codebase, runs scheduled and queued background work. Behind the API sit three data stores (MongoDB, Redis, OpenSearch) and a set of external service integrations.

Public visitors
Public Website
web2 · PHP/Apache
REST API
Node/Express
Staff & publishers
Admin Panel
AngularJS
REST API
API Worker
cron + queues
REST API
MongoDB
Redis
OpenSearch ×3
REST API / Worker
S3
SendGrid / SES
Ongage
Monday.com
Sentry
Key principle
Neither front end talks to the database directly. The public website (PHP) and the admin panel (AngularJS) are both HTTP clients of the REST API. All reads, writes, search, and integrations flow through the API or its worker.

Edge & domains

CloudFlare sits in front of the platform. The public website serves every town on its own subdomain of macaronikid.com (for example national.macaronikid.com). The API and admin panel each have a dedicated host.

Public website
*.macaronikid.com (per-town subdomains)
REST API
api.macaronikid.com/api/v1/…
Admin panel
admin.macaronikid.com
Development
*.macaronikidlab.com / api.macaronikidlab.com

Request flow: a public pageview

When a visitor opens a town page:

Content flow: publishing an article

Where the logic lives

ConcernLives in
Page rendering, SEO, public templatesweb2 (PHP)
All business logic, auth, validationapi controllers & services
Scheduled / queued work (newsletters, publishing, indexing)api worker process
Content & town management UIadmin-panel (AngularJS)
System of recordMongoDB
Full-text searchOpenSearch (Article / Business / Event)