An open API service indexing awesome lists of open source software.

https://github.com/deepak748030/savana

Scalable and modular ecommerce backend built with Node.js, Express, MongoDB, Swagger, Docker, and Kubernetes β€” designed for performance, security, and maintainability.
https://github.com/deepak748030/savana

api-documentation backend docker ecommerce express grafana jwt-authentication kubernetes microservices mongodb multer nginx nodejs prometheus rest-api swagger

Last synced: 3 months ago
JSON representation

Scalable and modular ecommerce backend built with Node.js, Express, MongoDB, Swagger, Docker, and Kubernetes β€” designed for performance, security, and maintainability.

Awesome Lists containing this project

README

          

# πŸš€ Savana Ecommerce Backend


Node.js
Express.js
MongoDB
Docker
Kubernetes


πŸ›’ Full Production-Ready Backend with Kubernetes Support and Swagger


Live Swagger API: http://your-domain.com/api-docs


---

## πŸ“– Table of Contents

- [🌟 Features](#-features)
- [πŸ› οΈ Technology Stack](#️-technology-stack)
- [πŸš€ Getting Started](#-getting-started)
- [βš™οΈ Kubernetes Setup](#%EF%B8%8F-kubernetes-setup)
- [πŸ“ Project Structure](#-project-structure)
- [🌐 Deployment](#-deployment)
- [πŸ§ͺ API Testing](#-api-testing)
- [πŸ“„ License](#-license)
- [πŸ‘¨β€πŸ’» Author](#-author)

---

## 🌟 Features

- βš™οΈ Modular Express Backend (routes, controllers, services)
- 🧩 Category & Product CRUD APIs
- πŸ“€ Image Upload via Multer
- πŸ” Product Search and Filter by Category
- 🌍 MongoDB Integration (external URI)
- πŸ“š Swagger API Docs (`/api-docs`)
- πŸ“¦ Prometheus Metrics Ready (for Grafana)
- 🧱 Dockerized with Node 22 Alpine
- ☸️ Kubernetes with Ingress & NGINX
- πŸ“‚ Public static file support via `/uploads`
---

## πŸ› οΈ Technology Stack

- **Node.js & Express.js** – Backend framework
- **MongoDB** – No internal DB pod, external URI-based
- **Multer** – File handling
- **Swagger** – Auto API documentation
- **Docker** – Containerization
- **Kubernetes** – Orchestration & scaling
- **NGINX + Ingress** – Domain + SSL route config

---

## πŸš€ Getting Started

### πŸ“¦ Prerequisites

- Node.js >= 16
- Docker & Kubernetes (Minikube or cluster)
- MongoDB Atlas URI

### πŸ”§ Setup Locally

```bash
git clone https://github.com/deepak748030/savana.git
cd savana

npm install
cp .env.exports.js .env # Rename and fill your Mongo URI

npm run dev
````

Visit Swagger: [http://localhost:5000/api-docs](http://localhost:5000/api-docs)

---

## βš™οΈ Kubernetes Setup

### βœ… Files

* `k8s/deployment.yaml`
* `k8s/service.yaml`
* `k8s/ingress.yaml`
* `k8s/nginx-ingress.yaml`

### 🧠 Commands

```bash
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/nginx-ingress.yaml
kubectl apply -f k8s/ingress.yaml
```

> Ensure `Ingress` is enabled in Minikube:

```bash
minikube addons enable ingress
```

---

## πŸ“ Project Structure

```
.
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ config/ # DB and env setup
β”‚ β”œβ”€β”€ controllers/ # Logic for API endpoints
β”‚ β”œβ”€β”€ models/ # Mongoose models
β”‚ β”œβ”€β”€ routes/ # API routes
β”‚ β”œβ”€β”€ uploads/ # Image uploads
β”‚ β”œβ”€β”€ utils/ # Helpers
β”‚ β”œβ”€β”€ swagger/ # Swagger config
β”‚ └── app.js # Express app config
β”œβ”€β”€ server.js # Server entry point
β”œβ”€β”€ k8s/ # Kubernetes manifests
β”œβ”€β”€ Dockerfile # Docker container config
β”œβ”€β”€ .env.exports.js # Sample env file
β”œβ”€β”€ package.json
└── README.md
```

---

## 🌐 Deployment

### 🐳 Docker Build & Push

```bash
docker build -t yourdockerhub/savana-backend .
docker push yourdockerhub/savana-backend
```

### ☸️ Deploy to Kubernetes

```bash
kubectl apply -f k8s/
```

Access via: `http:///api-docs` after setting ingress.

---

## πŸ§ͺ API Testing

* **Docs:** `GET /api-docs`
* **File Uploads:** `POST /api/upload`
* **Protected Routes:** Use `Authorization: Bearer `
* **Metrics (for Prometheus):** `GET /metrics`

---

## πŸ“„ License

MIT License

```
Β© 2025 Deepak Kushwah

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
```

---

## πŸ‘¨β€πŸ’» Author

**Deepak Kushwah**
Full Stack Developer (MERN + DevOps)

* πŸ“§ [deepak748930@gmail.com](mailto:deepak748930@gmail.com)
* πŸ”— [LinkedIn](https://linkedin.com/in/deepak-kushwah)
* πŸ’» [GitHub](https://github.com/deepak748030)

> ⭐ Star this repo if you found it useful!
> πŸ”— [https://github.com/deepak748030/savana](https://github.com/deepak748030/savana)