How stefanluth/kummerkasten works
Main System Components
Frontend Layer:
• Main page routes (/top/*, /reported, /unlock, etc.)
• Key components (_components directory)
• Server actions (_actions directory)
Backend Layer:
• API routes (particularly the delete route)
• Prisma ORM connection
• PostgreSQL database
Component Relationships
• Client-side components → Server Actions
• Server Actions → Database (via Prisma)
• API Routes → Database (via Prisma)
Specific Implementation Details
• Authentication System (password-based access)
• Post Management System
• Voting System
• Reporting System
Data Flow
• User interaction flow (unlock → post → vote/report)
• Anonymous data handling
• Post lifecycle (creation → voting → possible reporting → possible deletion)
[Client Layer]
• Pages (Next.js Routes)
• Main Feed
• Top Posts (day/week/month/year/all)
• Reported Posts
• Unlock Page
• Components
• NavBar
• Post Components
• Forms (Add/Report)
[Server Layer]
• Server Actions
• Post Management
• Voting System
• Report Handling
• API Routes
• Delete Post
[Data Layer]
• Prisma ORM
• PostgreSQL Database
• Posts Table
• Votes Table
• Reports Table
Important Elements to Include:
Security Features
• Password protection mechanism
• Anonymous submission flow
• Report threshold system
State Management
• How post data is fetched and cached
• Voting state management
• Report counting mechanism
• Blue: Client-side components
• Green: Server-side components
• Yellow: Database layer
• Red: Security-critical paths
• Purple: Anonymous data flow