Luxe Store is an enterprise-grade luxury e-commerce platform designed to deliver a premium shopping experience. Built with a focus on high performance, transaction security, and visual fidelity, it provides a robust foundation for modern digital storefronts handling exclusive inventory and high-value transactions.
Live Demo: https://luxestoreapp.vercel.app/
- Atomic Inventory Management: Utilizes database-level row locking and atomic Prisma transactions during checkout to guarantee stock integrity and prevent overselling of limited-edition items.
- Stripe Payment Integration: Implements a secure, two-phase payment architecture. Order creation is decoupled from payment confirmation via a custom Stripe webhook handler, which relies on cryptographic signature verification to update order statuses.
- API Protection: Protects critical endpoints, including the checkout pipeline, against brute-force and botnet attacks using sliding-window rate limiting powered by Upstash Redis.
- Cursor-Based Pagination: Optimizes database query performance and UI rendering for large datasets (e.g., admin order history) by replacing inefficient offset pagination with cursor-based fetching.
- Cloudinary Asset Optimization: Preserves the visual quality of luxury media without compromising load speeds by dynamically serving compressed, next-generation image formats (AVIF/WebP) via the Cloudinary CDN.
Frontend:
- Next.js (App Router)
- React
- Tailwind CSS
- Framer Motion
- next-cloudinary
Backend & Database:
- Node.js
- Prisma ORM
- PostgreSQL
Payments & Security:
- Stripe SDK
- @upstash/ratelimit
Caching & Storage:
- Upstash Redis
- Cloudinary
Installation:
npm install
npm install stripe @upstash/ratelimit @upstash/redis next-cloudinary @prisma/clientCreate a .env file in the root of your project and populate it with the following configuration:
DATABASE_URL="mysql://4VTxz33iSeBYA....cept=strict"
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="dge..rnc"
NEXT_PUBLIC_CLOUDINARY_API_KEY="195....481"
CLOUDINARY_API_SECRET="quHO-....VZyTWszg"
AUTH_SECRET="0/F+rC8zG2qa....xpTS3JpFUhaz+HRd4="
NEXT_PUBLIC_BASE_URL="https://luxestoreapp.vercel.app/"
# Gmail SMTP Configuration
EMAIL_SERVER_USER="[email protected]"
# This is NOT your normal login password.
# You must generate an "App Password" in your Google Account Security settings.
EMAIL_SERVER_PASSWORD="yjgfh....kgygagc"
EMAIL_FROM="LuxeStore <[email protected]>"
# Google Authentication
GOOGLE_CLIENT_ID="225888.......4ehiic32d9pmch8.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-Ge.....SceZLQ_5AS"
AUTH_TRUST_HOST=true
# Stripe Configuration
STRIPE_SECRET_KEY="sk_test_51Tb6Lj.......vurLNFmd007VG9pvhA"
STRIPE_WEBHOOK_SECRET="whsec_05b89c625c4b.......53b2fef6c40ca7b1"
# Upstash Redis
UPSTASH_REDIS_REST_URL="https://lib......5.upstash.io"
UPSTASH_REDIS_REST_TOKEN="gQAAAAAAAhTpA.......lmYjEyYw"-
Clone the repository:
git clone https://github.com/your-username/luxe-store.git cd luxe-store -
Install dependencies:
npm install
-
Configure Environment Variables: Copy the
.env.exampletemplate above into a new.envfile and fill in your specific credentials. -
Synchronize Database Schema: Push the Prisma schema to your local PostgreSQL database:
npx prisma db push
-
Start Stripe Webhook Listener (Required for local payment testing): In a separate terminal window, forward Stripe events to your local API route:
stripe listen --forward-to localhost:3000/api/webhooks/stripe
Note: Copy the
whsec_...secret provided by this command into your.envfile underSTRIPE_WEBHOOK_SECRET. -
Start Development Server:
npm run dev
The application will be available at
http://localhost:3000.
- Push your code to a GitHub/GitLab repository.
- Import the project into Vercel.
- In the Vercel project settings, add all the environment variables from your
.envfile.- Important: Ensure
NEXT_PUBLIC_BASE_URLis set to your production Vercel domain (e.g.,https://luxestoreapp.vercel.app).
- Important: Ensure
- Deploy the application.
- Navigate to the Webhooks section in your Stripe Dashboard.
- Click Add an endpoint.
- Set the endpoint URL to your production domain:
https://luxestoreapp.vercel.app/api/webhooks/stripe. - Select the
checkout.session.completedevent to listen for. - Click Add endpoint, reveal the production Signing Secret, and update your
STRIPE_WEBHOOK_SECRETenvironment variable in Vercel with this new value.