mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 05:57:00 +01:00
* 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>
3.3 KiB
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_SIZEinsrc/config/blog.ts)src/app/[locale]/blog/[slug]/page.tsx— post page (header, content, comments, related posts, prev/next); retired slugs redirect viaRETIRED_POST_REDIRECTSinsrc/config/blog.tssrc/app/[locale]/blog/submit/page.tsx— submission formsrc/app/dashboard/blog-submissions/page.tsx— a user's own submissionssrc/app/admin/content/blog/— staff: posts, new post, commentssrc/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 fromsrc/config/approval-status.ts - Tables: migrations
019_blog_submissions.sqland034_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
- Add
content/posts/<slug>.mdwith frontmatter (title,excerpt,author,category,tags,publishedAt,published(defaults to true),visibility,audience, optionalfeaturedImage). Onlyvisibility: publicposts are listed. - Optional translations:
content/posts/<slug>.en.mdetc. - Commit and push; it appears after the deploy.
Troubleshooting
A post does not appear
- File posts: check
publishedandvisibility. DB posts: checkis_publishedand thatpublished_atis not in the future. - Check that its slug is not in
blog_hidden_slugs. - A DB post with the same slug overrides the file.
Submissions not working
- Check the
blog_submissionstable exists (migration019_blog_submissions.sql). - Check the rate limit has not been hit for that client.
- Check the server log for the
POST /api/public/blog/submiterror.