Skip to content

OpsFlow - A manager for all the tasks for your team. Developed on microservice-architecture

Notifications You must be signed in to change notification settings

badripaudel77/OpsFlow

Repository files navigation

OpsFlow - Real-Time Release Management System

A distributed microservices-based release management platform with event-driven architecture, real-time collaboration, and comprehensive monitoring.


πŸ‘₯ Contributors


πŸ—οΈ Architecture

The system consists of the following services:

  • API Gateway (Port 8085) - Single entry point with API versioning (/api/v1/)
  • Auth Service (Port 8082) - Authentication and user management
  • Release Service (Port 8081) - Release and task workflow management
  • Notification Service (Port 8083) - Event-driven notifications
  • Discussion Service (Port 8086) - Threaded discussions and comments for releases/tasks
  • Chatbot Service (Port 8084) - AI-powered assistant using Ollama (llama3.2:1b)
  • Ollama (Port 11434) - Local LLM inference server
  • MongoDB (Port 27017) - Primary database
  • Kafka (Port 9094) - Event streaming backbone
  • Kafka UI (Port 8080) - Kafka management interface
  • Prometheus (Port 9090) - Metrics collection
  • Grafana (Port 3000) - Monitoring dashboards
  • Mongo Express (Port 8888) - Web interface to interact with the Mongo DB

Architecture

High Level Workflow

High_Level_Workflow

Detailed Architecture

Architecture

Entities

Entities

πŸ“‹ Prerequisites

Before running the application, ensure you have the following installed:

  • Docker (version 20.10 or higher)
  • Docker Compose (version 2.0 or higher)
  • Git (for cloning the repository)

Check your installations:

docker --version
docker compose version

πŸš€ Getting Started

Step 1: Clone the Repository

git clone <repository-url>
cd OpsFlow

Step 2: Create Environment File

Create a .env file in the root directory for environment-specific configurations:

cp .env.example .env

Update any necessary environment variables. This file is used by the docker compose.

Step 3: Build the Services

Build all Docker images:

docker compose build

This will:

  • Build Docker images for all microservices
  • Download required base images (Java 21, MongoDB, Kafka, etc.)
  • Compile and package Spring Boot applications

Note: First build may take 5-10 minutes depending on your internet connection.

Step 4: Start the Services

Start all services in detached mode:

docker compose up -d

To view logs while starting:

docker compose up

Step 5: Verify Services are Running

Check the status of all services:

docker compose ps

All services should show as "healthy" or "running". Services with health checks may take 30-60 seconds to become healthy.

View logs for a specific service:

docker compose logs -f <service-name>

# Examples:
docker compose logs -f api-gateway
docker compose logs -f auth-service
docker compose logs -f release-service

🌐 Accessing the Services

Once all services are running, you can access them at:

Application Services

  • API Gateway: http://localhost:8085
    • All API requests should go through this endpoint
    • Example: http://localhost:8085/api/v1/auth/login

Health Checks

Check service health:

# API Gateway
curl http://localhost:8085/actuator/health

# Auth Service
curl http://localhost:8082/actuator/health

# Release Service
curl http://localhost:8081/actuator/health

# Notification Service
curl http://localhost:8083/actuator/health

# Discussion Service
curl http://localhost:8086/actuator/health

# Chatbot Service
curl http://localhost:8084/actuator/health

πŸ› οΈ Development Commands

Stop All Services

docker compose down

Stop and Remove Volumes (Clean Reset)

docker compose down -v

Warning: This will delete all database data!

Rebuild a Specific Service

docker compose build <service-name>
docker compose up -d <service-name>

# Example:
docker compose build api-gateway
docker compose up -d api-gateway

View Service Logs

# Follow logs for all services
docker compose logs -f

# Follow logs for specific service
docker compose logs -f api-gateway

# View last 100 lines
docker compose logs --tail=100 release-service

Restart a Service

docker compose restart <service-name>

