A modern e-commerce platform for bakeries
Features โข Getting Started โข Documentation โข Contributing
Click to expand
- โจ Features
- ๐ Getting Started
- ๐ ๏ธ Tech Stack
- ๐ฆ Installation
- ๐ง Configuration
- ๐ Project Structure
- ๐๏ธ Backend Structure & Usage
- ๐งช Testing
- ๐ Documentation
- ๐ค Contributing
- ๐ Security
- ๐ License
- ๐ฅ Authors
- ๐ Acknowledgments
- ๐ Performance
- ๐ API Reference
- ๐ Internationalization
- ๐ฑ Mobile Support
- ๐ง Troubleshooting
- ๐ Roadmap
Click to expand
- ๐ Secure login and registration
- Email/Password authentication
- Social media login (Google, Facebook)
- Two-factor authentication
- Remember me functionality
- ๐ฅ Guest checkout
- No account required
- Easy conversion to registered user
- ๐ Password reset
- Secure token-based reset
- Email verification
- ๐ญ Role-based access
- Customer
- Admin
- Developer
- ๐ Smart cart system
- Real-time updates
- Save for later
- Multiple delivery options
- ๐ณ Multiple payment methods
- Credit/Debit cards
- PayPal
- Apple Pay
- Google Pay
- ๐ฆ Order tracking
- Real-time status updates
- Delivery notifications
- Order history
- ๐ฑ Mobile-first design
- Responsive layout
- Touch-friendly interface
- PWA support
- ๐ Advanced search
- Filters and sorting
- Category navigation
- Search suggestions
- ๐ท๏ธ Product categories
- Hierarchical structure
- Custom attributes
- Bulk management
- โญ Reviews and ratings
- Photo reviews
- Verified purchases
- Helpful votes
- ๐ธ High-quality images
- Zoom functionality
- Multiple angles
- Gallery view
Click to expand
- ๐ Real-time analytics
- Sales metrics
- User engagement
- Conversion rates
- ๐ Sales reports
- Custom date ranges
- Export options
- Trend analysis
- ๐ฅ User management
- User roles
- Activity logs
- Ban/Suspend users
- ๐ฆ Inventory control
- Stock alerts
- Low stock warnings
- Automatic reordering
- ๐ Order processing
- Status updates
- Batch processing
- Priority handling
- ๐ฆ Pickup scheduling
- Calendar integration
- Time slot management
- Capacity planning
- ๐ง Automated notifications
- Order confirmations
- Shipping updates
- Delivery notifications
- ๐ Performance metrics
- Processing times
- Customer satisfaction
- Error rates
| Software | Version | Description | Download |
|---|---|---|---|
| Node.js | >=14.0.0 | JavaScript runtime | Download |
| npm | >=6.0.0 | Package manager | Download |
| Git | >=2.0.0 | Version control | Download |
# Clone the repository
git clone https://github.com/Hum2a/bakery.git
cd bakery
# Install dependencies
npm install
# Start development server
npm startgraph TD
A[Clone Repository] --> B[Install Dependencies]
B --> C[Start Development Server]
C --> D[Make Changes]
D --> E[Run Tests]
E --> F[Create Pull Request]
| Technology | Purpose | Version | Documentation |
|---|---|---|---|
| React | UI Framework | 18.x | Docs |
| Redux | State Management | 4.x | Docs |
| Styled Components | Styling | 5.x | Docs |
| React Router | Navigation | 6.x | Docs |
| Service | Purpose | Version | Documentation |
|---|---|---|---|
| Firebase | Backend Services | 9.x | Docs |
| Firestore | Database | 9.x | Docs |
| Firebase Auth | Authentication | 9.x | Docs |
| Firebase Storage | File Storage | 9.x | Docs |
| Tool | Purpose | Version | Documentation |
|---|---|---|---|
| GitHub Actions | CI/CD | Latest | Docs |
| ESLint | Code Linting | 8.x | Docs |
| Prettier | Code Formatting | 2.x | Docs |
| Jest | Testing | 27.x | Docs |
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Start backend and frontend (from root)
node server.js
# or for concurrent dev (if using scripts)
npm run dev# Build for production
npm run build
# Start production server
npm run start:prod# Build Docker image
docker build -t bakery .
# Run container
docker run -p 3000:3000 bakery# Firebase Configuration
REACT_APP_FIREBASE_API_KEY=your_api_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_auth_domain
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
REACT_APP_FIREBASE_STORAGE_BUCKET=your_storage_bucket
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
REACT_APP_FIREBASE_APP_ID=your_app_id
# Stripe Configuration
REACT_APP_STRIPE_PUBLIC_KEY=your_stripe_public_key
# Other Configuration
REACT_APP_API_URL=your_api_url
REACT_APP_ENV=developmentsrc/
โโโ components/ # Reusable UI components
โ โโโ auth/ # Authentication components
โ โโโ cart/ # Shopping cart components
โ โโโ checkout/ # Checkout process components
โ โโโ products/ # Product-related components
โ โโโ admin/ # Admin dashboard components
โโโ pages/ # Page components
โโโ hooks/ # Custom React hooks
โโโ context/ # React context providers
โโโ services/ # API and service functions
โโโ utils/ # Utility functions
โโโ styles/ # Global styles and themes
โโโ assets/ # Static assets
backend/
server.js # Entry point for backend (imported by root server.js)
app.js # Main Express app setup
config/
firebase.js # Firebase Admin SDK initialization (with local/prod fallback)
nodemailer.js # Nodemailer transporters
routes/
email.js # All email-related routes
... # Other route files as needed
controllers/
emailController.js
... # Other controllers as needed
-
Always start the backend from the project root:
node server.js
This ensures
.envis loaded from the root and all paths work correctly. -
The root
server.jsloads environment variables and then startsbackend/server.js. -
All backend code and configuration lives in the
backend/directory.
- Place your
.envfile in the project root (never inbackend/). - For Firebase Admin SDK:
- In production (e.g., Render), set
GOOGLE_APPLICATION_CREDENTIALSto the absolute path of your service account JSON. - In local development, leave
GOOGLE_APPLICATION_CREDENTIALSunset and place your service account JSON in the repo (ignored by git). The backend will automatically use the local file if the env variable is not set or the file does not exist.
- In production (e.g., Render), set
- Example fallback logic (see
backend/config/firebase.js):const fs = require('fs'); const path = require('path'); let serviceAccount; const envPath = process.env.GOOGLE_APPLICATION_CREDENTIALS; if (envPath && fs.existsSync(envPath)) { serviceAccount = require(envPath); } else { serviceAccount = require('../bakesbyolayide-firebase-adminsdk-*.json'); }
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Start backend and frontend (from root)
node server.js
# or for concurrent dev (if using scripts)
npm run dev# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- path/to/test.js| File | % Stmts | % Branch | % Funcs | % Lines |
|---|---|---|---|---|
| All files | 90 | 85 | 92 | 90 |
| components/ | 92 | 88 | 94 | 92 |
| services/ | 88 | 82 | 90 | 88 |
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- 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
For security concerns, please see our Security Policy.
- ๐ SSL/TLS encryption
- ๐ Secure password hashing
- ๐ก๏ธ XSS protection
- ๐ซ CSRF protection
- ๐ Input validation
- ๐ Audit logging
This project is licensed under the MIT License - see the LICENSE.md file for details.
Humza Butt ๐ป ๐ |
| Category | Score |
|---|---|
| Performance | 95 |
| Accessibility | 100 |
| Best Practices | 100 |
| SEO | 100 |
| File | Size | Gzipped |
|---|---|---|
| main.js | 1.2MB | 350KB |
| vendor.js | 2.1MB | 650KB |
| styles.css | 150KB | 45KB |
// Login
POST /api/auth/login
{
"email": "user@example.com",
"password": "password123"
}
// Register
POST /api/auth/register
{
"email": "user@example.com",
"password": "password123",
"name": "John Doe"
}// Get all products
GET /api/products
// Get single product
GET /api/products/:id
// Create product
POST /api/products
{
"name": "Chocolate Cake",
"price": 29.99,
"description": "Delicious chocolate cake"
}The platform supports multiple languages:
- ๐ฌ๐ง English
- ๐ช๐ธ Spanish
- ๐ซ๐ท French
- ๐ฉ๐ช German
- ๐ฎ๐น Italian
- ๐ฑ Responsive design
- ๐ฒ PWA support
- ๐ฑ Native-like experience
- ๐ฑ Offline functionality
Click to expand
# Clear npm cache
npm cache clean --force
# Delete node_modules
rm -rf node_modules
# Reinstall dependencies
npm install# Clear build cache
npm run clean
# Rebuild
npm run build# Reset development environment
npm run reset
# Start fresh
npm start- Advanced analytics
- AI-powered recommendations
- Voice search
- AR product preview
- Multi-vendor support
- Subscription system
- Advanced reporting
- Mobile app