Skip to content

verifydev-me/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Developer Verification & Recruitment Platform - Microservices Architecture

VerifyDev automatically verifies developer skills by analyzing their GitHub repositories using AI, assigns Aura scores, and connects verified developers with recruiters.


πŸ“‹ Quick Links


πŸ—οΈ Architecture Overview

                                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                    β”‚    Frontend     β”‚
                                    β”‚ (Next.js/React  β”‚
                                    β”‚    Native)      β”‚
                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                             β”‚ JSON/HTTP
                                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           NGINX API GATEWAY                                 β”‚
β”‚                              (Port 8000)                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  β€’ Request Routing         β€’ CORS Handling        β€’ Load Balancing   β”‚  β”‚
β”‚  β”‚  β€’ Rate Limiting           β€’ Security Headers     β€’ Gzip Compression β”‚  β”‚
β”‚  β”‚  β€’ SSL Termination         β€’ Error Handling       β€’ Health Checks    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚ HTTP/JSON (proxy_pass)
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                           β”‚                           β”‚
          β–Ό                           β–Ό                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Auth Service   β”‚       β”‚  User Service   β”‚       β”‚  Job Service    β”‚
β”‚   HTTP :3001    β”‚       β”‚   HTTP :3002    β”‚       β”‚   HTTP :3004    β”‚
β”‚                 β”‚       β”‚   gRPC :50051   β”‚       β”‚                 β”‚
β”‚ β€’ GitHub OAuth  β”‚       β”‚ β€’ User Profile  β”‚       β”‚ β€’ Job Listings  β”‚
β”‚ β€’ JWT Tokens    β”‚       β”‚ β€’ Skills CRUD   β”‚       β”‚ β€’ Applications  β”‚
β”‚ β€’ Sessions      β”‚       β”‚ β€’ Projects      β”‚       β”‚ β€’ Recruiter API β”‚
β”‚ β€’ OTP Auth      β”‚       β”‚ β€’ Experience    β”‚       β”‚ β€’ Messages      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β”‚ ⚑ gRPC (Binary Protocol Buffers)
                                   β”‚    Inter-service communication
                                   β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     Recruiter Service        β”‚
                    β”‚        HTTP :3005            β”‚
                    β”‚        gRPC :50054           β”‚
                    β”‚                              β”‚
                    β”‚  β€’ Candidate Search (gRPC)   β”‚
                    β”‚  β€’ BatchGetUsers (gRPC)      β”‚
                    β”‚  β€’ Profile Fetch (gRPC)      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     Project Analyzer (Go)    β”‚
                    β”‚         (Port 8001)          β”‚
                    β”‚                              β”‚
                    β”‚  β€’ Clone GitHub Repos        β”‚
                    β”‚  β€’ Detect Tech Stack         β”‚
                    β”‚  β€’ AI Analysis (Gemini)      β”‚
                    β”‚  β€’ Extract Skills            β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β”‚ (RabbitMQ)
                                   β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚       Aura Processor         β”‚
                    β”‚                              β”‚
                    β”‚  β€’ Calculate Aura Score      β”‚
                    β”‚  β€’ Update User Stats         β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Recruiter Serviceβ”‚       β”‚ Resume Service  β”‚
β”‚   (Port 3005)   β”‚       β”‚   (Port 8003)   β”‚
β”‚                 β”‚       β”‚                 β”‚
β”‚ β€’ Candidates    β”‚       β”‚ β€’ PDF Generate  β”‚
β”‚ β€’ Interviews    β”‚       β”‚ β€’ Templates     β”‚
β”‚ β€’ Shortlists    β”‚       β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         INFRASTRUCTURE                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚    Redis      β”‚    β”‚   RabbitMQ    β”‚    β”‚   MongoDB (Atlas)     β”‚   β”‚
β”‚  β”‚  (Port 6379)  β”‚    β”‚  (Port 5672)  β”‚    β”‚                       β”‚   β”‚
β”‚  β”‚               β”‚    β”‚               β”‚    β”‚  β€’ Users, Sessions    β”‚   β”‚
β”‚  β”‚ β€’ Sessions    β”‚    β”‚ β€’ Async Jobs  β”‚    β”‚  β€’ Projects, Skills   β”‚   β”‚
β”‚  β”‚ β€’ Cache       β”‚    β”‚ β€’ Events      β”‚    β”‚  β€’ Jobs, Applications β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Protocol Legend:

  • JSON/HTTP - Frontend to Gateway and Gateway to Services
  • ⚑ gRPC - Service-to-Service (low latency, binary)
  • RabbitMQ - Async event-driven communication