# Example:
docker compose restart auth-service

πŸ“Š API Documentation

Base URL

All API requests should use the API Gateway:

http://localhost:8085/api/v1

Authentication Endpoints

# Register a new user
POST http://localhost:8085/api/v1/auth/register

# Login
POST http://localhost:8085/api/v1/auth/login

Release Endpoints

# Get all releases
GET http://localhost:8085/api/v1/releases

# Create a release
POST http://localhost:8085/api/v1/releases

# Get release by ID
GET http://localhost:8085/api/v1/releases/{id}

Discussion Endpoints

# Get all discussions (without comments, includes commentCount)
GET http://localhost:8085/api/v1/discussions

# Create a new discussion
POST http://localhost:8085/api/v1/discussions
Body: {
  "title": "Discussion title",
  "content": "Discussion content",
  "releaseId": "release-123",
  "authorId": "user-456",
  "authorName": "John Doe"
}

# Get discussion by ID
GET http://localhost:8085/api/v1/discussions/{discussionId}

# Get discussions by release
GET http://localhost:8085/api/v1/discussions/release/{releaseId}

# Get discussions by task
GET http://localhost:8085/api/v1/discussions/task/{taskId}

# Resolve a discussion
POST http://localhost:8085/api/v1/discussions/{discussionId}/resolve
Header: X-User-Id: user-123

# Add a top-level comment to a discussion
POST http://localhost:8085/api/v1/discussions/{discussionId}/comments
Body: {
  "content": "Comment text",
  "authorId": "user-789",
  "authorName": "Jane Doe"
}

# Reply to an existing comment (nested/threaded - like Reddit)
POST http://localhost:8085/api/v1/discussions/{discussionId}/comments
Body: {
  "content": "Reply text",
  "authorId": "user-789",
  "authorName": "Jane Doe",
  "parentId": "parent-comment-id"
}

# Alternative: Reply to a comment using path parameter
POST http://localhost:8085/api/v1/discussions/{discussionId}/comments/{commentId}/replies
Body: {
  "content": "Reply text",
  "authorId": "user-789",
  "authorName": "Jane Doe"
}

# Get all comments (threaded view with nested replies)
GET http://localhost:8085/api/v1/discussions/{discussionId}/comments

# Get comments in flat list (no nesting)
GET http://localhost:8085/api/v1/discussions/{discussionId}/comments/flat

# Get replies for a specific comment
GET http://localhost:8085/api/v1/discussions/{discussionId}/comments/{commentId}/replies

# Get a specific comment
GET http://localhost:8085/api/v1/discussions/{discussionId}/comments/{commentId}

# Delete a comment (soft-delete if has replies, hard-delete otherwise)
DELETE http://localhost:8085/api/v1/discussions/{discussionId}/comments/{commentId}
Header: X-User-Id: user-123

Nested Comments Behavior:

  • Comments support unlimited nesting depth (up to 10 levels)
  • Deleting a comment with replies performs a soft-delete (content becomes [deleted])
  • Deleting a comment without replies removes it completely
  • Each comment includes a depth field (0 for top-level)
  • Each comment includes a replies array containing nested responses

Chatbot Endpoints

# Create a new chat session
POST http://localhost:8085/api/v1/chat/session
Body: {
  "userId": "user-123",
  "releaseId": "release-456"  # Optional
}

# Send a message to the chatbot
POST http://localhost:8085/api/v1/chat/{sessionId}/message
Body: {
  "message": "What are the pending tasks?"
}

# Get chat history
GET http://localhost:8085/api/v1/chat/{sessionId}/history

# Get all user chat sessions
GET http://localhost:8085/api/v1/chat/sessions?userId={userId}

MongoDB Interaction

# Connect to MongoDB container
docker exec -it mongodb mongosh

# Inside mongosh:
show dbs
use flow_ops_db
show collections

About

OpsFlow - A manager for all the tasks for your team. Developed on microservice-architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors