Canva clone with customizable templates and AI-powered features
!Canva clone with customizable templates and AI-powered features
:notebook_with_decorative_cover: Table of Contents
- Folder Structure
- Getting Started
- Screenshots
- Tech Stack
- Stats
- Contribute
- Acknowledgements
- Buy Me a Coffee
- Follow Me
- Learn More
- Deploy on Vercel
- Give A Star
- Star History
- Give A Star
:bangbang: Folder Structure
Here is the folder structure of this app.
canva-clone/
|- drizzle/
|-- meta/
|-- 0000_busy_scourge.sql
|-- 0001_cultured_beast.sql
|-- 0002_glossy_cloak.sql
|-- 0003_clumsy_chat.sql
|- public/
|- src/
|-- app/
|--- (auth)/
|--- (dashboard)/
|--- api/
|--- editor/
|--- apple-icon.png
|--- error.tsx
|--- favicon.ico
|--- globals.css
|--- icon1.png
|--- icon2.png
|--- layout.tsx
|--- not-found.tsx
|-- components/
|--- ui/
|--- hint.tsx
|--- modal-provider.tsx
|--- providers.tsx
|--- query-provider.tsx
|-- config/
|--- index.ts
|-- db/
|--- drizzle.ts
|--- schema.ts
|-- features/
|--- ai/
|--- auth/
|--- editor/
|--- images/
|--- projects/
|--- settings/
|--- subscriptions/
|-- hooks/
|--- use-confirm.tsx
|--- use-is-client.ts
|-- lib/
|--- encryption.ts
|--- hono.ts
|--- openai.ts
|--- stripe.ts
|--- unsplash.ts
|--- uploadthing.ts
|--- user-api-keys.ts
|--- utils.ts
|-- auth.config.ts
|-- auth.ts
|-- proxy.ts
|- .env.example
|- .env/.env.local
|- .gitignore
|- .prettierignore
|- .prettierrc.json
|- .prettierrc.mjs
|- components.json
|- drizzle.config.ts
|- environment.d.ts
|- eslint.config.mjs
|- next.config.ts
|- package.json
|- pnpm-lock.yaml
|- pnpm-workspace.yaml
|- postcss.config.mjs
|- tsconfig.json
|- vercel.ts
:toolbox: Getting Started
- Make sure Git and NodeJS is installed.
- Clone this repository to your local computer.
- Create
.env.localfile in root directory. - Contents of
.env.local:
# disable next.js telemetry
NEXT_TELEMETRY_DISABLED=1
app base url
NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000
unsplash api access key
UNSPLASH_ACCESS_KEY=x-X-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uploadthing token
UPLOADTHING_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
encrypted AI settings cookie (openssl rand -hex 32)
AI_SETTINGS_COOKIE_NAME="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
VERIFICATION_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Added by npx auth. Read more: https://cli.authjs.dev
AUTH_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
github oauth id and secret
AUTH_GITHUB_ID=XXXXXXXXXXXXXXXX
AUTH_GITHUB_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AUTH_GOOGLE_ID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
AUTH_GOOGLE_SECRET="XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
postgres neon db url
DATABASE_URL="postgresql://<username>:<password>@<hostname>:<port>/image-ai?sslmode=require"
stripe secret key and price id and webhook secret
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_PRICE_ID=price_XXXXXXXXXXXXXXXXX
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5. Disable Next.js Telemetry
This disables Next.js telemetry (optional).
- Variable:
NEXT_TELEMETRY_DISABLED - Value:
1(default for disabling telemetry)
6. App Base URL
Set the base URL where your app will be running locally or in production.
7. Unsplash API Access Key
To get the Unsplash API Access Key, follow these steps:
- Go to Unsplash Developers.
- Log in with your Unsplash account.
- Create a new application under "Your Applications."
- Copy the Access Key from the application details.
8. UploadThing Token
To get the UploadThing token:
- Visit UploadThing and sign up.
- Create a new project which will generate an API token.
- Copy the token.
9. AI Settings Cookie Secrets
Generate both values with:
openssl rand -hex 32
AI_SETTINGS_COOKIE_NAME: Cookie name used to store encrypted API keys.VERIFICATION_SECRET: Secret used to encrypt/decrypt the cookie payload. Keep this secret safe.
10. Auth.js Secret
This is automatically generated by npx auth or pnpm dlx auth and used for session encryption. Keep this secret safe.
11. GitHub OAuth Client ID and Secret
To obtain GitHub OAuth credentials:
- Go to GitHub Developer Settings.
- Create a new OAuth app:
http://localhost:3000).
- Authorization callback URL: http://localhost:3000/api/auth/callback/github.
- After creation, you'll get Client ID and Client Secret.
12. Google OAuth Client ID and Secret
To obtain Google OAuth credentials:
- Visit the Google Cloud Console.
- Create a new project and configure OAuth consent screen with default settings.
- Create OAuth 2.0 credentials:
http://localhost:3000/api/auth/callback/google.
- After creation, you'll receive a Client ID and Client Secret.
13. PostgreSQL Neon Database URL
To get the Neon PostgreSQL database URL:
- Sign up at Neon.
- Create a new database and retrieve the connection URL.
, , , in the URL.
- Ensure SSL mode is enabled (
sslmode=require).
14. Stripe API Keys
To get the Stripe API keys:
- Sign up at Stripe.
- Create a new account or use an existing one.
- Go to Developers → API keys to get your Secret Key.
- To create a Price ID, navigate to Products → Create a Product and set a price.
- For Webhook Secret, set up a webhook in Developers → Webhooks:
http://localhost:3000/api/subscriptions/webhook.
- Install Project Dependencies using
npm install --legacy-peer-depsoryarn install --legacy-peer-depsorpnpm install --legacy-peer-deps.
- Now app is fully configured 👍 and you can start using this app using either one of
npm run devoryarn devorpnpm dev.
:raising_hand: Need Help?
If you run into issues during installation or setup:
- GitHub Discussions — Open a Q&A discussion for setup and troubleshooting help.
- Email — [email protected]
- Discord —
@sanidhyy
:camera: Screenshots
!Fully functional Fabric.js editor
!Unsplash Images and Custom Upload Support
:gear: Tech Stack
:wrench: Stats
:raised_hands: Contribute
You might encounter some bugs while using this app. You are more than welcome to contribute. Just submit changes via pull request and I will review them before merging. Make sure you follow community guidelines.
:gem: Acknowledgements
Useful resources and dependencies that are used in Canva Clone.
- Thanks to CodeWithAntonio: https://codewithantonio.com/
- @auth/core: ^0.41.3
- @auth/drizzle-adapter: ^1.11.3
- @babel/eslint-parser: ^8.0.6
- @hono/auth-js: ^1.0.11
- @hono/zod-validator: ^0.9.1
- @imgly/background-removal: ^1.7.0
- @neondatabase/serverless: ^1.0.2
- @paralleldrive/cuid2: ^3.3.0
- @radix-ui/react-alert-dialog: ^1.1.15
- @radix-ui/react-avatar: ^1.1.11
- @radix-ui/react-dialog: ^1.1.15
- @radix-ui/react-dropdown-menu: ^2.1.16
- @radix-ui/react-label: ^2.1.8
- @radix-ui/react-scroll-area: ^1.2.10
- @radix-ui/react-separator: ^1.1.8
- @radix-ui/react-slider: ^1.3.6
- @radix-ui/react-slot: ^1.2.4
- @radix-ui/react-tooltip: ^1.2.8
- @radix-ui/react-visually-hidden: ^1.2.4
- @tailwindcss/postcss: ^4.3.3
- @tanstack/react-query: ^5.103.1
- @trivago/prettier-plugin-sort-imports: ^6.0.0
- @types/lodash.debounce: ^4.0.9
- @types/material-colors: ^1.2.3
- @types/node: ^26.5.1
- @types/react: ^19.3.0
- @types/react-color: ^3.0.13
- @types/react-dom: ^19.3.0
- @uploadthing/react: ^7.0.3
- @vercel/config: ^0.7.1
- bcryptjs: ^3.0.3
- class-variance-authority: ^0.7.1
- clsx: ^2.1.1
- date-fns: ^4.1.0
- dotenv: ^18.0.1
- drizzle-kit: ^0.31.0
- drizzle-orm: ^0.45.0
- drizzle-zod: ^0.8.3
- eslint: ^10
- eslint-config-next: 16.3.5
- eslint-config-prettier: ^10.0.1
- eslint-plugin-prettier: ^5.2.1
- fabric: 7.4.0
- hono: ^4.13.7
- lodash.debounce: ^4.0.8
- lucide-react: ^1.45.0
- material-colors: ^1.2.6
- next: 16.3.4
- next-auth: ^5.0.0-beta.32
- next-themes: ^0.4.6
- onnxruntime-web: 1.29.0
- openai: ^7.15.0
- pg: ^8.18.0
- postcss: ^8
- prettier: ^3.9.9
- prettier-plugin-tailwindcss: ^0.8.1
- react: ^19.3.0
- react-color: ^2.19.3
- react-dom: ^19.3.0
- react-icons: ^5.5.0
- react-use: ^17.6.0
- server-only: ^0.0.1
- sonner: ^2.0.7
- stripe: 22.6.2
- tailwind-merge: ^3.7.0
- tailwindcss: ^4.3.3
- tw-animate-css: ^1.4.0
- typescript: ^6.0.2
- unsplash-js: ^8.0.0
- uploadthing: ^7.1.0
- use-file-picker: ^2.1.4
- zod: ^4.6.5
- zustand: ^5.0.11
:coffee: Buy Me a Coffee
:rocket: Follow Me
:books: Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
:page_with_curl: Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out Next.js deployment documentation for more details.
:star: Give A Star
You can also give this repository a star to show more people and they can use this repository.
:star2: Star History