Skip to content

Hum2a/BakesByOlayide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿฐ Bakery E-commerce Platform

Version License Build Status Coverage Dependencies Contributors Last Commit PRs Welcome Code Style

Bakery Logo

A modern e-commerce platform for bakeries

Features โ€ข Getting Started โ€ข Documentation โ€ข Contributing

๐Ÿ“‹ Table of Contents

Click to expand

โœจ Features

๐Ÿ›๏ธ User Features

Click to expand

Authentication

  • ๐Ÿ” 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

Shopping Experience

  • ๐Ÿ›’ 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

Product Management

  • ๐Ÿ” 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

๐Ÿ‘จโ€๐Ÿ’ผ Admin Features

Click to expand

Dashboard

  • ๐Ÿ“Š 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 Management

  • ๐Ÿ“ 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

๐Ÿš€ Getting Started

Prerequisites

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

Quick Start

# Clone the repository
git clone https://github.com/Hum2a/bakery.git
cd bakery

# Install dependencies
npm install

# Start development server
npm start

Development Workflow

graph 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]
Loading

๐Ÿ› ๏ธ Tech Stack

Frontend

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

Backend

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

DevOps

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

๐Ÿ“ฆ Installation

Development Setup

# 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

Production Setup

# Build for production
npm run build

# Start production server
npm run start:prod

Docker Setup

# Build Docker image
docker build -t bakery .

# Run container
docker run -p 3000:3000 bakery

๐Ÿ”ง Configuration

Environment Variables

# 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=development

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ 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 Structure & Usage

Folder Structure

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

Running the Backend

  • Always start the backend from the project root:

    node server.js

    This ensures .env is loaded from the root and all paths work correctly.

  • The root server.js loads environment variables and then starts backend/server.js.

  • All backend code and configuration lives in the backend/ directory.

Environment Variables & Service Account

  • Place your .env file in the project root (never in backend/).
  • For Firebase Admin SDK:
    • In production (e.g., Render), set GOOGLE_APPLICATION_CREDENTIALS to the absolute path of your service account JSON.
    • In local development, leave GOOGLE_APPLICATION_CREDENTIALS unset 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.
  • 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');
    }

Development Setup (Updated)

# 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

๐Ÿงช Testing

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run specific test file
npm test -- path/to/test.js

Test Coverage

File % Stmts % Branch % Funcs % Lines
All files 90 85 92 90
components/ 92 88 94 92
services/ 88 82 90 88

๐Ÿ“š Documentation

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Pull Request Process

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ”’ Security

For security concerns, please see our Security Policy.

Security Features

  • ๐Ÿ” SSL/TLS encryption
  • ๐Ÿ”‘ Secure password hashing
  • ๐Ÿ›ก๏ธ XSS protection
  • ๐Ÿšซ CSRF protection
  • ๐Ÿ” Input validation
  • ๐Ÿ“ Audit logging

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE.md file for details.

๐Ÿ‘ฅ Authors

Humza Butt
Humza Butt

๐Ÿ’ป ๐Ÿ“– โš ๏ธ

๐Ÿ“Š Performance

Lighthouse Scores

Category Score
Performance 95
Accessibility 100
Best Practices 100
SEO 100

Bundle Size

File Size Gzipped
main.js 1.2MB 350KB
vendor.js 2.1MB 650KB
styles.css 150KB 45KB

๐Ÿ” API Reference

Authentication

// 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"
}

Products

// 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"
}

๐ŸŒ Internationalization

The platform supports multiple languages:

  • ๐Ÿ‡ฌ๐Ÿ‡ง English
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish
  • ๐Ÿ‡ซ๐Ÿ‡ท French
  • ๐Ÿ‡ฉ๐Ÿ‡ช German
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian

๐Ÿ“ฑ Mobile Support

  • ๐Ÿ“ฑ Responsive design
  • ๐Ÿ“ฒ PWA support
  • ๐Ÿ“ฑ Native-like experience
  • ๐Ÿ“ฑ Offline functionality

๐Ÿ”ง Troubleshooting

Common Issues

Click to expand

Installation Issues

# Clear npm cache
npm cache clean --force

# Delete node_modules
rm -rf node_modules

# Reinstall dependencies
npm install

Build Issues

# Clear build cache
npm run clean

# Rebuild
npm run build

Development Issues

# Reset development environment
npm run reset

# Start fresh
npm start

๐Ÿ“ˆ Roadmap

Version 2.0

  • Advanced analytics
  • AI-powered recommendations
  • Voice search
  • AR product preview

Version 2.1

  • Multi-vendor support
  • Subscription system
  • Advanced reporting
  • Mobile app

Built with โค๏ธ by the Bakery Team
Made with React and Firebase

About

E-commerce Platform for Bakery Business

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages