How sanidhyy/canva-clone works
Project type and purpose
• This is a full-stack, single-monorepo web application built on Next.js (App Router) with React/TypeScript on the front end, Next.js API routes on the back end, Drizzle ORM + PostgreSQL for data persistence, and several external services (AI via Replicate, image storage via UploadThing, Unsplash for photos, Stripe for billing, OAuth via GitHub/Google).
• The app is a “Canva clone” featuring customizable templates, a Fabric.js-based editor, AI-powered image generation/removal, user authentication, project management, and subscription billing.
File structure
• Top-level config and scripts (.env, next.config.mjs, drizzle.config.ts, postcss.config.mjs, tailwind.config.ts, tsconfig.json).
• drizzle/ folder contains SQL migration scripts and snapshots (Drizzle ORM migrations).
• public/ holds static assets and JSON template definitions.
• src/app/ contains Next.js App Router routes:
• (auth) and (dashboard) layouts and pages for routing between sign-in/up and the dashboard.
• editor/[projectId] for the editing canvas.
• api/ for all Next.js serverless endpoints ([[...route]], auth, uploadthing).
• Global error, not-found, CSS, layout, etc.
• src/components/ UI atoms/molecules and providers (Auth, React Query).
• src/features/ domain modules:
• ai/, auth/, editor/, images/, projects/, subscriptions/.
• src/lib/ wrappers for external services (hono server, replicate, stripe, unsplash, uploadthing).
• src/db/ and drizzle config/schema for ORM.
• auth.* and middleware.ts for NextAuth/Hono integration.
README for additional insights
• Clearly calls out Tech Stack: React, Next.js, TypeScript, PostgreSQL, Tailwind, Vercel.
• Describes features: Fabric.js editor, AI integration, templates, file upload, OAuth, billing.
• Lists environment variables for external services.