A minimal viable e-commerce web application built with Next.js, TypeScript, Tailwind CSS, and Firebase Firestore.
- π Home Page: Browse products with search and category filtering
- π± Responsive Design: Works seamlessly on mobile, tablet, and desktop
- π Shopping Cart: Add items, modify quantities, remove items
- π³ Checkout Process: Collect customer information and simulate order placement
- β Order Confirmation: Success page with order tracking information
- π¨βπΌ Admin Dashboard: Manage products with CRUD operations
- β Add Products: Create new products with images and details
- βοΈ Edit Products: Update existing product information
- ποΈ Delete Products: Remove products from the catalog
- π Product Overview: View all products in a table format
- π State Management: Global cart state using React Context
- π¨ Modern UI: Clean, minimal design with Tailwind CSS
- π₯ Firebase Ready: Configured for Firestore integration
- π± Mobile-First: Responsive design with mobile optimization
- π Performance: Optimized with Next.js features like SSG and Image optimization
- Frontend: Next.js 14 with TypeScript
- Styling: Tailwind CSS
- State Management: React Context API
- Backend: Firebase Firestore (configurable)
- Images: Next.js Image optimization
- Deployment: Vercel-ready
- Node.js 18+ and npm
- Firebase account (optional, uses mock data by default)
-
Clone the repository
git clone <repository-url> cd zentro
-
Install dependencies
npm install
-
Environment Setup
cp .env.local.example .env.local
-
Configure Firebase (Optional)
If you want to use Firebase Firestore instead of mock data:
- Create a Firebase project at https://console.firebase.google.com
- Enable Firestore Database
- Get your Firebase configuration
- Update
.env.localwith your Firebase credentials:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
zentro/
βββ components/ # Reusable React components
β βββ layout/ # Layout components (Navbar, Layout)
β βββ product/ # Product-related components
β βββ cart/ # Cart components
β βββ ui/ # UI components (Button, Input, Toast)
βββ context/ # React Context for state management
β βββ CartContext.tsx # Shopping cart state
βββ lib/ # Utility functions and types
β βββ firebase.ts # Firebase configuration
β βββ types.ts # TypeScript type definitions
βββ pages/ # Next.js pages
β βββ api/ # API routes (if needed)
β βββ admin/ # Admin dashboard
β βββ product/ # Product detail pages
β βββ cart.tsx # Shopping cart page
β βββ checkout.tsx # Checkout page
β βββ confirmation.tsx # Order confirmation
β βββ index.tsx # Home page
βββ styles/ # Global styles
βββ public/ # Static assets
- Browse Products: Visit the home page to see all available products
- Search & Filter: Use the search bar and category filter to find specific items
- View Details: Click on any product to see detailed information
- Add to Cart: Click "Add to Cart" on product cards or detail pages
- Manage Cart: View and modify your cart items on the cart page
- Checkout: Provide shipping information and place your order
- Confirmation: Receive order confirmation and tracking information
- Access Admin: Navigate to
/adminto access the admin dashboard - Add Products: Click "Add New Product" and fill in the product details
- Edit Products: Click "Edit" on any product in the admin table
- Delete Products: Click "Delete" to remove products (with confirmation)
- Manage Inventory: Update stock status and product information
{
id: string, // Auto-generated document ID
name: string, // Product name
description: string, // Product description
price: number, // Price in dollars
image: string, // Image URL
category: string, // Product category
inStock: boolean, // Availability status
createdAt: Date, // Creation timestamp
updatedAt: Date // Last update timestamp
}{
id: string, // Auto-generated document ID
items: [ // Array of cart items
{
id: string, // Product ID
name: string, // Product name
price: number, // Product price
quantity: number, // Ordered quantity
// ... other product fields
}
],
customerInfo: {
name: string, // Customer name
email: string, // Customer email
address: string, // Shipping address
city: string, // City
postalCode: string // Postal code
},
total: number, // Order total
status: string, // Order status
createdAt: Date // Order timestamp
}-
Push to GitHub: Push your code to a GitHub repository
-
Connect to Vercel:
- Go to Vercel
- Import your GitHub repository
- Configure environment variables in Vercel dashboard
-
Environment Variables: Add the following to your Vercel project:
NEXT_PUBLIC_FIREBASE_API_KEY NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN NEXT_PUBLIC_FIREBASE_PROJECT_ID NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID NEXT_PUBLIC_FIREBASE_APP_ID -
Deploy: Vercel will automatically build and deploy your application
- Payment Integration: Integrate Stripe, PayPal, or other payment providers
- User Authentication: Add Firebase Auth for user accounts
- Order Tracking: Implement order status tracking
- Product Reviews: Add product rating and review system
- Wishlist: Allow customers to save favorite products
- Email Notifications: Send order confirmations via email
- Colors: Update the color scheme in
tailwind.config.js - Fonts: Add custom fonts in the Layout component
- Components: Modify component styles in the respective files
- Responsive Design: Adjust breakpoints and responsive classes
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please contact support@zentro.com or create an issue in the GitHub repository.
Note: This is a demo application for educational purposes. The checkout process is simulated and no real payments are processed.