High-Performance Gaming Laptops & Accessories
Official Dealer for ASUS, Lenovo, MSI, and Apple in Egypt
- About
- Features
- Tech Stack
- Getting Started
- Project Structure
- Available Scripts
- Testing
- Deployment
- Security
- Contributing
- License
A Plus+ is a modern e-commerce platform specializing in gaming laptops and high-performance computing devices. Built with React and Firebase, it provides a seamless shopping experience with features like:
- π Full-featured shopping cart
- π Secure authentication (Email & Google Sign-In)
- π± Progressive Web App (PWA) with offline support
- π€ AI-powered chatbot for customer support
- π Real-time inventory management
- π Advanced product search and filtering
- βοΈ Product comparison tool
- π± WhatsApp integration for orders
- π Multi-language support (Arabic/English)
- Product Catalog: Browse laptops with detailed specifications
- Smart Search: AI-powered semantic search for finding the perfect laptop
- Product Comparison: Side-by-side comparison of up to 3 laptops
- Shopping Cart: Persistent cart with localStorage
- Wishlist: Save products for later
- User Accounts: Profile management and order history
- Order Tracking: Track your orders in real-time
- Reviews: Read and write product reviews
- WhatsApp Checkout: Complete purchases via WhatsApp
- PWA: Install as an app on mobile/desktop
- Dashboard: Comprehensive analytics and stats
- Product Management: Add, edit, delete products
- Order Management: View and manage customer orders
- User Management: View registered users
- Notifications: Send push notifications to users
- Firebase Authentication: Secure user login
- Firestore Database: Real-time data synchronization
- PWA: Service worker for offline functionality
- Lazy Loading: Code splitting for optimal performance
- Error Boundaries: Graceful error handling
- Analytics: Google Analytics & GTM integration
- SEO Optimized: Meta tags and structured data
- Responsive Design: Mobile-first approach
- React 18.3 - UI library
- Vite 7.2 - Build tool & dev server
- React Router 6.28 - Client-side routing
- Framer Motion - Animations
- Recharts - Data visualization
- Firebase
- Authentication (Email/Password, Google)
- Firestore (NoSQL database)
- Hosting
- Cloud Messaging
- EmailJS - Email notifications
- Google Analytics & GTM - Usage tracking
- ESLint - Code linting
- Vitest - Unit testing
- Testing Library - Component testing
Make sure you have the following installed:
- Node.js (v18 or higher) - Download
- npm (v9 or higher) - Comes with Node.js
- Git - Download
- Firebase Account - Sign up
-
Clone the repository:
git clone https://github.com/yourusername/a-plus-laptops.git cd a-plus-laptops -
Install dependencies:
npm install
-
Copy the environment template:
cp .env.example .env
-
Configure Firebase:
- Go to Firebase Console
- Create a new project or select existing one
- Go to Project Settings > General > Your apps
- Copy your Firebase config values into
.env
-
Configure EmailJS (optional):
- Sign up at EmailJS
- Create a new service and template
- Copy your service ID, template ID, and public key into
.env
-
Configure Google Analytics (optional):
- Create a GA4 property
- Copy your Measurement ID into
.env
-
Configure reCAPTCHA (optional):
- Go to reCAPTCHA Admin
- Register your site
- Copy your site key into
.env
.env file to Git!
-
Start development server:
npm run dev
-
Build for production:
npm run build
-
Preview production build:
npm run preview
a-plus-laptops/
βββ public/ # Static files
β βββ pwa-*.png # PWA icons
β βββ robots.txt # SEO robots file
β βββ sitemap.xml # SEO sitemap
βββ src/
β βββ components/ # Reusable components (54 files)
β β βββ Navbar.jsx
β β βββ Footer.jsx
β β βββ Chatbot.jsx
β β βββ ProductCard.jsx
β β βββ ...
β βββ pages/ # Page components (30 files)
β β βββ Home.jsx
β β βββ Shop.jsx
β β βββ ProductDetails.jsx
β β βββ Checkout.jsx
β β βββ AdminDashboard.jsx
β β βββ ...
β βββ context/ # React Context providers (9 files)
β β βββ AuthContext.jsx
β β βββ CartContext.jsx
β β βββ WishlistContext.jsx
β β βββ ...
β βββ utils/ # Utility functions (7 files)
β β βββ analytics.js
β β βββ errorLogger.js
β β βββ ...
β βββ styles/ # Global styles
β βββ firebase.js # Firebase configuration
β βββ translations.js # i18n translations
β βββ App.jsx # Root component
β βββ main.jsx # Entry point
βββ .env # Environment variables (not in Git)
βββ .env.example # Environment template
βββ .gitignore # Git ignore rules
βββ firebase.json # Firebase config
βββ firestore.rules # Firestore security rules
βββ vite.config.js # Vite configuration
βββ package.json # Dependencies
βββ SECURITY.md # Security policy
βββ README.md # This file
| Script | Description |
|---|---|
npm run dev |
Start development server on port 5173 |
npm run build |
Build for production |
npm run preview |
Preview production build locally |
npm run lint |
Run ESLint to check code quality |
npm test |
Run tests with Vitest |
npm run test:ui |
Run tests with UI |
npm run test:run |
Run tests once |
npm run test:coverage |
Run tests with coverage report |
We use Vitest and React Testing Library for testing.
Run all tests:
npm testRun with coverage:
npm run test:coverageCurrent test coverage:
- Context APIs: 33% (3/9 files)
- Components: 2% (1/54 files)
- Pages: 3% (1/30 files)
- Utilities: 14% (1/7 files)
-
Install Firebase CLI:
npm install -g firebase-tools
-
Login to Firebase:
firebase login
-
Build and deploy:
npm run build firebase deploy
The app is currently deployed on Vercel:
- Production: https://a-plus-laptops.vercel.app/
Deploy to Vercel:
- Push to GitHub
- Import project in Vercel Dashboard
- Configure environment variables
- Deploy
We take security seriously. Please review our Security Policy for:
- How to report vulnerabilities
- Security best practices
- Supported versions
- Never commit
.envfile to Git - Never share API keys publicly
- Use environment variables for all secrets
- Keep dependencies updated (
npm audit)
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Quick start:
- 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.
Project Maintainer: Mohamed Saad Ibrahim
Email: mhamed.saad.ibrahim@gmail.com
- Firebase for backend infrastructure
- React community for excellent libraries
- All contributors who help improve this project
Made with β€οΈ in Egypt πͺπ¬
