Skip to content

A production-ready platform to provision isolated WooCommerce stores on Hybrid Kubernetes clusters (Minikube & Azure.

Notifications You must be signed in to change notification settings

chetannn-github/store-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

162 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Auto Store Builder

Auto Store Builder is a fully automated e-commerce store provisioning platform built using:

  • Docker
  • Kubernetes (Minikube / K3s)
  • Helm
  • Nginx Ingress
  • Node.js (Backend)
  • Next.js (Frontend)

Status Tech

Users can create two types of stores:

  1. WordPress (WooCommerce)
  2. Medusa JS (Headless Commerce)

🏗 Store Creation (How It Works)

When a user clicks "Create Store", the system automatically:

  1. Executes a Helm command from the backend
  2. Creates Kubernetes resources (Pod, Service, Ingress)
  3. Maps domain dynamically
  4. Generates admin credentials
  5. Makes the store live

No manual DevOps work required.


🏪 Store Types

1️⃣ WordPress (WooCommerce)

  • WooCommerce plugin pre-installed in Docker image
  • Admin credentials auto-generated
  • Ready-to-use after deployment

Example (slug: papa):

Customer: https://papa.instaconnector.in

Admin: https://papa.instaconnector.in/wp-admin


2️⃣ Medusa JS (Headless Store)

Deployment Flow:

  1. Backend Admin deployed
  2. Admin credentials auto-created
  3. Publishable key generated
  4. Frontend connected via publishable key

Example (slug: papa):

API: https://api-papa.instaconnector.in

Admin: https://admin-papa.instaconnector.in/app

Storefront: https://papa.instaconnector.in



🖥 1️⃣ Local Deployment (Minikube)

Used for development and testing.

Prerequisites

docker --version
node -v
npm -v
kubectl version --client
minikube version

Start Minikube

minikube start --driver=docker
minikube addons enable ingress

Verify:

kubectl get nodes
kubectl get pods -A

Enable Tunnel

minikube tunnel

Install Helm

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm version

Run Backend

cd server
npm install
npm start

Test:

curl http://localhost:5000

Run Frontend

cd client
npm install
npm run dev

Open:

http://localhost:3000


Deploy Store Locally

helm install papa ./charts/store --set ingress.host=papa.local

Check:

kubectl get pods
kubectl get ingress

Local Debugging

kubectl describe pod <pod-name>
kubectl logs <pod-name>
minikube dashboard


☁️ 2️⃣ Production Deployment (Azure VM + K3s)

Production runs on a single Azure VM.

Components:

  • Next.js Frontend
  • Node.js Backend
  • K3s (Kubernetes)
  • Nginx (Reverse Proxy)
  • Ingress-Nginx
  • Helm

Step 1: VM Preparation

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git nginx net-tools

Step 2: Install Node.js & PM2

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g pm2

Start apps:

pm2 start npm --name "backend" -- start
pm2 start npm --name "frontend" -- start
pm2 save
pm2 startup

Step 3: Install K3s

curl -sfL https://get.k3s.io | sh -s - --disable traefik
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl get nodes

Step 4: Install Ingress Controller

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
kubectl get pods -n ingress-nginx

Step 5: Install Helm

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm version

Step 6: Configure Nginx

sudo nano /etc/nginx/sites-available/[your-site-domain]
sudo ln -s /etc/nginx/sites-available/[your-site-domain] /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Step 7: Setup SSL

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d instaconnector.in
sudo certbot certonly --manual --preferred-challenges dns -d "*.instaconnector.in"

Azure Firewall Rules

Allow:

  • 22 (SSH)
  • 80 (HTTP)
  • 443 (HTTPS)

⚙️ Automation Summary

The platform automatically provisions isolated container-based e-commerce stores using Kubernetes and Helm, with dynamic domain routing via Nginx Ingress.

About

A production-ready platform to provision isolated WooCommerce stores on Hybrid Kubernetes clusters (Minikube & Azure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published