Files
evig/docs/BLOG_SYSTEM.md
CatoandClaude Opus 5.5 acc2353a2f docs: regenerate API docs, archive dated records, fix live docs (#574)
* docs: regenerate API documentation from src/app/api (329 routes)

The generator only recognised `export async function GET`, so every route
exported as a guarded const (`export const GET = withAdmin(...)`) or a
destructured re-export was missing: the doc listed 116 endpoints, many of
them since renamed or removed, against 329 route files today. Teach it the
other two export shapes and the withAuth/withAdmin guards, and regenerate
both copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* docs: archive dated audits, compliance trackers and migration proposals

Moves point-in-time records into docs/archive/ (with a README saying they
describe the day they were written): the 2026-01 dev-guide compliance
plan, codebase audit, DRY/SSOT and Phase 1 fix logs, the 2026-02 overnight
cross-project plan, the 2026-07-02 audit report, the 2026-07-06 Shopware
migration plan and system migration strategy, and CODE_AUDIT.md.

CODE_AUDIT.md was listed in .claude/CLAUDE.md, .gemini/GEMINI.md and
docs/README.md as the current list of issues to fix while its own banner
called it a historical snapshot; those entries now point at
docs/AUDIT_BACKLOG_2026-08.md, the list of findings still open. docs/README
also stops linking api/, legacy/ and reference/, which do not exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* docs: archive closed trackers and docs for removed code

Into docs/archive/: ARCHITECTURE_DEBT (status CLOSED 2026-06-30),
DATABASE_AUDIT (Neon, pre-cutover), UPGRADE_PLAN (2026-06-03 snapshot;
Tailwind 4 and React 19 are done), MIGRATION_PLAN_QQQ5 and
PROFILES_SSOT_PLAN (both executed: migrations 105 and 121/122),
production-ready-checklist (Frauenfeld plan that never shipped), and three
docs whose code is gone: PROJECT_PAGES_GUIDE (src/components/projects and
the per-project pages, now one [slug] route), RevampCopilot (no
src/features/chatbot) and projects/upcycling (the /projects/upcycling
pages and businessPlan messages are no longer in the tree).

Inbound references follow the move, including three code comments.
SHARED_CONTEXT and COMMANDS stop describing the upcycling mini-site as
live; COMMANDS drops db:migrate-users, which is not a script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* docs: correct live docs against the tree

- BLOG_SYSTEM: rewritten from the code. There is no TinaCMS and no
  content/submissions; posts merge content/posts/*.md with blog_posts, and
  submissions are blog_submissions rows reviewed by staff.
- installation guide: rewritten. There is no cms-api, no
  docker-compose.dev.yml and no default admin password; setup is
  services:up, db:migrate, setup-admins, dev.
- RELIABILITY: migration 005b (not 005), no ENABLE_CMS gate, prod facts.
- RESPONSIVE_DESIGN_SYSTEM: ResponsiveSection/Hero/Heading were removed;
  document Section, PageHero and Heading instead.
- DEAD_CODE: the /api/repairers and /api/it-hilfe/helpers proxies and the
  routes.helpers alias are deleted, not 410; fix a stale line range.
- DEV_GUIDE, AGENTS, claude/cursor/gemini guides, .cursorrules:
  DEVELOPMENT_GUIDELINES.md never existed here; protected files are in
  .claude/CLAUDE.md. src/config/site.ts -> org.ts/urls.ts; Next.js 16.
- src/middleware.ts -> src/proxy.ts; components/ui/Button.tsx ->
  src/components/ui/button.tsx; reference page paths.
- docs-paths baseline 68 -> 6, as the check asks when the count falls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* docs: fix dead links in package and example READMEs

ai-native-cms-core linked a Next.js plugin, a CLI and docs/quick-start.md
that do not exist in this repo; ai-native-cms-react has no README; the
saldo README pointed at the repo root instead of the implementation in
src/lib/team/saldo.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:10:38 +02:00

3.3 KiB

Blog System Documentation

Overview

The evig blog merges two sources into one public list, and runs user submissions through a staff review in the database. There is no external CMS.

Where posts come from

Source Authored by Read by
Markdown files in content/posts/ (<slug>.md is German, <slug>.<locale>.md a translation) developers and agents, via git src/lib/blog.ts
blog_posts table (+ blog_post_translations per locale, blog_categories, blog_hidden_slugs) staff, in the admin UI src/lib/blog-db.ts

getMergedPosts(locale) in src/lib/blog-merge.ts is the one read layer: it merges both, dedupes by slug (on a collision the DB post wins), drops hidden slugs and sorts by publication date. Locales fall back to German, like the rest of the site. Who may see a post is src/lib/blog-access.ts; unlisted posts are unlocked through src/lib/blog-unlisted-auth.ts.

Pages

  • src/app/[locale]/blog/(index)/page.tsx — listing, search, categories, pagination (BLOG_PAGE_SIZE in src/config/blog.ts)
  • src/app/[locale]/blog/[slug]/page.tsx — post page (header, content, comments, related posts, prev/next); retired slugs redirect via RETIRED_POST_REDIRECTS in src/config/blog.ts
  • src/app/[locale]/blog/submit/page.tsx — submission form
  • src/app/dashboard/blog-submissions/page.tsx — a user's own submissions
  • src/app/admin/content/blog/ — staff: posts, new post, comments
  • src/app/admin/content/submissions/page.tsx — staff: review queue

Components live in src/components/blog/.

Submission and approval flow

User submits → blog_submissions (pending) → staff review → approved / rejected / changes requested
                                                         → publish → blog_posts
  • Public submission: POST /api/public/blog/submit (rate limited, no CSRF, so anonymous visitors can submit)
  • Signed-in users: GET /api/blog/my-submissions, POST /api/blog/submissions/[id]/resubmit
  • Staff: /api/admin/blog/* and /api/admin/blog/submissions/[id]
  • Review actions (approve, reject, publish, request changes, edit) are in src/lib/services/blog-submission.ts; statuses come from src/config/approval-status.ts
  • Tables: migrations 019_blog_submissions.sql and 034_admin_edit_submissions.sql

Translations of DB posts are generated from the admin (/api/admin/blog/[id]/translate, src/lib/services/blog-translate.ts).

Writing a file-based post

  1. Add content/posts/<slug>.md with frontmatter (title, excerpt, author, category, tags, publishedAt, published (defaults to true), visibility, audience, optional featuredImage). Only visibility: public posts are listed.
  2. Optional translations: content/posts/<slug>.en.md etc.
  3. Commit and push; it appears after the deploy.

Troubleshooting

A post does not appear

  1. File posts: check published and visibility. DB posts: check is_published and that published_at is not in the future.
  2. Check that its slug is not in blog_hidden_slugs.
  3. A DB post with the same slug overrides the file.

Submissions not working

  1. Check the blog_submissions table exists (migration 019_blog_submissions.sql).
  2. Check the rate limit has not been hit for that client.
  3. Check the server log for the POST /api/public/blog/submit error.