Skip to content

prakharsinghal151/devops-notes-api

Repository files navigation

DevOps Notes API

A containerized Node.js REST API project built to practice DevOps fundamentals including Docker, Docker Compose, Nginx reverse proxy, GitHub Actions CI/CD, and Docker Hub image publishing.

Features

  • REST API built with Node.js and Express
  • Health check endpoint
  • Notes endpoint with sample data
  • Prometheus metrics endpoint
  • Dockerized application
  • Docker Compose setup
  • Nginx reverse proxy
  • GitHub Actions CI/CD pipeline
  • Automated Docker image build and push to Docker Hub

Tech Stack

  • Node.js
  • Express.js
  • Docker
  • Docker Compose
  • Nginx
  • GitHub Actions
  • Docker Hub
  • Prometheus Client

Project Structure

devops-notes-api/
│
├── .github/
│   └── workflows/
│       └── ci.yml
│
├── src/
│   └── server.js
│
├── Dockerfile
├── docker-compose.yml
├── nginx.conf
├── .dockerignore
├── package.json
├── package-lock.json
└── README.md

API Endpoints

Method Endpoint Description
GET / Returns API running message
GET /health Returns server health status
GET /notes Returns sample notes
GET /metrics Returns Prometheus metrics

Run Locally

Install dependencies:

npm install

Start the server:

npm start

Open:

http://localhost:3000

Run with Docker

Build Docker image:

docker build -t devops-notes-api .

Run container:

docker run -p 3000:3000 devops-notes-api

Open:

http://localhost:3000

Run with Docker Compose and Nginx

Start containers:

docker compose up --build

Open:

http://localhost:8080

Stop containers:

docker compose down

CI/CD Pipeline

This project uses GitHub Actions to automatically:

  1. Checkout the code
  2. Login to Docker Hub
  3. Build the Docker image
  4. Push the image to Docker Hub

Docker Hub image:

prakharsinghal7725/devops-notes-api:latest

Architecture

Developer Push
      ↓
GitHub Repository
      ↓
GitHub Actions
      ↓
Docker Image Build
      ↓
Docker Hub
      ↓
Docker Compose
      ↓
Nginx Reverse Proxy
      ↓
Node.js API Container

Resume Highlight

Built and containerized a Node.js REST API using Docker and Docker Compose, configured Nginx as a reverse proxy, exposed Prometheus metrics, and implemented a GitHub Actions CI/CD pipeline to automatically build and push Docker images to Docker Hub.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors