π Demo & Learning Project
A full-stack e-commerce platform built to demonstrate modern Next.js development patterns with TypeScript, Prisma, and PostgreSQL. Not intended for production use.
Core Features
- ποΈ Product catalog with search, filtering & categories
- π Shopping cart with persistent storage
- π§ Newsletter subscription with validation
- π¨ Custom 404 page with demo messaging
- π€ User authentication with NextAuth.js
- π³ Stripe payment integration (configured)
- π Admin dashboard for product & order management
Tech Stack
- Frontend: Next.js 15.5.6 | React 18 | TypeScript 5.9 | Tailwind CSS | shadcn/ui
- Backend: Server Components | Server Actions | API Routes
- Database: PostgreSQL 15 | Prisma 5.22 ORM
- Testing: Jest | React Testing Library | Cypress
Current Status (March 2026)
- β All TypeScript checks passing
- β All ESLint checks passing
- β 149/149 tests passing (100%)
- β Newsletter feature fully functional
- β Local SVG product images
- β Database migrations applied
- Node.js 20+
- PostgreSQL 15+
- npm or yarn
# Clone the repository
git clone https://github.com/SatvikPraveen/Nextjs-Ecommerce.git
cd Nextjs-Ecommerce
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your database URL and API keys
# Set up database
npx prisma db push
npm run db:seed
# Start development server
npm run devOpen http://localhost:3000 to see the app.
# Database (Required)
DATABASE_URL="postgresql://user:password@localhost:5432/ecommerce"
# NextAuth (Required)
NEXTAUTH_SECRET="your-secret-here"
NEXTAUTH_URL="http://localhost:3000"
# Stripe (Optional - for payments)
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."See .env.example for complete configuration.
app/
βββ (store)/ # Customer-facing pages
β βββ products/ # Product catalog
β βββ cart/ # Shopping cart
β βββ search/ # Search results
βββ (account)/ # User account pages
βββ admin/ # Admin dashboard
βββ api/ # API routes
β βββ newsletter/ # Newsletter subscription
β βββ stripe/ # Payment webhooks
β βββ auth/ # Authentication
βββ not-found.tsx # Custom 404 page
components/
βββ ui/ # shadcn/ui components
βββ newsletter-form.tsx
βββ product-card.tsx
βββ cart-drawer.tsx
server/
βββ actions/ # Server actions
βββ queries/ # Database queries
prisma/
βββ schema.prisma # Database schema
βββ seed.ts # Sample data
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run start # Start production server
# Database
npm run db:push # Push schema changes
npm run db:seed # Seed with sample data
npm run db:studio # Open Prisma Studio
# Code Quality
npm run lint # Run ESLint
npm run type-check # TypeScript type check
npm run format # Format with Prettier
# Testing
npm run test # Run all tests
npm run test:e2e # Run Cypress tests| Guide | Description |
|---|---|
| Quick Start | Get running in 5 minutes |
| Dev Setup | Complete development environment setup |
| Installation | Automated environment setup script |
| Contributing | How to contribute |
| Cheat Sheet | Quick command reference |
| Project Structure | Detailed code organization |
| Roadmap | Future plans |
| Docs Index | Complete documentation index |
March 2026
- β Newsletter subscription system with database persistence
- β Custom 404 page for demo project
- β 14 local SVG product & category images
- β Fixed client component directives
- β Repository documentation reorganized
- β Footer updated to 2026
December 2025
- β Next.js 15.5.6 upgrade
- β TypeScript strict mode - 0 errors
- β All tests passing (149/149)
- β npm audit: 0 vulnerabilities
- β Prettier formatting applied
Supported providers:
- Email/Password
- Google OAuth
- GitHub OAuth
- Discord OAuth
Role-based access control for admin features.
Stripe integration configured for:
- Checkout sessions
- Payment webhooks
- Order fulfillment
- Multi-currency support
Vercel (Recommended)
# Connect your GitHub repo to Vercel
# Add environment variables in dashboard
# Deploy automatically on pushDocker
docker-compose up -dOr build manually:
docker build -t nextjs-ecommerce .
docker run -p 3000:3000 -e DATABASE_URL="..." nextjs-ecommerceContributions welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
Note: This is a demonstration project for learning purposes. For production use, additional security hardening, comprehensive testing, and infrastructure setup would be required.