Skip to content

emreyn1/e-com

Repository files navigation

πŸ›οΈ MiniShop - Modern E-Commerce Platform

πŸ›οΈ MiniShop - Modern E-Commerce Platform

A sleek e-commerce platform showcasing modern web technologies with seamless shopping experience and secure payments

GitHub stars GitHub forks GitHub watchers

Next.js React TypeScript Tailwind CSS Stripe License

Features β€’ Demo β€’ Tech Stack β€’ Screenshots β€’ Getting Started

⭐ Star this repo if you find it useful!


πŸ“Έ Screenshots

Homepage

Homepage Modern hero section with premium tech products and seamless shopping experience


✨ Features

πŸ›οΈ Product Discovery

  • Premium Product Catalog: Curated selection of high-end tech products (Audio, Wearables, Accessories, Monitors)
  • Advanced Search: Real-time product search with instant results
  • Smart Filtering: Category-based filtering with smooth animations
  • Product Showcase: Beautiful product cards with hover effects and image optimization
  • Responsive Grid: Adaptive layout that works perfectly on all devices

πŸ›’ Intelligent Shopping Cart

  • Persistent Cart: Smart localStorage implementation keeps your cart across sessions
  • Quantity Management: Intuitive plus/minus controls with real-time updates
  • Dynamic Pricing: Live total calculation with shipping information
  • Cart Persistence: Never lose your items - cart survives browser refreshes
  • Empty State Design: Helpful guidance when cart is empty

πŸ’³ Secure Payment Processing

  • Stripe Integration: Enterprise-grade payment processing with Stripe Checkout
  • Secure Checkout: PCI-compliant payment flow with fraud protection
  • Payment Status: Real-time feedback for successful and canceled payments
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Checkout Recovery: Smart handling of payment interruptions

🎨 Modern User Experience

  • Dark/Light Mode: Seamless theme switching with preference persistence
  • Glassmorphism Design: Modern frosted glass effects and gradient backgrounds
  • Smooth Animations: Polished transitions and micro-interactions
  • Mobile-First: Optimized experience across all screen sizes
  • Accessibility: WCAG-compliant design with keyboard navigation

⚑ Performance & Security

  • Next.js 15: Latest App Router with React Server Components
  • Optimized Images: Automatic image optimization and lazy loading
  • Type Safety: Full TypeScript coverage with strict type checking
  • Modern Stack: React 19 with concurrent features and automatic batching
  • Security First: Secure payment handling and input validation

πŸ› οΈ Tech Stack


🌐 Demo

Live Demo: Visit MiniShop

Note: Make sure to set up Stripe environment variables for the payment functionality to work properly.


πŸ—οΈ Architecture Overview

This application is built with a modern, scalable architecture:

  • Frontend: Next.js 15 with App Router, React 19 Server Components, TypeScript
  • Backend: Next.js API Routes (serverless functions)
  • Payment: Stripe Checkout integration with webhook support
  • State Management: React Context with localStorage persistence
  • Styling: Tailwind CSS with custom design system and dark mode
  • Deployment: Optimized for Vercel with automatic scaling

πŸš€ Getting Started

Prerequisites

Make sure you have the following installed:

  • Node.js 18.x or higher (Download)
  • npm 10.x or higher (comes with Node.js)
  • Git (Download)

Installation

  1. Clone the repository
git clone https://github.com/emreyn1/minishop.git
cd minishop
  1. Install dependencies
npm install
  1. Set up environment variables

Create a .env.local file in the root directory:

# Stripe Configuration
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key_here
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key_here

# Optional: For production deployment
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
  1. Set up Stripe
  • Create a Stripe account
  • Get your test API keys from the Stripe Dashboard
  • Add them to your .env.local file
  1. Run the development server
npm run dev

Open http://localhost:3000 in your browser to view the application.

Environment Variables Setup

For detailed instructions on setting up Stripe:


🎯 How to Use

Getting Started

  1. Browse Products: Explore our curated selection of premium tech products
  2. Search & Filter: Use the search bar or category filters to find specific items
  3. Add to Cart: Click "Add to Cart" on any product to start shopping
  4. Manage Cart: View, update quantities, or remove items from your cart
  5. Checkout: Secure payment processing with Stripe Checkout
  6. Confirmation: Receive instant payment confirmation

Key Features

  • Product Discovery: Browse by categories (Audio, Wearables, Accessories, Monitors)
  • Smart Search: Find products instantly with real-time search
  • Cart Management: Add, remove, and update quantities with visual feedback
  • Secure Payments: Stripe-powered checkout with multiple payment methods
  • Theme Switching: Toggle between light and dark modes
  • Mobile Shopping: Optimized experience on all devices

