Skip to content

anirudh-svg/devops-project

Repository files navigation

AI Quote Forge

A web application that generates motivational quotes using a lightweight AI text-generation API. This project demonstrates end-to-end DevOps automation, containerization, deployment, and monitoring using modern tools.

Project Overview

Frontend: React.js with Tailwind CSS (dark mode, minimal and aesthetic UI)

Backend: Flask (Python)

API Endpoint: /quote — calls an AI text-generation API (Hugging Face or OpenAI) and returns a 1–2 sentence motivational quote

Focus Areas: DevOps automation, observability, and CI/CD integration

DevOps Components

Category Tool / Service Purpose Version Control Git + GitHub Manage source code and trigger workflows CI/CD Pipeline GitHub Actions Automate testing, Docker build, and Kubernetes deployment Containerization Docker Create isolated environments for frontend and backend Orchestration Kubernetes (Minikube) Manage multi-container deployment Monitoring Prometheus + Grafana Track metrics like CPU, memory, request latency Logging ELK Stack (Elasticsearch, Logstash, Kibana) Centralized log management Alerting Slack Integration Send alerts when Flask API is down or fails health checks

Architecture Diagram

A[GitHub Repo] --> B[GitHub Actions CI/CD] B --> C[Docker Build & Push] C --> D[Kubernetes Cluster] D --> E[Prometheus + Grafana] D --> F[ELK Stack] F --> G[Slack Alerts]

Getting Started

Prerequisites

Docker & Docker Compose

Kubernetes (Minikube for local testing)

Git

Node.js & Python (if you want to run locally without containers)

Local Development

Clone the repository

git clone https://github.com/yourusername/ai-quote-forge.git cd ai-quote-forge

Run both frontend and backend using Docker Compose

docker-compose up --build

Frontend: http://localhost:5173

Backend API: http://localhost:5000/quote

Deployment (via GitHub Actions)

Every push to the main branch triggers an automated pipeline that:

Runs linting and tests

Builds Docker images

Pushes images to Docker Hub

Deploys to Kubernetes using manifests from /k8s

You can manually apply Kubernetes manifests if needed:

kubectl apply -f k8s/

Monitoring & Logging

Service URL Description Prometheus http://localhost:9090 Collects metrics from containers Grafana http://localhost:3000 Visualizes real-time metrics Kibana http://localhost:5601 View and search logs Slack Alerts Configurable webhook Sends downtime notifications

Project Structure

AI-Quote-Forge/ ├── backend/ │ ├── app.py │ ├── requirements.txt │ ├── Dockerfile ├── frontend/ │ ├── src/ │ ├── package.json │ ├── Dockerfile ├── k8s/ │ ├── deployment.yaml │ ├── service.yaml │ ├── configmap.yaml ├── .github/ │ └── workflows/ │ └── ci-cd.yml ├── docker-compose.yml ├── prometheus.yml ├── grafana-dashboard.json └── README.md

Testing

Run backend unit tests before pushing:

pytest

The GitHub Actions pipeline will automatically re-run these tests during CI.

Future Improvements

Add caching for frequent quote requests

Integrate a database (PostgreSQL) for storing generated quotes

Deploy on a managed Kubernetes service (GKE, EKS, or AKS)

Add OAuth-based authentication for advanced users

Author

Anirudh M Passionate about DevOps, AI, and building scalable systems.

About

A project to explore and understand devop tools (Docker and Mini Kubes)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published