Skip to content

Core

The Core API serves the CookieHub client dashboard — managing domains, consent settings, cookies, subscriptions, and compliance configuration.

Architecture

There are two implementations running in parallel:

  • Laravel monolith (core/) — the original PHP application at api.cookiehub.com. Handles all production traffic today.
  • Core API v3 (core-api/) — TypeScript rewrite using Hono, Drizzle ORM, and Zod. Deployed to stage, not yet serving production traffic.

Both share the same MariaDB database. The v3 rewrite covers ~60 endpoints across domains, cookies, hosts, languages, regions, settings, scans, consent logs, subscriptions, and user management.

Stage Deployment

Component Value
URL https://core-api.stage.cookiehub.net
Docs https://core-api.stage.cookiehub.net/client/v3/docs
ECS cluster stage-euc1-core-ecs-cluster
ECS service core-api
Task definition stage-euc1-core-core-api (512 CPU, 512 MB)
Port 3000
Health check GET /client/health
Database MariaDB RDS (stage-euc1-core-mariadb), database core
Logs CloudWatch /ecs/stage-euc1-core-core-api

CI/CD

Automated via GitHub Actions on cookiehub-com/core-api:

  1. Push to main triggers Quality checks (lint, typecheck, tests)
  2. On success, Deploy to stage builds a Docker image, pushes to ECR, and forces an ECS redeployment

Authentication uses GitHub OIDC → IAM role gh-oidc-deploy-core-api.

See Deployment runbook for status checks, logs, and rollback steps.

Tech Stack

Layer Technology
Runtime Node.js 24, ESM
Framework Hono + @hono/zod-openapi
ORM Drizzle ORM (mysql2)
Validation Zod
Docs UI Scalar
Testing Vitest
Container Docker (multi-stage, non-root)

Secrets

Stored in SSM Parameter Store under /core/stage/core-api/:

Parameter Description
database_url MariaDB connection string
auth_secret JWT/HMAC signing key

See Secrets management for how to view and rotate.

Dependencies

  • MariaDB RDS — shared database with the Laravel monolith
  • Vault API (optional) — proxies consent analytics and session data. Returns 503 when not configured.