How swarajbachu/resubs works
Project type and purpose
• Resubs is a full‑stack web application for subscription tracking.
• Built with Next.js and React on the frontend, Edge‑hosted on Cloudflare Pages, with a Cloudflare D1 database and NextAuth.js for authentication.
File structure
• Top‑level:
• next.config.mjs, postcss.config.mjs, tailwind.config.ts, tsconfig.json → build and styling configurations
• wrangler.toml → Cloudflare Pages / Workers configuration
• drizzle.config.ts and drizzle/… → database migration scripts and metadata
• public/ → static assets (logos, images)
• src/app/ → Next.js App Router pages and API routes
• src/components/ → reusable UI, dashboard, analytics, calendar, and logo components
• src/hooks/, src/lib/ → shared hooks and utilities
• src/server/ → server‑side actions, authentication, and database schema/connection
• Architectural pattern:
• Next.js App Router (React components + server components)
• Edge‑deployed Serverless functions for APIs (NextAuth, hello endpoint)
• Drizzle ORM for migrations and database access
README insights
• Hosted on Cloudflare Pages (Edge network)
• Uses Cloudflare D1 (SQLite‑compatible) for data storage
• NextAuth.js with Google OAuth
• Tailwind CSS styling
Elements
• Clear labels for each component (e.g., “Next.js Edge Function”, “D1 Database”)
• Request flow: Browser → CDN → Edge function → Database → Edge function → Browser
• OAuth flow: Browser → Google → Edge function → Browser
• Green for server/edge functions
• Grey cloud for external OAuth
Detailed capture of essential architecture
• Do not over‑partition; use logical layers: UI, API, Data, External
• Drizzle migrations as part of deployment pipeline