πŸš€ Performance

  • Fast Loading: Optimized bundle size with code splitting and lazy loading
  • Server Components: React Server Components for better performance
  • Image Optimization: Automatic image optimization and WebP conversion
  • Caching Strategy: Intelligent caching for improved user experience
  • Type Safety: Full TypeScript support for reliability
  • Error Boundaries: Comprehensive error handling and recovery

πŸ”’ Security Features

  • βœ… Stripe PCI Compliance: Enterprise-grade payment security
  • βœ… Input Validation: Form validation and sanitization
  • βœ… Error Handling: Comprehensive error handling with user-friendly messages
  • βœ… Type Safety: Full TypeScript support for secure development
  • βœ… Environment Variables: Secure handling of sensitive payment data
  • βœ… HTTPS Only: Secure connections for all payment operations

πŸ“ Project Structure

minishop/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   └── checkout/            # Stripe checkout endpoint
β”‚   β”œβ”€β”€ cart/                    # Shopping cart page
β”‚   β”œβ”€β”€ products/                # Products catalog page
β”‚   β”œβ”€β”€ layout.tsx               # Root layout with providers
β”‚   β”œβ”€β”€ page.tsx                 # Homepage with hero section
β”‚   └── globals.css              # Global styles and themes
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ ui/                      # ShadCN UI components
β”‚   β”œβ”€β”€ Navbar.tsx               # Navigation with cart indicator
β”‚   β”œβ”€β”€ ProductCard.tsx          # Product display card
β”‚   └── footer.tsx               # Site footer
β”œβ”€β”€ context/                      # React Context providers
β”‚   └── CartContext.tsx          # Shopping cart state management
β”œβ”€β”€ lib/                         # Utility libraries
β”‚   β”œβ”€β”€ products.ts              # Product data and types
β”‚   β”œβ”€β”€ stripe.ts                # Stripe configuration
β”‚   └── utils.ts                 # Helper functions
β”œβ”€β”€ public/                       # Static assets
β”‚   └── screenshots/             # Project screenshots
β”œβ”€β”€ next.config.ts               # Next.js configuration
β”œβ”€β”€ tailwind.config.js           # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json                # TypeScript configuration
└── package.json                 # Dependencies and scripts

πŸ§ͺ Development

Available Scripts

# Development server
npm run dev

# Development with Turbopack
npm run dev:turbo

# Production build
npm run build

# Start production server
npm start

# Lint code
npm run lint

Development Features

  • Hot Reload: Instant updates during development
  • Type Checking: Real-time TypeScript error checking
  • ESLint: Code quality and consistency checks
  • Turbopack: Fast refresh and bundling (experimental)

πŸš€ Deployment

Deploy to Vercel (Recommended)

The easiest way to deploy this Next.js app is using Vercel:

  1. Push your code to GitHub
git add .
git commit -m "Ready for deployment"
git push origin main
  1. Import to Vercel

    • Go to Vercel Dashboard
    • Click "Add New Project"
    • Import your GitHub repository
    • Configure project settings:
      • Framework Preset: Next.js
      • Build Command: npm run build
      • Output Directory: (leave empty)
  2. Add Environment Variables

    • Add all environment variables from your .env.local file
    • Make sure to add them for all environments (Production, Preview, Development)
  3. Configure Stripe Webhooks (Optional)

    • Set up Stripe webhooks for production order fulfillment
    • Add webhook endpoint URL to Stripe Dashboard
  4. Deploy!

    • Click "Deploy"
    • Wait for the build to complete
    • Your app will be live at https://your-project.vercel.app

Environment Variables on Vercel

For detailed Vercel deployment instructions:


πŸ“ Important Notes

  • Stripe Setup: You need both publishable and secret keys for payments to work
  • Environment Variables: All Stripe keys must be set for the application to function
  • Test Mode: Use Stripe test keys for development and testing
  • Production: Switch to live keys when deploying to production
  • Webhooks: Optional but recommended for production order processing

πŸ”’ Privacy & Security

  • βœ… Secure Payments: Stripe handles all payment data securely
  • βœ… No Data Storage: No sensitive customer data stored locally
  • βœ… HTTPS Required: All connections secured with SSL/TLS
  • βœ… Input Sanitization: All user inputs are validated and sanitized
  • βœ… Error Handling: Secure error messages that don't expose sensitive data

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.


πŸ™ Acknowledgments

Built with amazing open-source technologies:


⭐ Like this project? Give it a star!

Star History Chart

Star this repo to show your support! ⭐


Built with ❀️ using Next.js, React, and TypeScript

Features β€’ Demo β€’ Getting Started β€’ License

About

e_commerce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors