Files
news-platform/.cursor/rules/news-platform-stack-and-boundaries.mdc
T
Artur Moreira c001907137 feat(cursor): add baseline stack and boundaries rules
Introduce news-platform-stack-and-boundaries.mdc for Astro/Fastify/WordPress
layers, Gitea deploy expectations, and secrets hygiene.

Paperclip-Issue: BIT-1953
Paperclip-Run: 195b0ea6-3690-401f-8009-1d1b4738337a
2026-04-09 22:46:26 +00:00

34 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: News platform — Astro/Fastify/WordPress stack, repo boundaries, deploy and secrets
alwaysApply: true
---
# news-platform — stack and boundaries
This repository is the **multi-domain sports news platform** for BitReport: **Astro 5 SSR** (`frontend/`), **Fastify** bridge (`bridge/`), **headless WordPress** (`wordpress/`), optional **writer-pipeline**, and **config/domains/** for per-site JSON.
## Layer boundaries (do not blur)
- **`frontend/`** — Astro SSR only. It **consumes the bridge HTTP API** for articles, categories, search, etc. It does **not** call WordPress REST directly in normal flows; the bridge isolates WP schema and caching (see `docs/bridge.md`, `docs/frontend.md`).
- **`bridge/`** — Fastify + TypeScript. Owns WP REST clients, Redis cache, normalization, and cache invalidation. Keep route and service code here; avoid duplicating WP URL logic in the frontend.
- **`wordpress/`** — CMS runtime (Docker Compose, themes, plugins). PHP and WP conventions apply **inside this tree**; do not move business rules that belong in Node into PHP without an explicit issue.
- **`writer-pipeline/`**, **`deploy/`**, **`config/domains/`** — treat as separate concerns; follow existing `docs/` for each.
## Documentation first
Before large or cross-cutting changes, read the relevant files under **`docs/`** (e.g. `architecture.md`, `frontend.md`, `bridge.md`, `domains.md`, `deployment.md`, `docs/runbooks/README.md`). Prefer aligning with documented contracts over inventing new ones.
## Deploy and Git (Gitea)
- **Source of truth** for application code is this **Gitea** remote (`README.md`). Land changes on the appropriate branch, then deploy with the **versioned scripts** under `deploy/` and runbooks in `docs/deployment.md` — do not assume GitHub or a specific cloud CI unless the issue says so.
- **Webhooks / automation** (e.g. post-receive deploy, BIT-346-style integration): follow project runbooks; do not embed hostnames, tokens, or hook secrets in committed files.
## Secrets and credentials
- **Never commit** real API keys, passwords, `.env` with secrets, or weak placeholders (`changeme`, `password`, `123456`, etc.). Use env vars and operator-managed files on the server; `.env.example` may use empty values + comments pointing to how to generate or load secrets.
- Do **not** change production credentials or access paths in code without issue scope, rollback notes, and verification steps (see company `PRODUCT_REPOSITORY_STANDARDS` / credential gate).
## Testing and verification
- Respect each package’s **`package.json`** scripts (`frontend/`, `bridge/`, etc.). After substantive changes, run the relevant **lint/build/test** commands before considering work complete.