Skip to content

Mj9909/cloud-native-first-contribution

Repository files navigation

☁️ cloud-native-first-contribution

A beginner-friendly project to help you make your first open-source contribution in a cloud-native environment.

License: MIT Node.js Docker Kubernetes


📖 Project Overview

This project is a minimal Node.js / Express HTTP server that demonstrates the full cloud-native journey — from running locally to packaging with Docker to deploying on Kubernetes.

It is intentionally simple so that first-time contributors can focus on the contribution workflow rather than complex application logic.


🏗️ Architecture

Your Code (Node.js / Express)
        │
        ▼
  ┌─────────────┐
  │   Docker    │  ← Packages the app + its dependencies into a portable image
  └──────┬──────┘
         │
         ▼
  ┌─────────────────────────────────────┐
  │           Kubernetes Cluster        │
  │                                     │
  │  ┌─────────────┐  ┌─────────────┐  │
  │  │  Deployment │  │   Service   │  │
  │  │  (runs pod) │  │  (port 80)  │  │
  │  └─────────────┘  └─────────────┘  │
  └─────────────────────────────────────┘
Layer Tool Purpose
Application Node.js + Express + React (Vite) Web UI at /, JSON health at /health
Container Docker (node:18-alpine) Portable, reproducible runtime environment
Orchestration Kubernetes Manages deployment, scaling, and networking

📁 Project Structure

cloud-native-first-contribution/
│
├── app/
│   └── server.js          # Express HTTP server (serves SPA + /health)
│
├── client/                # Vite + React landing UI (Radix UI, Framer Motion)
│   ├── src/
│   └── package.json
│
├── k8s/
│   ├── deployment.yaml    # Kubernetes Deployment manifest
│   └── service.yaml       # Kubernetes Service manifest (ClusterIP)
│
├── package.json           # Node.js project metadata & dependencies
├── Dockerfile             # Instructions to build the Docker image
├── .dockerignore          # Files excluded from the Docker build context
├── README.md              # You are here 👋
├── CONTRIBUTING.md        # How to contribute to this project
└── CODE_OF_CONDUCT.md     # Community guidelines

🚀 API Endpoints

Method Endpoint Response
GET / CNCF Lucknow chapter landing page (static SPA)
GET /health { "status": "ok" }

⚙️ Setup & Running

Prerequisites

Make sure you have the following installed:


1. Run Locally (without Docker)

# Clone the repository
git clone https://github.com/YOUR_USERNAME/cloud-native-first-contribution.git
cd cloud-native-first-contribution

# Install dependencies (root server + client UI)
npm install
npm install --prefix client

# Build the frontend, then start the server
npm run build
npm start

For UI development with hot reload, run the Vite dev server in another terminal:

npm run dev:client

Then open the URL Vite prints (usually http://localhost:5173). The production-style stack uses Express after npm run build + npm start on port 3000.

Open your browser at http://localhost:3000

Test the health endpoint:

curl http://localhost:3000/health
# → {"status":"ok"}

2. Build the Docker Image

# Build the image and tag it
docker build -t cloud-native-first-contribution:latest .

3. Run the Docker Container

# Run the container and map port 3000 on your machine to port 3000 in the container
docker run -p 3000:3000 cloud-native-first-contribution:latest

Open http://localhost:3000 — same app, now running inside Docker! 🐳


4. Deploy to Kubernetes

# Apply the Deployment (creates and manages the pod)
kubectl apply -f k8s/deployment.yaml

# Apply the Service (exposes the pod inside the cluster)
kubectl apply -f k8s/service.yaml

# Check the pod is running
kubectl get pods

# Check the service
kubectl get services

To access the app from your local machine, use port-forward:

kubectl port-forward service/cloud-native-service 8080:80

Then open http://localhost:8080 🎉


🤝 Contributing

We welcome all contributions — no matter how small! Check out CONTRIBUTING.md to get started.

Look for issues labelled good first issue — they are hand-picked for first-time contributors.


📜 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors