🛠️ Project Structure

App Router refrence

next app router

photo by nextjs.org

Follow these steps to set up the project:

  • Steps to Set Up .env FileCreate the .env File: If you don't already have an .env file, create one at the root of your project
  • Define Environment Variables: Inside the .env file, define the following environment variables:
    Code
    1 MONGODB_URI = 
    2 NEXTAUTH_URL= 
    3 NEXTAUTH_SECRET= 
    4 SENDGRID_API_KEY=
    5 STRIPE_SECRET_KEY =
    6 NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY =
    7 EMAIL_SERVER=
    8 EMAIL_FROM=
    • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: Your Stripe publishable key. You can find this in your Stripe dashboard.
    • STRIPE_SECRET_KEY: Your Stripe secret key.
    • MONGODB_URI: The connection URI for your MongoDB database.
    • NEXTAUTH_SECRET: it is 32bit encrypted key
    • NEXTAUTH_URL: set the NEXTAUTH_URL environment variable to the canonical URL of your site
That's it! You've successfully set up environment variables for your Next.js application. 🚀