Skip to content

Latest commit

ย 

History

66 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ CRM Warranty Microservices Platform

A backend platform built with .NET 8 Web API for managing warranty claims, customers, employees, and products.

The system is designed using a Microservices Architecture, where each service owns its own API, business logic, and PostgreSQL database. This approach allows services to be developed, maintained, and deployed independently.

To improve warranty claim processing, the platform integrates with Groq LLM (Llama 3.3 70B Versatile) to automatically classify customer complaints and assign severity levels based on predefined business rules.


๐Ÿ“Œ Project Overview

image

The platform consists of four domain-focused services.

Service Description
๐Ÿ› ๏ธ WS_CRM Warranty claims, ticket management, monitoring, and AI classification
๐Ÿ“ฆ WS_Catalog Product and spare part management
๐Ÿ‘ค WS_Customer Customer management
๐Ÿง‘โ€๐Ÿ’ผ WS_Employee Employee and sales management

Each service:

  • Has its own API
  • Has its own PostgreSQL database
  • Contains its own business logic
  • Can be deployed independently
  • Maintains clear ownership of its domain

๐Ÿ—๏ธ Architecture

This project follows a Microservices Architecture with a Database-per-Service pattern.

                         Client Applications
                                  โ”‚
                                  โ–ผ

 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚              Microservices              โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   WS_CRM     โ”‚ โ”€โ”€โ”€โ”€โ”€โ–บ CRM_DB
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ WS_Customer  โ”‚ โ”€โ”€โ”€โ”€โ”€โ–บ CUSTOMER_DB
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ WS_Employee  โ”‚ โ”€โ”€โ”€โ”€โ”€โ–บ EMPLOYEE_DB
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ WS_Catalog   โ”‚ โ”€โ”€โ”€โ”€โ”€โ–บ CATALOG_DB
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

For development convenience, all services are maintained in a single repository while preserving service boundaries and independent deployment capability.


๐Ÿ“‚ Project Structure

Example structure inside a service:

Feature
โ”‚
โ”œโ”€โ”€ Activity
โ”‚   โ”œโ”€โ”€ dao
โ”‚   โ”‚   โ”œโ”€โ”€ ActivityRepo.cs
โ”‚   โ”‚   โ”œโ”€โ”€ IActivityRepo.cs
โ”‚   โ”‚   โ””โ”€โ”€ ActivityService.cs
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ dto
โ”‚   โ”‚   โ”œโ”€โ”€ Request DTOs
โ”‚   โ”‚   โ””โ”€โ”€ Response DTOs
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Model
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ActivityController.cs
โ”‚
โ”œโ”€โ”€ Config
โ”œโ”€โ”€ Helper
โ”œโ”€โ”€ Program.cs
โ””โ”€โ”€ appsettings.json

โš™๏ธ Layer Responsibilities

Controller

Responsible for:

  • API endpoints
  • Request handling
  • Response formatting

Service

Responsible for:

  • Business logic
  • Validation
  • Transaction processing
  • AI integration

Repository (DAO)

Responsible for:

  • Database access
  • Data persistence
  • Query execution

DTO

Responsible for:

  • Request contracts
  • Response contracts

๐Ÿ” Security

The platform uses JWT Bearer Authentication.

Features:

  • JWT Authentication
  • Protected API Endpoints
  • Swagger Authorization Support

Authenticated users must provide a valid token before accessing secured endpoints.


๐Ÿค– AI-Powered Warranty Classification

The CRM service integrates with Groq LLM API using Llama 3.3 70B Versatile to assist with warranty complaint classification.

Instead of allowing free-form AI responses, the model is constrained using predefined business rules and structured prompts.

Classification Categories

The AI can only classify complaints into one of the following categories:

  • Hardware Failure
  • Software Issue
  • Installation Problem
  • User Error
  • Cosmetic Damage

Severity Levels

The AI can only assign one of the following severity levels:

  • Low
  • Medium
  • High
  • Critical

Controlled AI Behavior

To improve consistency and reduce random outputs:

  • Temperature is set to 0
  • Categories are predefined
  • Severity levels are predefined
  • AI returns structured JSON only
  • System prompts restrict the model's response format

The model's responsibility is limited to classification based on the complaint text provided by the user.

Example

Input:

{
  "complaint": "Machine produces smoke and cannot start."
}

Output:

{
  "category": "Hardware Failure",
  "severity": "Critical"
}

This approach helps maintain predictable AI responses while supporting support teams in prioritizing warranty cases.


๐Ÿ”ฅ Core Features

๐Ÿ› ๏ธ WS_CRM

  • Warranty Activation
  • Warranty Claim Submission
  • Ticket Management
  • Claim Monitoring
  • AI Complaint Classification
  • Severity Assessment

๐Ÿ“ฆ WS_Catalog

  • Product Management
  • Product Lookup

๐Ÿ‘ค WS_Customer

  • Customer Registration
  • Customer Profile Management
  • Customer Lookup

๐Ÿง‘โ€๐Ÿ’ผ WS_Employee

  • Employee Management
  • Sales Information Management
  • Employee Lookup

๐Ÿ› ๏ธ Technology Stack

Backend

  • .NET 8
  • ASP.NET Core Web API
  • C#

Database

  • PostgreSQL

Authentication

  • JWT Bearer Authentication

AI Integration

  • Groq API
  • Llama 3.3 70B Versatile
  • Structured JSON Responses
  • Temperature 0 Configuration

Documentation

  • Swagger / OpenAPI

Tools

  • Visual Studio Code
  • Git
  • GitHub
  • Docker Containerization (terminal):
    docker compose down
    docker compose build --no-cache        
    docker compose up
    

โญ Technical Highlights

  • .NET 8 Web API
  • Microservices Architecture
  • Database-per-Service Pattern
  • Independent Service Deployment
  • PostgreSQL
  • Layered Architecture
  • Controller โ†’ Service โ†’ Repository Pattern
  • DTO Pattern
  • JWT Authentication
  • Swagger Documentation
  • Groq LLM Integration
  • Controlled AI Classification Workflow
  • Structured JSON AI Responses
  • Separation of Business Logic and API Layer
  • Docker Containerization

๐Ÿš€ Deployment

Each service is designed to be deployed independently.

Since every service owns its own database and business logic, updates can be released without affecting unrelated services.

Examples:

  • Updating WS_Customer does not require redeploying WS_CRM
  • Updating WS_Catalog does not affect WS_Employee
  • Database changes remain isolated within their owning service

๐Ÿ”ฎ Future Improvements

  • API Gateway (YARP / Ocelot)
  • CI/CD Pipeline
  • Centralized Logging
  • Distributed Tracing
  • RabbitMQ / Kafka Integration
  • Unit Testing
  • Integration Testing

๐Ÿ‘จโ€๐Ÿ’ป Author

Salis Aryani

Software Engineer focused on:

  • .NET Development
  • REST API Development
  • PostgreSQL
  • Microservices Architecture
  • Enterprise Applications
  • AI Integration

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages