A premium audio equipment e-commerce platform delivering a seamless shopping experience for high-fidelity audio enthusiasts.
- Overview
- Features
- Tech Stack
- Prerequisites
- Installation
- Environment Variables
- Development
- Build & Deployment
- Project Structure
- Product Catalog
- Contributing
- License
Audiophile is a modern e-commerce platform specialized in premium audio equipment. Built with Next.js and TypeScript, it provides a fast, responsive, and intuitive shopping experience for customers seeking high-quality headphones, speakers, and earphones.
- Server-side rendering for optimal performance
- Type-safe codebase with TypeScript
- Mobile-first responsive design
- Optimized image loading and lazy loading
- SEO-friendly architecture
- Accessible UI components
- Product Catalog: Browse curated collections of premium audio equipment
- Category Navigation: Filter products by headphones, speakers, and earphones
- Product Details: Comprehensive product pages with high-resolution images, specifications, and features
- Image Gallery: Multiple product views with zoom functionality
- Related Products: Smart product recommendations
- Shopping Cart: Real-time cart updates with quantity management
- Cart Persistence: Cart state preserved across sessions
- Checkout Flow: Streamlined multi-step checkout process
- Order Summary: Clear breakdown of costs including VAT and shipping
- Form Validation: Client-side validation for all user inputs
- Responsive Design: Optimized layouts for mobile, tablet, and desktop
- Dark Mode Support: Seamless theme switching (if implemented)
- Smooth Animations: Polished micro-interactions and transitions
- Accessibility: WCAG 2.1 compliant components
- Performance: Lighthouse score 90+ across all metrics
- Next.js 14+ - React framework with App Router
- TypeScript - Type safety and developer experience
- React 18+ - UI component library
- Tailwind CSS - Utility-first CSS framework
- Lucide React - Beautiful & consistent icons
- CSS Modules - Component-scoped styling
- React Context API - Global state management
- React Hooks - Local component state
- LocalStorage - Cart persistence
- ESLint - Code linting and quality
- Prettier - Code formatting
- Git Hooks - Pre-commit checks
Ensure you have the following installed on your system:
- Node.js 18.17 or later
- npm 9+ or yarn 1.22+ or pnpm 8+
- Git for version control
git clone https://github.com/yourusername/audiophile-ecommerce.git
cd audiophile-ecommerce# Using npm
npm install
# Using yarn
yarn install
# Using pnpm
pnpm install
# Using bun
bun installInitialize and configure Convex:
# Login to Convex (if not already logged in)
npx convex dev
# This will:
# - Create a Convex project (if needed)
# - Generate your Convex URL
# - Create/update .env.local with NEXT_PUBLIC_CONVEX_URL
# - Start the Convex development serverNote: If you already have a Convex project, the URL will be automatically added to your .env.local file. Otherwise, you'll need to add it manually:
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloudCreate a .env.local file in the root directory (if not already created by Convex):
cp .env.example .env.localSee Environment Variables section for required variables.
In separate terminals, run:
# Terminal 1: Start Convex dev server (if not already running)
npx convex dev
# Terminal 2: Start Next.js dev server
npm run devOpen http://localhost:3000 in your browser.
Create a .env.local file with the following variables:
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME="Audiophile"
# Convex Backend (Required)
# Get your Convex URL by running 'npx convex dev' or from your Convex dashboard
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloud
# Clerk Authentication (if applicable)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx
CLERK_SECRET_KEY=sk_test_xxxxx
# API Configuration (if applicable)
NEXT_PUBLIC_API_URL=https://api.example.com
API_SECRET_KEY=your_secret_key_here
# Payment Gateway (if integrated)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxxxx
STRIPE_SECRET_KEY=sk_test_xxxxx
# Analytics (optional)
NEXT_PUBLIC_GA_TRACKING_ID=G-XXXXXXXXXX
# Email Service (optional)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your_email@example.com
SMTP_PASSWORD=your_password.env.local- Local development (gitignored).env.production- Production environment.env.example- Template file (committed to repo)
Important: Never commit .env.local or .env.production to version control.
# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run linter
npm run lint
# Fix linting issues
npm run lint:fix
# Format code with Prettier
npm run format
# Type check
npm run type-check
# Run all checks (lint + type-check)
npm run check-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code style
-
Test your changes locally
-
Commit with descriptive messages:
git commit -m "feat: add product filtering functionality" -
Push and create a pull request
- Used TypeScript for all new files
- Follow the existing folder structure
- Write descriptive component and function names
- Add JSDoc comments for complex functions
- Keep components small and focused (Single Responsibility Principle)
- Use Tailwind utility classes, avoid inline styles
# Create optimized production build
npm run build
# Test production build locally
npm run startaudiophile-ecommerce/
βββ app/ # Next.js App Router
β βββ (routes)/ # Route groups
β β βββ headphones/ # Headphones category
β β βββ speakers/ # Speakers category
β β βββ earphones/ # Earphones category
β βββ product/[slug]/ # Dynamic product pages
β βββ cart/ # Shopping cart page
β βββ checkout/ # Checkout page
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
βββ components/ # React components
β βββ ui/ # Reusable UI components
β β βββ Button.tsx
β β βββ Card.tsx
β β βββ Input.tsx
β βββ layout/ # Layout components
β β βββ Header.tsx
β β βββ Footer.tsx
β β βββ Navigation.tsx
β βββ product/ # Product-related components
β β βββ ProductCard.tsx
β β βββ ProductGrid.tsx
β β βββ ProductDetail.tsx
β βββ cart/ # Cart components
β βββ CartItem.tsx
β βββ CartSummary.tsx
βββ lib/ # Utility functions
β βββ utils.ts # Helper functions
β βββ constants.ts # App constants
β βββ types.ts # TypeScript types
βββ hooks/ # Custom React hooks
β βββ useCart.ts
β βββ useLocalStorage.ts
β βββ useMediaQuery.ts
βββ context/ # React Context providers
β βββ CartContext.tsx
βββ data/ # Static data
β βββ products.json # Product catalog
βββ public/ # Static assets
β βββ images/ # Product images
β βββ icons/ # Icon files
β βββ favicon.ico
βββ styles/ # Additional styles
β βββ tailwind.config.ts # Tailwind configuration
βββ .env.example # Environment template
βββ .eslintrc.json # ESLint configuration
βββ .gitignore # Git ignore rules
βββ next.config.js # Next.js configuration
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ README.md # This file
This project is licensed under the MIT License