πŸš„ Communication Architecture (Hybrid HTTP + gRPC)

The backend uses a Hybrid Communication Pattern optimized for low latency and scalability:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           COMMUNICATION FLOW                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                              β”‚
β”‚   Frontend/Mobile (Next.js, React Native)                                    β”‚
β”‚          β”‚                                                                   β”‚
β”‚          β”‚  JSON/HTTP REST (Human-readable, debuggable)                      β”‚
β”‚          β–Ό                                                                   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚   β”‚              API GATEWAY (Nginx - Port 8000)             β”‚               β”‚
β”‚   β”‚  β€’ CORS Handling      β€’ Rate Limiting    β€’ Load Balance  β”‚               β”‚
β”‚   β”‚  β€’ SSL Termination    β€’ Request Routing  β€’ Compression   β”‚               β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚          β”‚                                                                   β”‚
β”‚          β”‚  HTTP/JSON (proxy_pass) ─ Simple, Compatible                      β”‚
β”‚          β–Ό                                                                   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚   β”‚   Auth   β”‚  β”‚   User   β”‚  β”‚   Job    β”‚  β”‚  Recruiter   β”‚                β”‚
β”‚   β”‚ :3001    β”‚  β”‚ :3002    β”‚  β”‚ :3004    β”‚  β”‚   :3005      β”‚                β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                      β”‚                             β”‚                         β”‚
β”‚                      β”‚   gRPC (Binary Protocol Buffers)                      β”‚
β”‚                      β”‚   ⚑ Low latency, High throughput                     β”‚
β”‚                      β–Ό                             β”‚                         β”‚
β”‚               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                       β”‚                         β”‚
β”‚               β”‚ gRPC :50051β”‚β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β”‚               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                 β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why This Architecture?

Layer Protocol Why?
Frontend β†’ Gateway JSON/HTTP Human-readable, debuggable, browser-native
Gateway β†’ Services HTTP/JSON Nginx compatibility, simple routing, easy monitoring
Service ↔ Service gRPC ⚑ Binary protocol, 10x faster, streaming, strict contracts

gRPC Implementation (Service-to-Service)

gRPC is used for internal service communication where performance matters most:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     gRPC     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Recruiter Service  β”‚ ───────────► β”‚   User Service     β”‚
β”‚     :3005          β”‚  (Binary)    β”‚     :50051         β”‚
β”‚                    β”‚              β”‚                    β”‚
β”‚ β€’ BatchGetUsers()  β”‚              β”‚ β€’ GetUser()        β”‚
β”‚ β€’ SearchCandidates β”‚              β”‚ β€’ BatchGetUsers()  β”‚
β”‚ β€’ GetUserProfile() β”‚              β”‚ β€’ SearchCandidates β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Benefits of gRPC for Internal Calls:

  • ⚑ 10x Lower Latency: Binary Protocol Buffers vs JSON parsing
  • πŸ“¦ Smaller Payload: ~30% smaller than JSON
  • πŸ“‹ Strict Contracts: Proto files are the single source of truth
  • πŸ”„ Streaming: Bi-directional streaming for real-time updates
  • πŸ” Built-in Retries: Automatic retry with exponential backoff

Core Components

  1. Proto Definitions (backend/proto/)

    • Source of truth for service-to-service contracts
    • Organized by domain: user/, job/, recruiter/, common/
    • Dynamic loading with @grpc/proto-loader (no compilation step)
  2. Shared Utilities (backend/shared/)

    • GrpcServer: Standardized server setup with keepalive, error handling
    • GrpcClient: Connection pooling, automatic retries, timeouts
    • GrpcClientPool: Singleton pattern for connection reuse
  3. Port Configuration

    Service HTTP Port gRPC Port
    User Service 3002 50051
    Recruiter Service 3005 50054
    Job Service 3004 50052*

    *Planned

Implementation Example

Recruiter Service calling User Service via gRPC:

// recruiter-service/src/grpc/user-client.ts
import { GrpcClient } from '../../../shared/grpc-client';

const userClient = new GrpcClient(UserServiceProto, {
  address: 'user-service:50051',
  serviceName: 'UserService',
  maxRetries: 3,
  timeout: 10000,
});

// Get multiple users in ONE call (instead of N HTTP calls)
const users = await batchGetUsers(['user1', 'user2', 'user3']);
// ⚑ Single TCP connection, binary payload, parallel fetch

πŸ“˜ Detailed Guide: See GRPC_IMPLEMENTATION_GUIDE.md for step-by-step tutorial.


