sdley-e-shop is an online electronic e-shop.
- Next.js 15: React framework for server-side rendering and static site generation.
- TypeScript: Enhances JavaScript with static typing for better code reliability.
- Tailwind CSS: Utility-first CSS framework for fast and responsive UI design.
- MongoDB: NoSQL database for scalable and flexible data storage.
- Stripe: Secure payment processing integration.
- Prisma: ORM for efficient database management and queries.
- moment.js: Library for date formatting and manipulation.
- React Hot Toast: Lightweight notifications for better user feedback.
- v6.exchangerate-api.com: API for real-time currency exchange rates.
🚀 Goal: Performance, scalability, and a seamless user experience.
git clone https://github.com/your-repo.git
cd your-reponpm installCreate a .env.local file at the root of the project and configure the following variables:
# MongoDB Atlas
DATABASE_URL="mongodb+srv://<username>:<password>@cluster.mongodb.net/<database>?retryWrites=true&w=majority"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="<your-secret-key>"
# Google OAuth 2.0
GOOGLE_CLIENT_ID="<your-google-client-id>"
GOOGLE_CLIENT_SECRET="<your-google-client-secret>"
# Stripe API Keys
STRIPE_PUBLIC_KEY="<your-stripe-public-key>"
STRIPE_SECRET_KEY="<your-stripe-secret-key>"- Go to MongoDB Atlas and create an account.
- Create a new cluster and database.
- Navigate to Database Access and create a user with read and write permissions.
- Under Network Access, allow your IP address (
0.0.0.0/0for testing). - Copy the connection string and update
DATABASE_URLin.env.local.
- Go to Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services > Credentials.
- Click Create Credentials > OAuth Client ID.
- Configure the OAuth consent screen:
- Add your app name and authorized domains.
- Set Application Type to "Web application."
- Add Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Copy the Client ID and Client Secret and update them in
.env.local.
npx prisma generate
npx prisma db pushnpm run devOpen http://localhost:3000 in your browser.
🚀 Your application is now ready to use!
- Copyright sdley 2024
- https://sdley.github.io/