Skip to content

SatvikPraveen/Nextjs-Ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Next.js E-Commerce Platform πŸ›οΈ

Next.js TypeScript Prisma License: MIT

πŸŽ“ 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.

✨ What's Inside

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

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • PostgreSQL 15+
  • npm or yarn

Installation

# 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 dev

Open http://localhost:3000 to see the app.

Essential Environment Variables

# 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.

πŸ“ Project Structure

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

πŸ› οΈ Scripts

# 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

πŸ“š Documentation

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

🎯 Recent Updates

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

πŸ” Authentication

Supported providers:

  • Email/Password
  • Google OAuth
  • GitHub OAuth
  • Discord OAuth

Role-based access control for admin features.

πŸ’³ Payments

Stripe integration configured for:

  • Checkout sessions
  • Payment webhooks
  • Order fulfillment
  • Multi-currency support

🐳 Deployment

Vercel (Recommended)

# Connect your GitHub repo to Vercel
# Add environment variables in dashboard
# Deploy automatically on push

Docker

docker-compose up -d

Or build manually:

docker build -t nextjs-ecommerce .
docker run -p 3000:3000 -e DATABASE_URL="..." nextjs-ecommerce

🀝 Contributing

Contributions welcome! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

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.

About

Demo e-commerce platform built with Next.js 15, TypeScript, and Prisma. Features admin dashboard, Stripe payments, newsletter subscriptions, Docker deployment, and comprehensive testing. Educational resource for modern Next.js development patterns.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors