ποΈ Shofy - Modern eCommerce Platform
![]()
A modern, full-stack eCommerce application built with Next.js 15, TypeScript, Firebase, and NextAuth.js. Featuring a comprehensive admin dashboard, role-based authentication, and a responsive design.
π Quick Start
π View Youtube Video for setup
- Frontend: Youtube setup Link (if available)
Get your eCommerce store running in minutes:
# 1. Clone the repository
git clone https://github.com/noorjsdivs/shofy-commerce-app-yt.git
cd shofy-commerce-app-yt
# 2. Install dependencies
npm install
# 3. Set up environment variables (see setup guide below)
cp .env.example .env.local
# Fill in your credentials
# 4. Start development server
npm run dev
# 5. Open your browser
# Visit: http://localhost:3000
π Live Demo
- Frontend: Live Demo Link (if available)
- Admin Dashboard: Available after completing setup (Premium Feature)
β¨ Features
οΏ½ eCommerce Core
- Product Catalog: Browse products with categories, search, and filtering
- Shopping Cart: Add/remove items, quantity management, persistent cart
- Checkout Process: Secure payment integration with Stripe
- Order Management: Track orders, order history, and status updates
- Wishlist/Favorites: Save products for later purchase
- User Profiles: Manage personal information, addresses, and preferences
π Authentication & Authorization
- Multi-Provider Auth: Google, GitHub, and Email/Password via NextAuth.js
- Role-Based Access Control (RBAC):
- User: Standard shopping experience
- Admin: Full system access and management
- Accountant: Financial data access
- Delivery: Order fulfillment management
- Packer: Warehouse and packing operations
- Session Management: Secure session handling with automatic sync
- Profile Management: Edit profiles, upload avatars, change passwords
οΏ½ Admin Dashboard
- Analytics & Insights: Revenue tracking, user analytics, sales charts
- User Management: View, edit, delete users with bulk operations
- Order Management: Process orders, update status, bulk operations
- Product Management: Add, edit, delete products and categories
- Role Assignment: Assign and manage user roles
- System Statistics: Real-time dashboard with key metrics
π¨ Design & UX
- Responsive Design: Mobile-first approach, works on all devices
- Modern UI: Clean, professional design with smooth animations
- Dark/Light Mode: Theme switching capabilities
- Multi-Currency: Support for different currencies with conversion
- Multi-Language: Internationalization ready
- Loading States: Skeleton loaders and smooth transitions
- Toast Notifications: Real-time feedback for user actions
π οΈ Technical Features
- Server-Side Rendering (SSR): Fast initial page loads
- Static Site Generation (SSG): Optimized performance for static content
- API Routes: RESTful API endpoints for all operations
- Database: Firebase Firestore for real-time data
- File Storage: Firebase Storage for images and files
- State Management: Redux Toolkit with persistence
- Form Handling: Advanced form validation and error handling
- SEO Optimized: Meta tags, sitemap generation, and structured data
- Performance: Code splitting, lazy loading, and optimization
π± Pages & Routes
Public Pages
- Home: Featured products, categories, and promotional banners
- Products: Product listing with search, filters, and pagination
- Product Details: Detailed product view with images and specifications
- Categories: Browse products by category
- About: Company information and mission
- Contact: Contact form and company details
- FAQs: Frequently asked questions with search
- Inquiry: Customer inquiry form
User Pages
- Account Dashboard: Personal overview and quick actions
- Profile: Edit personal information and upload avatar
- Orders: Order history and tracking
- Order Details: Detailed order information
- Addresses: Manage shipping and billing addresses
- Settings: Account preferences and notifications
- Cart: Shopping cart management
- Checkout: Secure payment process
- Favorites: Saved products and wishlist
Admin Pages
- Admin Dashboard: System overview and analytics
- User Management: Comprehensive user administration
- Order Management: Order processing and fulfillment
- Analytics: Detailed business insights and reports
Role-Specific Dashboards
- Accountant Dashboard: Financial reports and revenue tracking
- Delivery Dashboard: Order delivery and logistics
- Packer Dashboard: Warehouse and packing operations
- User Dashboard: Standard user experience
ποΈ Tech Stack
Frontend
- Next.js 15.4.6 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Smooth animations and transitions
- React Icons - Comprehensive icon library
- React Hot Toast - Beautiful notifications
Backend & Authentication
- NextAuth.js 5.0 - Complete authentication solution
- Firebase Firestore - NoSQL real-time database
- Firebase Storage - File and image storage
- Firebase Admin - Server-side operations
- bcryptjs - Password hashing
State Management
- Redux Toolkit - Predictable state management
- Redux Persist - State persistence across sessions
- React Redux - React bindings for Redux
Development & Build Tools
- ESLint - Code linting and quality
- TypeScript - Static type checking
- PostCSS - CSS processing
- Next Sitemap - Automatic sitemap generation
- Wrangler - Cloudflare deployment (optional)
π Project Structure
shofy-commerce-app-yt/
βββ src/
β βββ app/ # Next.js 15 App Router
β β βββ (public)/ # Public routes (no authentication required)
β β β βββ about/ # About page
β β β βββ contact/ # Contact page
β β β βββ faqs/ # FAQ page
β β β βββ inquiry/ # Customer inquiry
β β βββ (user)/ # Protected user routes
β β β βββ account/ # User account management
β β β β βββ admin/ # Admin dashboard (Premium)
β β β β βββ addresses/ # Address management
β β β β βββ notifications/ # User notifications
β β β β βββ orders/ # Order history
β β β β βββ payment/ # Payment methods
β β β β βββ profile/ # User profile
β β β β βββ settings/ # Account settings
β β β βββ cart/ # Shopping cart
β β β βββ categories/ # Product categories
β β β βββ checkout/ # Checkout process
β β β βββ favorite/ # Wishlist/Favorites
β β β βββ offers/ # Special offers
β β β βββ products/ # Product pages
β β βββ api/ # API routes
β β β βββ admin/ # Admin API endpoints
β β β βββ auth/ # Authentication API
β β βββ auth/ # Authentication pages
β β βββ dashboard/ # Role-based dashboards
β β βββ delivery/ # Public delivery info
β β βββ delivery-dashboard/ # Delivery staff dashboard
β β βββ packer-dashboard/ # Packer staff dashboard
β β βββ unauthorized/ # Unauthorized access page
β β βββ user-dashboard/ # User dashboard
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β βββ components/ # Reusable React components
β β βββ account/ # Account-related components
β β βββ admin/ # Admin dashboard components
β β βββ auth/ # Authentication components
β β βββ cart/ # Shopping cart components
β β βββ dashboard/ # Dashboard components
β β βββ header/ # Header and navigation
β β βββ layout/ # Layout components
β β βββ notifications/ # Notification components
β β βββ pages/ # Page-specific components
β β βββ products/ # Product-related components
β β βββ ui/ # UI components (buttons, cards, etc.)
β β βββ [Various Components] # Core app components
β βββ assets/ # Static assets (images, fonts)
β βββ contexts/ # React Context providers
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
β β βββ auth/ # Authentication utilities
β β βββ firebase/ # Firebase configuration
β β βββ rbac/ # Role-based access control
β βββ redux/ # Redux state management
β βββ types/ # TypeScript type definitions
β βββ constants/ # Application constants
βββ public/ # Static public assets
β βββ thumbnail.png # Project preview image
β βββ logo.png # App logo
β βββ robots.txt # SEO robots file
β βββ [Other Assets] # Images, icons, etc.
βββ middleware.ts # Route protection middleware
βββ auth.ts # NextAuth configuration
βββ config.ts # App configuration
βββ firebase.ts # Firebase client config
βββ type.ts # Global type definitions
βββ next.config.mjs # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS config
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies and scripts
π Complete Setup Guide
Prerequisites
Before you begin, make sure you have:
- Node.js 18+ and npm installed
- Git for cloning the repository
- A Firebase account (free tier available)
- A Google Cloud Console account (for OAuth)
- A GitHub account (for OAuth - optional)
Step-by-Step Installation
1. Clone the Repository
git clone https://github.com/noorjsdivs/shofy-commerce-app-yt.git
cd shofy-commerce-app-yt
2. Install Dependencies
npm install
3. Environment Setup
Create a .env.local file in the root directory:
touch .env.local
Add the following environment variables (see detailed setup below):
# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here
# Google OAuth (Required)
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret
# GitHub OAuth (Optional)
AUTH_GITHUB_ID=your-github-client-id
AUTH_GITHUB_SECRET=your-github-client-secret
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
# Firebase Admin SDK
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYour-Private-Key-Here\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com
4. Start Development Server
npm run dev
5. Open Your Browser
Navigate to http://localhost:3000
π Environment Credentials Setup
π₯ Firebase Setup (Required)
Step 1: Create Firebase Project
- Go to Firebase Console
- Click "Create a project"
- Enter project name (e.g.,
shofy-ecommerce) - Enable Google Analytics (optional)
- Click "Create project"
Step 2: Get Client Configuration
- In Firebase Console, click βοΈ Project Settings
- Scroll to "Your apps" section
- Click "Add app" β "Web" (</> icon)
- Register app with nickname (e.g.,
Shofy Web) - Copy the config values:
// Firebase Config Object
const firebaseConfig = {
apiKey: "AIzaSyC...", // β NEXT_PUBLIC_FIREBASE_API_KEY
authDomain: "project.firebaseapp.com", // β NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
projectId: "your-project-id", // β NEXT_PUBLIC_FIREBASE_PROJECT_ID
storageBucket: "project.appspot.com", // β NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
messagingSenderId: "123456789", // β NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
appId: "1:123:web:abc123", // β NEXT_PUBLIC_FIREBASE_APP_ID
};
Step 3: Setup Firestore Database
- In Firebase Console, go to "Firestore Database"
- Click "Create database"
- Choose "Start in test mode" (for development)
- Select your preferred location
- Click "Enable"
Step 4: Setup Firebase Storage
- Go to "Storage" in Firebase Console
- Click "Get started"
- Choose "Start in test mode"
- Select the same location as Firestore
- Click "Done"
Step 5: Get Admin SDK Credentials
- Go to Project Settings β "Service accounts" tab
- Click "Generate new private key"
- Download the JSON file
- Extract these values for your
.env.local:project_idβFIREBASE_PROJECT_IDprivate_keyβFIREBASE_PRIVATE_KEY(keep \n characters)client_emailβFIREBASE_CLIENT_EMAIL
π Google OAuth Setup (Required)
Step 1: Google Cloud Console
- Go to Google Cloud Console
- Create new project or select existing Firebase project
- Enable the project if prompted
Step 2: Configure OAuth Consent Screen
- Go to "APIs & Services" β "OAuth consent screen"
- Choose "External" β Click "Create"
- Fill in required fields:
- App name:
Shofy eCommerce - User support email: your email
- Developer contact: your email
- App name:
- Click "Save and Continue" through all steps
Step 3: Create OAuth Credentials
- Go to "APIs & Services" β "Credentials"
- Click "+ CREATE CREDENTIALS" β "OAuth 2.0 Client IDs"
- Application type: "Web application"
- Name:
Shofy Web Client - Add Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google https://yourdomain.com/api/auth/callback/google - Click "Create"
- Copy the Client ID and Client Secret:
- Client ID β
AUTH_GOOGLE_ID - Client Secret β
AUTH_GOOGLE_SECRET
- Client ID β
π GitHub OAuth Setup (Optional)
Step 1: Create GitHub OAuth App
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in the form:
- Application name:
Shofy eCommerce - Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Application name:
- Click "Register application"
Step 2: Get Credentials
- Copy Client ID β
AUTH_GITHUB_ID - Click "Generate a new client secret"
- Copy Client Secret β
AUTH_GITHUB_SECRET
π NextAuth Secret Generation
Generate a secure secret for session encryption:
# Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# Or using OpenSSL
openssl rand -base64 32
Copy the generated string to NEXTAUTH_SECRET
β Verify Setup
After adding all environment variables:
-
Restart your development server:
npm run dev -
Test authentication:
- Visit
http://localhost:3000 - Click "Sign In"
- Try Google OAuth login
- Check if user data appears in Firebase Console
- Visit
π Available Scripts
# Development
npm run dev # Start development server on http://localhost:3000
npm run build # Build optimized production bundle
npm run start # Start production server (after build)
npm run lint # Run ESLint for code quality
npm run type-check # Run TypeScript type checking
# Utilities
npm run postbuild # Generate sitemap after build
npm run deploy:check # Run deployment checks
npm run deploy:cf # Deploy to Cloudflare Pages (if configured)
Development Workflow
- Start Development:
npm run dev - Check Code Quality:
npm run lint - Type Safety:
npm run type-check - Build for Production:
npm run build - Test Production:
npm run start
οΏ½ Admin Access Setup
Method 1: Email-Based Admin (Recommended)
Set admin email in your authentication logic:
- Register with your admin email
- Check
AccountLayout.tsx- admin access is granted to:[email protected]- Users with
role: "admin"
Method 2: Role-Based Admin
- Register a new account
- Go to Firebase Console β Firestore Database
- Find your user document in the
userscollection - Add a field:
role: "admin" - Save and refresh your application
Admin Features
- π― Premium Feature: Full admin dashboard is available in the premium version
- π Dashboard: Basic dashboard with upgrade prompt
- π Upgrade Link: Direct link to purchase premium features
- βοΈ Settings: Standard account management
Admin URL: http://localhost:3000/account/admin
π Key Features Highlights
Advanced Authentication
- Multiple OAuth providers
- Role-based dashboard routing
- Session synchronization
- Secure middleware protection
Comprehensive Admin Panel
- Real-time analytics
- Bulk operations for users and orders
- Advanced filtering and search
- Export capabilities
Enhanced UX
- Skeleton loading states
- Optimistic UI updates
- Real-time notifications
- Responsive design patterns
Performance Optimizations
- Image optimization with Next.js
- Code splitting and lazy loading
- Static generation where possible
- Efficient state management
π¨ Customization Guide
Branding & Styling
- Colors: Update
tailwind.config.tsfor brand colors - Logo: Replace files in
/public/and/src/assets/ - Fonts: Modify
/src/fonts/directory - Theme: Customize CSS variables in
globals.css
Content Customization
- Homepage: Edit components in
/src/components/pages/home/ - Navigation: Update
/src/components/header/ - Footer: Modify
/src/components/Footer.tsx - Static Pages: Edit files in
/src/app/(public)/
Feature Extensions
- Payment Integration: Add Stripe/PayPal in
/src/lib/ - Email Service: Integrate with SendGrid, Mailgun, etc.
- Analytics: Add Google Analytics, Mixpanel, etc.
- Search: Implement Algolia, Elasticsearch, etc.
API Customization
- Endpoints: Modify
/src/app/api/routes - Database: Extend Firestore collections
- Authentication: Add custom providers in
auth.ts - Middleware: Update
/middleware.tsfor custom logic
οΏ½ Deployment
Vercel (Recommended)
-
Push to GitHub:
git add . git commit -m "Initial commit" git push origin main -
Deploy to Vercel:
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
- Add environment variables
- Deploy
-
Update Environment:
- Set
NEXTAUTH_URLto your Vercel domain - Update OAuth redirect URIs
- Set
Other Platforms
- Netlify: Connect GitHub and deploy
- Railway: One-click deployment
- Digital Ocean: App Platform
- AWS: Amplify Hosting
Environment Variables for Production
Remember to update these in production:
NEXTAUTH_URL=https://your-domain.com
# Update OAuth redirect URIs in Google/GitHub console
# Use production Firebase project
οΏ½π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support & Help
Getting Help
- π Documentation: This README covers everything you need
- π Issues: Open a GitHub Issue
- π¬ Discussions: GitHub Discussions
- π§ Email: [email protected]
Premium Support
- π― Admin Dashboard: Buy Premium Version
- π οΈ Custom Development: Available for hire
- π Training: One-on-one setup assistance
- π§ Maintenance: Ongoing support packages
Community
- β Star this repo if you find it helpful
- π΄ Fork & contribute improvements
- π’ Share with other developers
π Acknowledgments
- Next.js Team - Amazing React framework
- Firebase Team - Reliable backend services
- Tailwind CSS - Beautiful utility-first CSS
- NextAuth.js - Secure authentication
- Vercel - Seamless deployment platform
- Open Source Community - Inspiration and tools
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
β Star this repository if it helped you!
Built with β€οΈ by Noor Mohammad for the developer community
π¨ Modern UI/UX
- Responsive Design (Mobile-first approach)
- Professional Animations with Framer Motion
- Loading Skeletons for better UX
- Toast Notifications for user feedback
- Dynamic Navigation with mobile optimization
- Professional Color Scheme with consistent branding
π± Mobile Experience
- Mobile Navigation with hamburger menu
- Touch-Friendly interface
- Optimized Performance for mobile devices
- Progressive Web App ready
π Getting Started
Prerequisites
- Node.js 18.0 or later
- npm or pnpm package manager
- Firebase Account (for database and authentication)
- Google Cloud Console account (for Google OAuth)
- GitHub account (for GitHub OAuth)
Installation
-
Clone the repository
git clone https://github.com/noorjsdivs/shofy-commerce-app.git cd shofy-commerce-app -
Install dependencies
npm install # or pnpm install -
Set up environment variables (see Environment Setup below)
-
Run the development server
npm run dev # or pnpm dev -
Open your browser Navigate to http://localhost:3000
π§ Environment Setup
Create a .env file in the root directory and add the following variables:
# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here
# Google OAuth Configuration
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# GitHub OAuth Configuration
GITHUB_ID=your-github-client-id
GITHUB_SECRET=your-github-client-secret
# Firebase Client Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your-firebase-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-firebase-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
# Firebase Admin SDK (for server-side operations)
FIREBASE_PROJECT_ID=your-firebase-project-id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY_HERE\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com
# Stripe Configuration (Optional)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key
STRIPE_SECRET_KEY=your-stripe-secret-key
π How to Obtain Environment Credentials
π₯ Firebase Setup
-
Create a Firebase Project
- Go to Firebase Console
- Click "Create a project"
- Enter project name (e.g., "shofy-ecommerce")
- Enable Google Analytics (optional)
-
Get Firebase Client Configuration
- In Firebase Console, click "Add app" β "Web"
- Register your app with a nickname
- Copy the configuration object values:
const firebaseConfig = { apiKey: "your-api-key", // β NEXT_PUBLIC_FIREBASE_API_KEY authDomain: "your-project.firebaseapp.com", // β NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN projectId: "your-project-id", // β NEXT_PUBLIC_FIREBASE_PROJECT_ID storageBucket: "your-project.appspot.com", // β NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET messagingSenderId: "123456789", // β NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID appId: "your-app-id", // β NEXT_PUBLIC_FIREBASE_APP_ID };
-
Set up Firestore Database
- Go to "Firestore Database" in Firebase Console
- Click "Create database"
- Choose "Start in test mode" (for development)
- Select a location
-
Get Firebase Admin SDK
- Go to Project Settings β Service Accounts
- Click "Generate new private key"
- Download the JSON file
- Extract values:
project_idβFIREBASE_PROJECT_IDprivate_keyβFIREBASE_PRIVATE_KEY(keep the newlines as \n)client_emailβFIREBASE_CLIENT_EMAIL
π Google OAuth Setup
-
Go to Google Cloud Console
- Visit Google Cloud Console
- Create a new project or select existing one
-
Enable Google+ API
- Go to "APIs & Services" β "Library"
- Search for "Google+ API" and enable it
-
Create OAuth 2.0 Credentials
- Go to "APIs & Services" β "Credentials"
- Click "Create Credentials" β "OAuth 2.0 Client IDs"
- Choose "Web application"
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google(development)https://yourdomain.com/api/auth/callback/google(production)
- Copy the Client ID and Client Secret
π GitHub OAuth Setup
-
Go to GitHub Developer Settings
- Visit GitHub Developer Settings
- Click "New OAuth App"
-
Configure OAuth App
- Application name: Shofy E-Commerce
- Homepage URL:
http://localhost:3000(development) - Authorization callback URL:
http://localhost:3000/api/auth/callback/github - Click "Register application"
-
Get Credentials
- Copy the Client ID β
GITHUB_ID - Generate a new client secret β
GITHUB_SECRET
- Copy the Client ID β
π NextAuth Secret
Generate a secure secret for NextAuth:
# Using openssl
openssl rand -base64 32
# Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
Copy the generated string to NEXTAUTH_SECRET
π³ Stripe Setup (Optional)
-
Create Stripe Account
- Go to Stripe Dashboard
- Create an account or log in
-
Get API Keys
- Go to "Developers" β "API keys"
- Copy "Publishable key" β
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Copy "Secret key" β
STRIPE_SECRET_KEY
π Project Structure
shofy-commerce-app/
βββ src/
β βββ app/ # Next.js 13+ App Router
β β βββ auth/ # Authentication pages
β β β βββ signin/ # Sign in page
β β β βββ register/ # Registration page
β β βββ api/ # API routes
β β β βββ auth/ # Authentication API
β β βββ cart/ # Shopping cart page
β β βββ offers/ # Special offers page
β β βββ products/ # Product pages
β β βββ profile/ # User profile page
β βββ components/ # Reusable components
β β βββ auth/ # Authentication components
β β βββ cart/ # Cart components
β β βββ header/ # Header components
β β βββ pages/ # Page-specific components
β β βββ ui/ # UI components
β βββ lib/ # Utility libraries
β β βββ auth/ # Authentication configuration
β β βββ firebase/ # Firebase configuration
β βββ redux/ # State management
β βββ constants/ # Application constants
β βββ assets/ # Static assets
βββ public/ # Public assets
βββ .env # Environment variables
βββ package.json # Dependencies and scripts
π οΈ Technologies Used
Frontend
- Next.js 15.4.6 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- React Icons - Icon library
- React Hot Toast - Toast notifications
Authentication
- NextAuth.js - Authentication framework
- Firebase Auth - Authentication provider
- bcryptjs - Password hashing
Database
- Firebase Firestore - NoSQL document database
- Firebase Storage - File storage
State Management
- Redux Toolkit - Predictable state container
- React Redux - React bindings for Redux
Development Tools
- ESLint - Code linting
- Prettier - Code formatting
- TypeScript - Static type checking
π― Key Features Explained
π Authentication Flow
- Registration: Users create accounts with email/password or OAuth
- Verification: Email verification (optional)
- Login: Secure login with session management
- Protected Routes: Middleware protects authenticated pages
- User Profile: Complete profile management
π Shopping Experience
- Product Browsing: Advanced filtering and sorting
- Search: Real-time product search
- Cart Management: Add/remove items with quantity control
- Wishlist: Save favorite products
- Checkout: Secure payment processing (Stripe integration)
π± Responsive Design
- Mobile-First: Optimized for mobile devices
- Tablet Support: Proper layout for tablets
- Desktop: Full-featured desktop experience
- Cross-Browser: Compatible with all modern browsers
π Deployment
Vercel Deployment (Recommended)
-
Push to GitHub
git add . git commit -m "Initial commit" git push origin main -
Deploy to Vercel
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
- Add environment variables
- Deploy
-
Update Environment Variables
- Update
NEXTAUTH_URLto your Vercel domain - Update OAuth redirect URIs to match your domain
- Update
Other Deployment Options
- Netlify
- Railway
- Digital Ocean
- AWS
π§ Scripts
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript check
π€ Contributing
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature - Commit your changes
git commit -m "Add amazing feature" - Push to the branch
git push origin feature/amazing-feature - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Next.js Team for the amazing framework
- Firebase Team for the backend services
- Tailwind CSS for the utility-first CSS framework
- DummyJSON for the product API
- React Community for the excellent ecosystem
π Support
If you have any questions or need help, please:
- Check the documentation above
- Open an issue on GitHub
- Join our Discord (coming soon)
- Contact the maintainer: [email protected]
π Features Roadmap
- [ ] Email Verification
- [ ] Password Reset
- [ ] Admin Dashboard
- [ ] Order Management
- [ ] Inventory Management
- [ ] Product Reviews
- [ ] Advanced Analytics
- [ ] Multi-language Support
- [ ] Dark Mode
- [ ] PWA Features
Made with β€οΈ by Noor Mohammad
β Star this repository if you find it helpful!