Paste your code. Get roasted.
A code review platform that scores submitted snippets, returns detailed findings and a suggested diff β with an optional full-sarcasm roast mode.
- β¨ Features
- βοΈ How It Works
- π Tech Stack
- π Architecture
- π Database Schema
- π Getting Started
- π Environment Variables
- π Scripts
| Feature | Description |
|---|---|
| π¨ Syntax Highlighting | Real-time highlighting in the code editor, powered by Shiki with auto-detection via highlight.js |
| π₯ Roast Mode | Toggle between honest analysis and maximum-sarcasm mode |
| π Scored Feedback | Every submission receives a score from 0 to 10 alongside categorized findings (critical, warning, good) |
| π Suggested Diff | Each result includes a before/after diff of the recommended fix |
| π Shame Leaderboard | Publicly ranks submissions by score with a live code preview |
| π Animated Stats | Homepage metrics animate from zero on load via NumberFlow |
flowchart LR
A["π Paste Code\n(editor)"] --> B["π Choose Mode\n(honest / π₯ roast)"]
B --> C["π Submit\n(tRPC mutation)"]
C --> D["π€ AI Analyzes\nthe snippet"]
D --> E["π Score + Findings\n+ Suggested Diff"]
E --> F["π Result Page"]
F --> G["π Shame Leaderboard\n(if public)"]
| Layer | Technology |
|---|---|
| Framework | Next.js 16 β App Router, React Compiler, Turbopack |
| UI | React 19, Tailwind CSS v4, Shiki, NumberFlow |
| API | tRPC v11, TanStack React Query v5 |
| Database | Drizzle ORM, PostgreSQL (Neon) |
| Validation | Zod v4 |
| Linter / Formatter | Biome 2 |
| Package Manager | pnpm |
graph TD
User["User"]
subgraph Frontend["Next.js 16 β App Router"]
Page["page.tsx Β· Server Component"]
Editor["CodeInput Β· Client Component"]
Stats["StatsHint Β· Client Component"]
Result["roast/[id] Β· Server Component"]
LB["Leaderboard Β· Server Component"]
end
subgraph API["tRPC v11"]
Router["AppRouter"]
LBRouter["leaderboard\nstats Β· list"]
SubRouter["submissions\ngetById Β· create"]
end
subgraph DB["Drizzle ORM Β· Neon PostgreSQL"]
Submissions[("submissions")]
Findings[("analysis_findings")]
end
User --> Page
Page --> Editor
Page --> Stats
User --> Result
User --> LB
Stats -->|"useQuery"| Router
Editor -->|"useMutation"| Router
Result -->|"caller.getById"| Router
LB -->|"prefetch"| Router
Router --> LBRouter
Router --> SubRouter
LBRouter --> Submissions
SubRouter --> Submissions
SubRouter --> Findings
Submissions -->|"cascade delete"| Findings
erDiagram
submissions {
uuid id PK
text code
varchar code_preview
text lang
enum roast_mode
numeric score
text roast_text
boolean is_public
timestamptz created_at
}
analysis_findings {
uuid id PK
uuid submission_id FK
enum severity
text title
text description
integer sort_order
}
submissions ||--o{ analysis_findings : "has"
- Node.js 18+
- pnpm 9+
- A PostgreSQL database β either a Neon cloud instance or a local container via Docker Compose
git clone https://github.com/andersonkaiti/devroast.git
cd devroastpnpm installChoose one of the options below and set DATABASE_URL in your .env:
cp .env.example .envOption A β Neon (cloud)
DATABASE_URL=postgresql://<user>:<password>@<host>.neon.tech/<db>?sslmode=require
Option B β Docker Compose (local)
docker compose up -dDATABASE_URL=postgresql://devroast:devroast@localhost:5432/devroast
pnpm db:pushpnpm db:seedpnpm devOpen http://localhost:3000 in your browser.
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string (Neon or local Docker) | β |
Copy .env.example to .env and fill in the values before starting the server.