πŸ”§ Services

Service HTTP Port gRPC Port Language Description
Gateway 8000 - Nginx API Gateway - routing, CORS, rate limiting
Auth Service 3001 - TypeScript GitHub OAuth, JWT tokens, sessions
User Service 3002 50051 TypeScript Profiles, skills, projects, experience
Job Service 3004 50052* TypeScript Jobs, applications, recruiter management
Recruiter Service 3005 50054 TypeScript Candidate search, interviews, messaging
Chat Service 3006 - TypeScript Real-time messaging (Socket.IO)
Resume Service 8003 - Go PDF resume generation
Project Analyzer 8001 - Go GitHub analysis, tech detection, AI
Aura Processor - - TypeScript Score calculations (worker)
Redis 6379 - - Session cache, rate limiting
RabbitMQ 5672 - - Message queue for async tasks

*Planned | **Active gRPC server


πŸ› οΈ Tech Stack

Backend

  • Languages: TypeScript (Node.js), Go
  • Framework: Express.js
  • ORM: Prisma
  • Database: MongoDB Atlas
  • Cache: Redis
  • Message Queue: RabbitMQ
  • API Gateway: Nginx
  • Container: Docker + Docker Compose

AI/ML

  • LLM: Google Gemini API
  • Use: Code analysis, skill extraction

DevOps

  • CI/CD: GitHub Actions
  • Cloud: Azure VM
  • Reverse Proxy: Nginx

πŸ›£οΈ API Routes

Gateway Routing (nginx.conf)

