YASHSTORE is a full-stack modern e-commerce platform built with Next.js App Router, Prisma, PostgreSQL, NextAuth, and Stripe.
It provides a complete shopping flow: authentication, product catalog, cart, checkout, order creation, and an admin dashboard for store management.
- Website: YASHSTORE - E-Commerce
- Showcase Video: Watch on YouTube
YASHSTORE/
β
βββ app/
β βββ (auth)/ β Login/Register pages
β βββ (pages)/ β Storefront pages (products, cart, checkout, orders)
β βββ (admin)/dashboard/ β Admin panel (products, categories, users, orders)
β βββ api/
β β βββ auth/[...nextauth]/ β NextAuth handlers
β β βββ create-payment-intent/
β β βββ webhook/ β Stripe webhook event handling
β βββ payment-success/ β Payment confirmation page
β βββ layout.tsx β Global layout + analytics + navbar
β βββ globals.css β Global Tailwind styles/utilities
β
βββ actions/ β Server Actions (auth, products, cart, order status)
βββ components/ β Reusable UI components (store + admin)
βββ lib/
β βββ db.ts β Prisma client singleton
β βββ utils.ts β Utility helpers
βββ prisma/
β βββ schema.prisma β DB models (User, Product, Cart, Order, etc.)
β βββ migrations/
βββ auth.ts β NextAuth v5 config (Credentials + Google)
βββ middleware.ts β Middleware entry (currently empty)
βββ next.config.mjs β Next.js config + image domains
βββ tailwind.config.ts β Tailwind theme and custom animations
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- UI: React 18
- Styling: Tailwind CSS
- ORM: Prisma
- Database: PostgreSQL
- Authentication: NextAuth.js v5 (beta)
- Credentials login
- Google OAuth login
- Role-based authorization (
ADMIN/USER)
- Payment Processor: Stripe
- Payment intents from API route
- Webhook verification and order creation
- react-hot-toast for notifications
- Lucide React for icons
- GSAP (included)
- Vercel Analytics + Speed Insights
- Register with name, email, phone, and password
- Login with credentials
- Google sign-in support
- Session-based auth via NextAuth
- Role-aware UI/route behavior for
ADMINandUSER
- Home page with hero and new products section
- Product listing with:
- Search by name
- Category filters (mobile + desktop variants)
- Product detail page with image carousel
- Add/remove items from cart
- Stripe Payment Element checkout flow
- Server-side payment intent creation
- Stripe webhook handling for successful payments
- Automatic order creation and cart cleanup after payment
- User order history and single-order detail page
- Dashboard overview (users, products, orders, categories)
- Product management:
- Create product
- Edit product
- Delete product
- Category management with category detail view
- User listing and search
- Order listing/search and per-order status update
Main entities:
UserProductCategoryCartOrderWishlistReview
Also includes enums:
Role:ADMIN,USERStatus:PENDING,PROCESSING,DELIVERING,SHIPPED,COMPLETED,CANCELLED,REFUNDED
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/auth/[...nextauth] |
NextAuth route handler |
| POST | /api/auth/[...nextauth] |
NextAuth route handler |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/create-payment-intent |
Creates Stripe PaymentIntent and returns secret |
| POST | /api/webhook |
Handles Stripe webhook events |
Create a .env (or .env.local) file in the project root.
# Prisma / PostgreSQL
POSTGRES_PRISMA_URL="postgresql://..."
POSTGRES_URL_NON_POOLING="postgresql://..."
# NextAuth (Google)
clientId="your_google_client_id"
clientSecret="your_google_client_secret"
# Stripe
NEXT_PUBLIC_STRIPE_PUBLIC_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."Note: Variable names
clientIdandclientSecretare used as-is in the current code.
- Node.js 18+
- npm
- PostgreSQL database
- Stripe account (test mode is fine)
-
Clone the repository
git clone <your-repo-url> cd YASHSTORE
-
Install dependencies
npm install
-
Configure environment variables
- Create
.envor.env.local - Add all required variables from the section above
- Create
-
Run Prisma migration and generate client
npx prisma migrate dev npx prisma generate
-
Start development server
npm run dev
-
Open app
npm run dev # Start development server
npm run build # Production build
npm start # Start production server
npm run lint # Run Next.js lintingRecommended stack:
- App: Vercel
- Database: Neon / Supabase / Railway PostgreSQL
- Payments: Stripe
Deployment checklist:
- Add all environment variables in hosting provider
- Run Prisma migrations in production database
- Configure Stripe webhook endpoint to:
https://your-domain.com/api/webhook
- Verify Google OAuth callback URL setup in Google Cloud Console
- Passwords are hashed with
bcryptjs - Stripe webhook signature is verified before processing
- Admin routes are protected by role checks in dashboard layout
- Session tokens include user role for authorization decisions
- Add unit/integration tests
- Complete middleware-based route protection
- Add inventory/stock management
- Improve checkout address handling
- Add wishlist/reviews UI (models already exist)
Built by YASHDEV42.
YASHSTORE β a modern full-stack e-commerce experience. β¨