GithubHelp home page GithubHelp logo

sanidhyy / casecobra Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 15.17 MB

Create custom high-quality phone cases in seconds.

Home Page: https://app-casecobra.vercel.app

License: MIT License

TypeScript 93.90% JavaScript 0.27% CSS 5.82%
css ecommerce headless-ui html js kinde kinde-auth neondb nextjs prisma react reactjs shadcn-ui tanstack-react-query typescript phonecase

casecobra's Introduction

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="[email protected]"

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

# admin email
ADMIN_EMAIL="[email protected]"

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="[email protected]"

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="[email protected]"
  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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.