Route β†’ Service Description
/api/v1/auth/* auth-service:3001 Authentication
/api/v1/users/* user-service:3002 User profiles
/api/v1/projects/* user-service:3002 Project management
/api/v1/skills/* user-service:3002 Skills management
/api/v1/experiences/* user-service:3002 Experience entries
/api/v1/jobs/* job-service:3004 Job listings
/api/v1/applications/* job-service:3004 Job applications
/api/v1/recruiter/* job-service:3004 Recruiter job mgmt
/api/v1/recruiters/* recruiter-service:3005 Recruiter accounts
/api/v1/candidates/* recruiter-service:3005 Candidate search
/api/v1/interviews/* recruiter-service:3005 Interview scheduling
/api/v1/messages/* job-service:3004 Messaging
/api/v1/templates/* recruiter-service:3005 Message templates
/api/v1/resumes/* resume-service:8003 Resume generation
/health gateway Health check

πŸ“¨ Message Queues (RabbitMQ)

Exchange: project.events

Queue Producer Consumer Purpose
project.analyze.request user-service project-analyzer Trigger analysis
project.analyzed project-analyzer aura-processor Analysis results
resume.generate.request user-service resume-service Resume generation

Message Flow

User adds project
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  publish   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Service   β”‚ ─────────► β”‚  project.analyze  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚     .request      β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚ consume
                                          β–Ό
                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚ Project Analyzer  β”‚
                                β”‚      (Go)         β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚ publish
                                          β–Ό
                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚ project.analyzed  β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚ consume
                                          β–Ό
                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚  Aura Processor   β”‚
                                β”‚  (updates user)   β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ” Authentication

Flow: GitHub OAuth

1. User clicks "Login with GitHub"
2. Frontend β†’ GET /api/v1/auth/github
3. Gateway β†’ Auth Service
4. Auth Service redirects to GitHub OAuth
5. User authorizes on GitHub
6. GitHub β†’ /api/v1/auth/github/callback
7. Auth Service:
   β€’ Exchanges code for GitHub token
   β€’ Fetches user info from GitHub API
   β€’ Creates/updates user in MongoDB
   β€’ Creates session in DB
   β€’ Generates JWT tokens (access + refresh)
8. Redirect to Frontend with tokens

JWT Strategy (Stateless)

// Each service verifies JWT independently
// No inter-service auth calls needed

// Access Token: 15 min expiry
{
  userId: "xxx",
  sessionId: "yyy",
  type: "access"
}

// Refresh Token: 7 days expiry
{
  userId: "xxx",
  sessionId: "yyy",
  type: "refresh"
}

All services share JWT_ACCESS_SECRET for verification.


πŸ“Š Project Analysis Flow

How It Works

  1. User selects GitHub repo
  2. User Service creates project record (status: pending)
  3. User Service publishes to RabbitMQ:
    {
      "projectId": "xxx",
      "userId": "yyy",
      "repoUrl": "https://github.com/user/repo",
      "repoName": "repo",
      "defaultBranch": "main"
    }
  4. Project Analyzer (Go) consumes and:
    • Clones repository
    • Scans file structure
    • Detects tech stack (package.json, go.mod, docker-compose, etc.)
    • Identifies architecture patterns (microservices, monolith)
    • Sends to Gemini AI for deep analysis
    • Extracts skills with confidence scores
  5. Project Analyzer publishes results
  6. Aura Processor consumes and:
    • Updates project status to completed
    • Adds verified skills to user profile
    • Recalculates Aura score

Tech Detection

Detects:
β”œβ”€β”€ Languages: TypeScript, JavaScript, Go, Python, Rust, Java
β”œβ”€β”€ Frameworks: Next.js, React, Express, Gin, FastAPI, Spring
β”œβ”€β”€ Databases: MongoDB, PostgreSQL, Redis, MySQL
β”œβ”€β”€ Infrastructure: Docker, Kubernetes, AWS, Terraform
β”œβ”€β”€ DevOps: GitHub Actions, Jenkins, ArgoCD
└── Architecture: Microservices, Monolith, Serverless

πŸ“ Project Structure

backend/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy-dev.yml      # CI/CD pipeline
β”‚
β”œβ”€β”€ gateway/                     # Nginx API Gateway
β”‚   β”œβ”€β”€ nginx.conf              # Main config
β”‚   β”œβ”€β”€ conf.d/
β”‚   β”‚   └── api.conf            # Route definitions
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ auth-service/               # Authentication
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/v1/
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   └── routes/
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   └── utils/
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── schema.prisma
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ user-service/               # User Management
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/v1/
β”‚   β”‚   β”œβ”€β”€ domain/             # Business logic
β”‚   β”‚   β”œβ”€β”€ rabbitmq/           # Message publisher
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ prisma/
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ job-service/                # Jobs & Applications
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ prisma/
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ recruiter-service/          # Recruiter Features
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ prisma/
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ resume-service/             # PDF Generation (Go)
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ aura-processor/             # Score Calculator
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ project-analyzer/           # GitHub Analysis (Go)
β”‚   β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ analyzer/           # Analysis logic
β”‚   β”‚   β”œβ”€β”€ github/             # GitHub API client
β”‚   β”‚   └── gemini/             # AI integration
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ docker-compose.yml          # Container orchestration
└── README.md

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose
  • MongoDB Atlas account
  • GitHub OAuth App
  • Google Gemini API key

Quick Start

# 1. Clone
git clone https://github.com/verifydev-me/backend.git
cd backend

# 2. Create .env file
cp .env.example .env
# Edit .env with your values

# 3. Start services
docker-compose up -d

# 4. Check status
docker-compose ps

# 5. View logs
docker-compose logs -f

Environment Variables

# Required in .env or docker-compose

# Database
DATABASE_URL=mongodb+srv://...

# JWT (same across all services)
JWT_ACCESS_SECRET=your-32-char-secret
JWT_REFRESH_SECRET=your-32-char-secret

# GitHub OAuth
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
GITHUB_CALLBACK_URL=https://api.yourdomain.com/api/v1/auth/github/callback

# GitHub Token (for repo cloning)
GITHUB_TOKEN=ghp_xxx

# AI
GEMINI_API_KEY=xxx

# Frontend
FRONTEND_URL=https://verifydev.me
ALLOWED_ORIGINS=https://verifydev.me,http://localhost:3000

πŸ“¦ Deployment

CI/CD Pipeline (GitHub Actions)

Trigger: Push to dev branch

1. Checkout code
2. SSH into Azure VM
3. Setup deploy keys
4. Pull latest code
5. docker-compose down
6. docker-compose up -d --build
7. Health check all services
8. Cleanup old images

Production URLs


πŸ§ͺ Health Checks

# Gateway
curl https://api.verifydev.me/health

# Individual services (internal)
curl http://localhost:3001/health  # Auth
curl http://localhost:3002/health  # User
curl http://localhost:3004/health  # Job
curl http://localhost:3005/health  # Recruiter
curl http://localhost:8001/health  # Analyzer
curl http://localhost:8003/health  # Resume

🎨 Design Patterns

Pattern Implementation
API Gateway Nginx routes all requests, handles CORS/rate limiting
Microservices Independent services with own databases
Event-Driven RabbitMQ for async communication
Stateless Auth JWT verified independently by each service
Repository Prisma ORM for data access
Dead Letter Queue Failed messages go to DLX for retry

πŸ‘₯ Team

  • Backend Architecture: Keshav Sharma

Built with ❀️ for developers who want their skills verified

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages