A modern, standalone frontend to replace/complement the Streamlit app at
gitcanvas-dm.streamlit.app/
gitcanvas/
├── app.py # existing Streamlit app
├── api/ # existing FastAPI backend
├── web/ # 👈 new Next.js / Vite frontend
│ ├── src/
│ ├── package.json
│ └── ...
Pros: One repo, shared contributors, same issues/PRs, great for open-source.
Cons: Slightly more complex CI/CD (need to distinguish Python vs Node builds).
Pros: Cleaner separation of concerns, independent versioning.
Cons: Context switching, PRs split across two repos, harder for contributors.
Verdict: /web inside this repo is the sweet spot for an open-source project.
| Layer | Pick | Why |
|---|---|---|
| Framework | Next.js 15 (App Router) | SSR for SEO, API routes for proxying GitHub token, file-based routing, Vercel-native |
| UI Library | shadcn/ui + Radix | Accessible, composable, matches the dark/modern aesthetic |
| Styling | Tailwind CSS v4 | Utility-first, pairs perfectly with shadcn |
| State | Zustand | Lightweight, no boilerplate, perfect for theme/username state |
| Data Fetching | TanStack Query (React Query) | Caching, background refresh, loading states |
| Animations | Framer Motion | Smooth tab transitions, card animations |
| Code Highlighting | Shiki or react-syntax-highlighter | Beautiful code copy blocks |
| Icons | Lucide React | Already used in shadcn ecosystem |
Quick alternative: If you want something simpler to spin up fast — Vite + React with Tailwind and no SSR.
- Dark-first (GitHub-inspired deep navy/charcoal backgrounds)
- Glassmorphism panels for card preview areas
- Accent: Electric blue
#58a6ff→ violet gradient (similar to existing theme) - Font:
GeistorInterfor UI text,JetBrains Monofor code blocks
┌──────────────────────────────────────────────────────┐
│ 🎨 GitCanvas [username input] [⚡ Generate] │ ← Sticky top navbar
├──────────────────────────────────────────────────────┤
│ sidebar │ main panel │
│ │ ┌─────────────────────────────────┐ │
│ Theme │ │ LIVE SVG PREVIEW (glassmorphic)│ │
│ Colors │ └─────────────────────────────────┘ │
│ Options │ ┌─────────────────────────────────┐ │
│ │ │ 📋 Code │ one-click copy btn │ │
│ │ └─────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
| Route | Description |
|---|---|
/ |
Landing / hero page (why GitCanvas, showcase) |
/builder |
Main card builder app (replaces Streamlit) |
/builder/[card] |
Deep-linkable card routes (/builder/stats, /builder/streak) |
/themes |
Browse and preview all 15+ themes visually in a grid |
/docs |
API docs (lite) — how to use the badge URLs |
/roast |
Dedicated AI Roast page |
- Username input with debounced GitHub fetch → show avatar + name below input as confirmation
- Card selector sidebar — tabs for all 11 card types
- Theme picker — visual color swatches, not just a dropdown
- Live SVG preview — fetches from existing
gitcanvas-api.vercel.appendpoints - Code copy block — toggle Markdown ↔ HTML, one-click copy with toast feedback
- SVG/PNG/JPEG download — reuse the canvas trick from Streamlit
- Theme Studio — full color customizer with HEX/HSL pickers and gradient preview
- Multi-card Canvas — drag-and-drop to arrange multiple cards into a README layout
- Side-by-side comparison — pick 2 themes and compare output
- Theme Gallery —
/themesgrid with hover preview
- AI Roast tab with streaming text (use SSE or polling from Gemini)
- Profile Snapshot — generate shareable link to your current config (store in URL params or localStorage)
- README Generator — select a set of cards and get a full ready-to-paste README section
- GitHub Token in browser — securely pass via Next.js API route (token never exposed in client URL)
The existing gitcanvas-api.vercel.app FastAPI backend already serves SVG via query params. The web frontend just needs to:
- Proxy requests through Next.js API routes — so user tokens aren't exposed in browser URLs
- Add an
/api/github-profileroute — fetch username data (avatar, name, bio) client-side to enrich the UI - Optionally cache SVGs in browser using TanStack Query
Browser → /api/proxy?card=stats&username=torvalds → gitcanvas-api.vercel.app/api/stats
| Step | What | Est. Time |
|---|---|---|
| 1 | npx create-next-app web/ inside repo |
15 min |
| 2 | Tailwind + shadcn setup | 30 min |
| 3 | Landing hero page | 2 hr |
| 4 | /builder layout with sidebar + main |
3 hr |
| 5 | Username input + GitHub profile fetch | 1 hr |
| 6 | Card tabs + theme picker | 3 hr |
| 7 | SVG preview + code copy | 2 hr |
| 8 | SVG/PNG download | 1 hr |
| Total MVP | ~½ day |
- Frontend: Vercel (configured for
web/subdirectory, or separate Vercel project) - Backend: Already on Vercel (
gitcanvas-api.vercel.app) - Streamlit: Keep running at
gitcanvas-dm.streamlit.app— don't kill it, redirect to the new app once stable
| Streamlit | Web App |
|---|---|
| Sidebar-only layout | Flexible multi-panel layout |
| Basic theme dropdown | Visual theme gallery with previews |
| No shareable state | Shareable URL with params |
| Slow first load (Python cold start) | Instant load (static assets) |
| Mobile-unfriendly | Fully responsive |
| Limited animations | Framer Motion, micro-interactions |
| No dark/light toggle for UI itself | Full dark/light UI mode |
| GitHub token visible in URL params | Token proxied server-side |
gitcanvas/
├── app.py # Streamlit app (keep)
├── api/ # FastAPI backend (keep)
├── generators/ # SVG generators (keep)
├── themes/ # Theme definitions (keep)
├── utils/ # Utilities (keep)
├── web/ # 👈 NEW
│ ├── src/
│ │ ├── app/
│ │ │ ├── page.tsx # Landing
│ │ │ ├── builder/ # Main builder
│ │ │ ├── themes/ # Theme gallery
│ │ │ └── roast/ # AI Roast page
│ │ ├── components/
│ │ │ ├── CardPreview.tsx
│ │ │ ├── ThemePicker.tsx
│ │ │ ├── CodeBlock.tsx
│ │ │ └── ...
│ │ └── lib/
│ │ ├── github-api.ts
│ │ └── card-urls.ts
│ ├── public/
│ ├── package.json
│ └── next.config.ts
├── README.md # Update to mention web app
└── requirements.txt