Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed AI-Coding – AI Workspace Platform

A cloud-native Spring Boot Microservices project that provides an AI-powered collaborative workspace platform. The application is built using modern distributed system principles with Spring Cloud, Kafka, Redis, PostgreSQL, MinIO, and Kubernetes to ensure scalability, reliability, and maintainability.


📖 Overview

Distributed Lovable is a microservices-based application designed to provide a secure and scalable workspace management platform. The system enables users to create and manage workspaces, upload files, leverage AI-powered features, and communicate seamlessly between services using event-driven architecture.

The project follows industry-standard microservices practices including:

  • Service Discovery
  • API Gateway
  • Centralized Configuration
  • JWT Authentication
  • Event-Driven Communication
  • Distributed Caching
  • Object Storage
  • Containerized Deployment

🏗️ Architecture

                           Client
                              │
                              ▼
                       API Gateway
                              │
       ┌───────────────┬───────────────┬───────────────┐
       ▼               ▼               ▼
 Account Service   Workspace Service   Intelligence Service
       │               │               │
       └───────────────┼───────────────┘
                       ▼
                 PostgreSQL Databases

        ▲
        │
 Eureka Discovery Server

        ▲
        │
 Config Server

Redis  ← Caching

Kafka  ← Event Streaming

MinIO  ← Object Storage

Kubernetes ← Deployment

✨ Features

  • User Registration & Authentication
  • JWT-based Authorization
  • Workspace Management
  • AI-powered Workspace Assistance
  • File Upload & Storage
  • Event-Driven Architecture with Kafka
  • Redis Caching
  • Service Discovery using Eureka
  • API Gateway Routing
  • Centralized Configuration
  • Kubernetes Deployment
  • Docker Image Generation using Jib

🛠️ Tech Stack

Backend

  • Java 21+
  • Spring Boot
  • Spring Security
  • Spring Data JPA
  • Spring Cloud

Microservices

  • Spring Cloud Gateway
  • Eureka Discovery Server
  • Spring Cloud Config

Database

  • PostgreSQL

Cache

  • Redis

Messaging

  • Apache Kafka

AI Integration

  • Spring AI
  • OpenAI API

File Storage

  • MinIO (S3 Compatible)

Deployment

  • Docker
  • Kubernetes
  • Google Jib

Additional Libraries

  • OpenFeign
  • MapStruct
  • Bean Validation
  • Lombok
  • Maven

📂 Project Structure

distributed-lovable/
│
├── account-service/
├── workspace-service/
├── intelligence-service/
├── gateway-service/
├── discovery-service/
├── config-service/
├── common/
├── kubernetes/
├── docker/
└── pom.xml

⚙️ Microservices

🔹 Discovery Service

Acts as the service registry where every microservice registers itself.

Responsibilities

  • Service Registration
  • Service Discovery
  • Dynamic Load Balancing

🔹 Config Service

Provides centralized configuration for all services.

Responsibilities

  • Externalized Configuration
  • Environment-specific Properties
  • Configuration Management

🔹 API Gateway

Single entry point for all client requests.

Responsibilities

  • Routing
  • Authentication
  • Authorization
  • JWT Validation
  • Request Filtering
  • Load Balancing

🔹 Account Service

Manages user-related operations.

Features

  • User Registration
  • Login
  • Authentication
  • Authorization
  • User Profile Management
  • JWT Token Generation

🔹 Workspace Service

Handles workspace management.

Features

  • Create Workspace
  • Update Workspace
  • Delete Workspace
  • File Management
  • Redis Caching
  • Kafka Event Publishing

🔹 Intelligence Service

Provides AI-powered functionalities.

Features

  • AI Chat
  • Code Assistance
  • Content Generation
  • Smart Suggestions
  • Workspace Intelligence

🔹 Common Module

Contains reusable components shared across all services.

Examples include:

  • DTOs
  • Exception Handling
  • Security Utilities
  • JWT Utilities
  • Common Response Classes
  • Shared Models

🔐 Security

Authentication is implemented using:

  • Spring Security
  • JWT (JSON Web Token)

Authentication Flow

User Login
      │
      ▼
Account Service
      │
      ▼
Generate JWT
      │
      ▼
Client Stores Token
      │
      ▼
API Gateway Validates Token
      │
      ▼
Protected Services

📦 Event-Driven Architecture

Apache Kafka is used for asynchronous communication.

Example:

Workspace Created
        │
        ▼
Kafka Event
        │
        ▼
Intelligence Service
        │
        ▼
AI Processing
        │
        ▼
Save Result

⚡ Redis Caching

Redis is used to improve application performance.

Benefits:

  • Faster Response Time
  • Reduced Database Load
  • Frequently Accessed Data
  • Session Management

📁 File Storage

MinIO provides object storage for:

  • Images
  • Documents
  • PDFs
  • Project Files
  • Workspace Assets

☸️ Kubernetes Deployment

The application is deployment-ready using Kubernetes.

Deployment includes:

  • Deployments
  • Services
  • ConfigMaps
  • Secrets
  • Ingress
  • Autoscaling Support

🔄 Request Flow

Client
   │
   ▼
API Gateway
   │
   ▼
JWT Authentication
   │
   ▼
Workspace Service
   │
   ├── PostgreSQL
   ├── Redis
   ├── MinIO
   └── Kafka Event
             │
             ▼
    Intelligence Service
             │
             ▼
         OpenAI API

🚀 Getting Started

Prerequisites

  • Java 21+
  • Maven
  • PostgreSQL
  • Redis
  • Apache Kafka
  • MinIO
  • Docker
  • Kubernetes (Optional)

Build Project

mvn clean install

Run Services

Start services in the following order:

  1. Config Service
  2. Discovery Service
  3. API Gateway
  4. Account Service
  5. Workspace Service
  6. Intelligence Service

📊 Technologies Used

Technology Purpose
Spring Boot Backend Framework
Spring Cloud Microservices
Eureka Service Discovery
Gateway API Gateway
PostgreSQL Database
Redis Cache
Kafka Messaging
OpenFeign Service Communication
Spring Security Authentication
JWT Authorization
MinIO File Storage
Kubernetes Container Orchestration
Docker Containerization
Jib Docker Image Build
OpenAI AI Integration

📈 Future Enhancements

  • CI/CD Pipeline
  • Monitoring with Prometheus & Grafana
  • Distributed Tracing with Zipkin
  • ELK Stack Logging
  • WebSocket Notifications
  • Role-Based Access Control (RBAC)
  • Multi-Tenant Support
  • AI Workflow Automation

👨‍💻 Author

Vishnu

Java Backend Developer | Spring Boot | Microservices | DevOps Enthusiast


📄 License

This project is licensed under the MIT License.


⭐ Support

If you found this project useful, consider giving it a ⭐ on GitHub. It helps others discover the project and motivates future improvements!

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages