A React/Vite application for tracking Apple product prices across multiple retailers.
✅ Apple Product Catalog
- Browse iPhone, iPad, Mac, Apple Watch, and AirPods
- Filter by category, price range, availability
- Sort by price, name, popularity
✅ Price Comparison
- Real-time prices from multiple retailers
- Best price highlighting
- Stock availability tracking
✅ Price History Charts
- Interactive historical price data
- Multiple timeframe views (1M, 3M, 6M, 1Y)
- Retailer-specific price tracking
✅ Deal Alerts System
- Create custom price alerts
- Email notifications when targets are met
- Manage and track alert status
✅ Dark Mode Support
- System preference detection
- Manual theme toggle
- Persistent user preference
- Frontend: React 18, Vite 4
- Styling: Tailwind CSS 3
- Charts: Recharts
- Icons: Lucide React
- Routing: React Router 6
- HTTP: Axios
- Node.js 16+
- npm or yarn
-
Clone and navigate to the project
cd mactrackr-frontend -
Install dependencies
npm install
-
Set up environment variables
# Copy environment files (already provided) cp .env.development.example .env.development cp .env.production.example .env.production -
Start development server
npm run dev
-
Open browser
http://localhost:3000
VITE_API_URL=http://localhost:3001
VITE_ENV=development
VITE_API_URL=https://api.theresmac.com
VITE_ENV=production
# Development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lintsrc/
├── components/ # Reusable UI components
│ ├── Layout/ # Navigation, footer, layout
│ ├── Home/ # Homepage components
│ ├── Products/ # Product catalog components
│ ├── Product/ # Single product components
│ ├── Alerts/ # Alert management components
│ └── UI/ # Generic UI components
├── pages/ # Route components
├── contexts/ # React contexts (theme, etc.)
├── api.js # API client functions
├── index.css # Global styles & Tailwind
└── main.jsx # Application entry point
- Navbar: Navigation with dark mode toggle
- Footer: Site-wide footer with links
- Hero: Landing section with CTAs
- Features: Key feature showcase
- FeaturedProducts: Popular product deals
- ProductCategories: Category filter tabs
- ProductFilters: Price, availability filters
- ProductGrid: Responsive product grid
- ProductCard: Individual product cards
- PriceChart: Historical price visualization
- PriceComparison: Multi-retailer comparison
- ProductSpecs: Specifications and features
- AlertCard: Individual alert management
- AlertModal: Create/edit alert form
The app expects a backend API with these endpoints:
GET /api/health # Health check
GET /api/products # Get products with filters
GET /api/products/:id # Get single product
GET /api/products/search # Search products
GET /api/prices/:id # Get current prices
GET /api/prices/:id/history # Get price history
POST /api/alerts # Create alert
GET /api/alerts # Get user alerts
PUT /api/alerts/:id # Update alert
DELETE /api/alerts/:id # Delete alert
- Custom Apple-inspired color palette
- Dark mode support via class strategy
- Responsive breakpoints
- Custom component classes
.btn-primary # Primary button style
.btn-secondary # Secondary button style
.card # Card container
.product-card # Product card with hover effects
.price-card # Price comparison card
.input-field # Form input stylingDark mode is implemented using:
- Tailwind's class-based dark mode
- ThemeContext for state management
- localStorage for persistence
- System preference detection
The app is fully responsive with:
- Mobile-first approach
- Tailwind's responsive utilities
- Touch-friendly interactions
- Optimized mobile navigation
- Chrome 88+
- Firefox 85+
- Safari 14+
- Edge 88+
npm run buildThe built files in dist/ can be deployed to:
- Vercel
- Netlify
- AWS S3 + CloudFront
- GitHub Pages
- Any static hosting service
- Set production environment variables
- Configure API endpoint
- Set up any required build hooks
- Configure redirect rules for SPA routing
- Code splitting via React Router
- Lazy loading of route components
- Image optimization placeholders
- Bundle analysis available via tools
- Tree shaking enabled by Vite
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License.
- 📧 Email: support@theresmac.com
- 🐛 Issues: GitHub Issues
- 📖 Docs: This README
TheresMac - Never miss an Apple deal again! 🍎