Skip to content

sanidhyy/casecobra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

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

Repository files navigation

CaseCobra - Custom high-quality phones cases

CaseCobra - Custom high-quality phones cases

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.

casecobra/
  |- app/
    |-- api/
        |--- auth/[kindeAuth]/
        |--- uploadthing/
        |--- webhooks/stripe/
    |-- auth-callback/
    |-- configure/
    |-- dashboard/
    |-- thank-you/
    |-- apple-icon.png
    |-- error.tsx
    |-- favicon.ico
    |-- globals.css
    |-- icon1.png
    |-- icon2.png
    |-- layout.tsx
    |-- loading.tsx
    |-- not-found.tsx
    |-- page.tsx
  |- components/
    |-- emails/
    |-- modals/
    |-- ui/
    |-- footer.tsx
    |-- handle-component.tsx
    |-- icons.tsx
    |-- loader.tsx
    |-- max-width-wrapper.tsx
    |-- navbar.tsx
    |-- phone-preview.tsx
    |-- phone.tsx
    |-- providers.tsx
    |-- reviews.tsx
    |-- steps.tsx
  |- config/
    |-- index.ts
    |-- products.ts
  |- db/
    |-- index.ts
  |- lib/
    |-- stripe.ts
    |-- uploadthing.ts
    |-- utils.ts
  |- prisma/
    |-- schema.prisma
  |- public/
  |- validators/
    |-- option-validator.ts
  |- .env
  |- .env.example
  |- .eslintrc.json
  |- .gitignore
  |- .prettierrc.json
  |- bun.lockb
  |- components.json
  |- environment.d.ts
  |- next.config.mjs
  |- package.json
  |- postcss.config.js
  |- 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 file in root directory.
  4. Contents of .env:
# .env

# disabled next.js telemetry
NEXT_TELEMETRY_DISABLED=1

# kinde client id and secret
KINDE_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
KINDE_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# kinde issuer and callback url
KINDE_ISSUER_URL=https://exampleapp.kinde.com
KINDE_SITE_URL=http://localhost:3000
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:3000
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:3000/auth-callback

# uploadthing app id and secret
UPLOADTHING_APP_ID=xxxxxxxxxxxx
UPLOADTHING_SECRET=sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# neon db uri
DATABASE_URL="postgresql://<user>:<password>@<host>:<port>/casecobra?sslmode=require"

# stripe key and webhook
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# resend api key and sender email
RESEND_API_KEY=re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
RESEND_SENDER_EMAIL="your.email@example.com"

# app base url
NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000

# admin email
ADMIN_EMAIL="admin.email@example.com"

5. Disable Next.js Telemetry

To disable Next.js telemetry, add the following line to your .env file:

NEXT_TELEMETRY_DISABLED=1

6. Kinde Client ID and Secret

  1. Visit the Kinde website and log in to your account.
  2. Navigate to the "Applications" section and create a new application if you haven't already.
  3. After creating the application, you will find the Client ID and Client Secret in the application settings.
  4. Copy these values and add them to your .env file:
KINDE_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
KINDE_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

7. Kinde Issuer and Callback URL

  1. In the same Kinde application settings, locate the Issuer URL and configure the callback URLs.
  2. Set the callback URLs to match your local development setup:
    • Post Login Redirect URL: http://localhost:3000/auth-callback
    • Post Logout Redirect URL: http://localhost:3000
  3. Add these values to your .env file:
KINDE_ISSUER_URL=https://exampleapp.kinde.com
KINDE_SITE_URL=http://localhost:3000
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:3000
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:3000/auth-callback

8. UploadThing App ID and Secret

  1. Visit the UploadThing website and log in to your account.
  2. Navigate to the "API Keys" section and create a new API key.
  3. Copy the App ID and Secret values.
  4. Add these values to your .env file:
UPLOADTHING_APP_ID=xxxxxxxxxxxx
UPLOADTHING_SECRET=sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

9. Neon DB URI

  1. Visit the Neon website and log in to your account.
  2. Navigate to the "Databases" section and create a new PostgreSQL database if you haven't already.
  3. Obtain the connection URI from the database settings.
  4. Replace <user>, <password>, <host>, and <port> with your database credentials and add the value to your .env file:
DATABASE_URL="postgresql://<user>:<password>@<host>:<port>/casecobra?sslmode=require"

10. Stripe Key and Webhook

  1. Visit the Stripe website and log in to your account.
  2. Navigate to the "Developers" section and click on "API keys".
  3. Copy the Secret Key and add it to your .env file:
  4. Navigate to "Webhook" settings, create a new webhook, and copy the Webhook Secret:
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

11. Resend API Key and Sender Email

  1. Visit the Resend website and log in to your account.
  2. Navigate to the "API Keys" section and generate a new API key.
  3. Copy the API Key and add it to your .env file.
  4. Set your sender email address:
RESEND_API_KEY=re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
RESEND_SENDER_EMAIL="your.email@example.com"

12. Application Base URL

Set the base URL for your application to match your local development environment:

NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000

13. Admin Email

Set the admin email address:

ADMIN_EMAIL="admin.email@example.com"
  1. Now app is fully configured πŸ‘ and you can start using this app using either one of npm run dev or yarn dev.

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

πŸ“· Screenshots

Modern ui/ux

Customize your case

Thank you page

Order confirmation mail

βš™οΈ Tech Stack

React JS Next JS Typescript Tailwind CSS Vercel Postgresql Prisma

πŸ”§ Stats

Stats for CaseCobra

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

❀️ Sponsor Me

πŸš€ 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)