React / Express.js / Sequelize / PostgreSQL codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with React / Express.js / Sequelize / PostgreSQL including CRUD operations, authentication, routing, pagination, and more.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
- Make sure your have a Node.js (v14 or newer) installed.
- Make sure you have your database setup.
Install all the npm dependencies with the following command:
npm installIn the backend directory, duplicate and remane the.env.example file, name it .env, and modify it to set all the required private development environment variables.
Optionally you can run the following command to populate your database with some dummy data:
npx -w backend sequelize-cli db:seed:all
Start the development environment with the following command:
npm run dev-
The frontend website should be available at http://localhost:3000/.
-
The backend API should be available at http://localhost:3001/api.
To run the tests, run the following command:
npm testThe following command will build the production version of the app:
npm startcd .ergomake
docker compose up --build -dminikube start
minikube addons enable ingresseval "$(minikube docker-env)"
docker build -t backend:latest ./backend
docker build -t frontend:latest ./frontendkubectl apply -f .ergomake/k8s-manifests.yamlminikube ip
# Visit: http://<minikube-ip>/
kubectl get pods -w
# Option A — minikube service (simple)
minikube service frontend --url
# Open the printed URL (e.g., http://127.0.0.1:46143) and keep this terminal open
# Option B — Port-forward the Ingress controller
kubectl -n ingress-nginx port-forward svc/ingress-nginx-controller 8080:80
# Then open http://localhost:8080
# Test API: curl -s http://localhost:8080/api/tags
# Option C — LoadBalancer + tunnel (persistent)
kubectl -n ingress-nginx patch svc ingress-nginx-controller -p '{"spec":{"type":"LoadBalancer"}}'
sudo -E minikube tunnel
kubectl -n ingress-nginx get svc ingress-nginx-controller # note EXTERNAL-IP
# Open http://<EXTERNAL-IP>/
# Quick sanity checks
kubectl get ingress
kubectl get ep frontend backend# Use Minikube’s Docker
eval "$(minikube docker-env)"
# Rebuild image with prom-client included
docker build -t backend:latest ./backend
# Restart the deployment to pick up the new image
kubectl rollout restart deploy/backend
kubectl rollout status deploy/backenddocker pull docker.io/grafana/grafana:12.2.0
docker pull quay.io/prometheus/prometheus:v3.7.1
docker pull quay.io/prometheus-operator/prometheus-config-reloader:v0.86.1
docker pull quay.io/prometheus-operator/prometheus-operator:v0.86.1
docker pull quay.io/prometheus/node-exporter:v1.9.1
docker pull registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.17.0
docker pull quay.io/kiwigrid/k8s-sidecar:1.30.10
docker pull quay.io/prometheus/alertmanager:v0.28.1
# Load them into the Minikube node
minikube image load docker.io/grafana/grafana:12.2.0
minikube image load quay.io/prometheus/prometheus:v3.7.1
minikube image load quay.io/prometheus-operator/prometheus-config-reloader:v0.86.1
minikube image load quay.io/prometheus-operator/prometheus-operator:v0.86.1
minikube image load quay.io/prometheus/node-exporter:v1.9.1
minikube image load registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.17.0
minikube image load quay.io/kiwigrid/k8s-sidecar:1.30.10
minikube image load quay.io/prometheus/alertmanager:v0.28.1
# Bounce the stuck pods to pick up local images
kubectl -n monitoring delete pod -l app.kubernetes.io/name=grafana
kubectl -n monitoring delete pod -l app.kubernetes.io/name=prometheus
kubectl -n monitoring delete pod -l app.kubernetes.io/name=alertmanager
# Watch until Ready
kubectl -n monitoring get pods -w
# Re-apply k8s after edits
kubectl apply -f .ergomake/k8s-manifests.yaml
kubectl apply -f .ergomake/monitoring/servicemonitors.yaml
# install helm
sudo snap install helm --classic
# Install kube-prometheus-stack (Prometheus+Grafana)
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade --install kps prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace
kubectl -n monitoring get pods
kubectl -n monitoring get svc
# Prometheus UI
kubectl -n monitoring port-forward svc/kps-kube-prometheus-stack-prometheus 9090:9090
# Grafana UI (default admin/prom-operator)
kubectl -n monitoring port-forward svc/kps-grafana 3000:80
kubectl -n monitoring get secret kps-grafana -o jsonpath='{.data.admin-user}' | base64 -d; echo
kubectl -n monitoring get secret kps-grafana -o jsonpath='{.data.admin-password}' | base64 -d; echo