Skip to content

Canva clone with customizable templates and AI-powered features for effortless visual creation.

License

Notifications You must be signed in to change notification settings

sanidhyy/canva-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Canva clone with customizable templates and AI-powered features

Canva clone with customizable templates and AI-powered features

Ask Me Anything! GitHub license Maintenance GitHub branches Github commits GitHub issues GitHub pull requests Vercel status

πŸ“” Table of Contents

‼️ Folder Structure

Here is the folder structure of this app.

canva-clone/
  |- drizzle/
  |- public/
    |-- bg.svg
    |-- car_sale.json
    |-- car_sale.png
    |-- coming_soon.json
    |-- coming_soon.png
    |-- flash_sale.json
    |-- flash_sale.png
    |-- logo.svg
    |-- travel.json
    |-- travel.png
  |- src/
    |-- app/
        |--- (auth)/
        |--- (dashboard)/
        |--- api/
            |---- api/[[...route]]/
            |---- auth/
            |---- uploadthing/
        |--- editor/[projectId]/
        |--- 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/
        |--- drizzle.ts
        |--- schema.ts
    |-- db/
        |--- index.ts
    |-- features/
        |--- ai/
        |--- auth/
        |--- editor/
        |--- images/
        |--- projects/
        |--- subscriptions/
    |-- hooks/
        |--- use-confirm.tsx
    |-- lib/
        |--- hono.ts
        |--- replicate.ts
        |--- stripe.ts
        |--- unsplash.ts
        |--- uploadthing.ts
        |--- utils.ts
    |-- auth.config.ts
    |-- auth.ts
    |-- middleware.ts
  |- .env.example
  |- .env.local
  |- .eslintrc.json
  |- .gitignore
  |- .prettierrc.json
  |- .prettierrc.mjs
  |- bun.lockb
  |- components.json
  |- drizzle.config.ts
  |- environment.d.ts
  |- next.config.mjs
  |- package.json
  |- postcss.config.js
  |- README.md
  |- tailwind.config.ts
  |- tsconfig.json

🧰 Getting Started

  1. Make sure Git and NodeJS is installed.
  2. Clone this repository to your local computer.
  3. Create .env.local file in root directory.
  4. 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
NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=x-X-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# uploadthing token
UPLOADTHING_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

# replicate api token
REPLICATE_API_TOKEN=r8_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# 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. Replicate API Token

To get the Replicate API token:

  • Sign up at Replicate.
  • Go to your account settings and find the API section.
  • Copy the API token.

10. Auth.js Secret

This is automatically generated by npx auth or bunx 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:
    • Homepage URL: Your app's base URL (e.g., 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:
    • Authorized redirect URIs: 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.
    • Replace <username>, <password>, <hostname>, <port> 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:
    • Endpoint: http://localhost:3000/api/subscriptions/webhook.
  1. Install Project Dependencies using npm install --legacy-peer-deps or yarn install --legacy-peer-deps or bun install --legacy-peer-deps.

  2. Now app is fully configured πŸ‘ and you can start using this app using either one of npm run dev or yarn dev or bun dev.

NOTE: Please make sure to keep your API keys and configuration values secure and do not expose them publicly.

πŸ“· Screenshots

Modern UI/UX

Fully functional Fabric.js editor

Multi Template Feature

Unsplash Images and Custom Upload Support

βš™οΈ Tech Stack

React JS Next JS Typescript PostgreSQL Tailwind CSS Vercel

πŸ”§ Stats

Stats for Canva Clone

πŸ™Œ 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.

πŸ’Ž Acknowledgements

Useful resources and dependencies that are used in Canva Clone.

β˜• Buy Me a Coffee

πŸš€ Follow Me

Follow Me Tweet about this project Subscribe to my YouTube Channel

πŸ“š Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

πŸ“ƒ 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.

⭐ Give A Star

You can also give this repository a star to show more people and they can use this repository.

🌟 Star History

Star History Chart

(back to top)