You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user · job · application · ai – each service is backed by its own dedicated PostgreSQL instance
External entrypoint
Traefik Ingress → /api/v1/** (HTTPS)
Internal communication
Kubernetes ClusterIP + DNS; services listen on port 808x or expose /internal/api/v1/**. No JWT is required; traffic is restricted via NetworkPolicy and/or mTLS
Security
JWT (RS256). All services validate tokens with the same public key. No refresh tokens and no revocation/black-list; logging out is done on the frontend by simply discarding the token
File storage
Original resume files are stored in file system; database tables only persist the file path
AI chat rules
Each application is allowed exactly onechat_session whose lifecycle is ACTIVE → COMPLETE. The service maintains an internal message counter; when message_count > 50 the session is automatically marked COMPLETE
1.2 Business Flows
Candidate: register → log in → browse jobs → apply and upload resume → check application progress / assessment →
start or continue the AI chat
HR: log in → create / modify / close job postings → view applications and assessments → set hr_decision &
hr_comments → view the entire chat history
AI: provides chat replies, resume scoring, and interview scoring through gRPC methods
2. PostgreSQL DDL (four isolated instances)
2.1 user instance
CREATE
EXTENSION IF NOT EXISTS "uuid-ossp";
CREATETYPEuser_roleAS ENUM ('CANDIDATE', 'HR');
CREATETABLEusers
(
user_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
full_name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
password_hash TEXTNOT NULL,
role user_role NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATEINDEXidx_users_emailON users (email);
2.2 job instance
CREATETYPEjob_statusAS ENUM ('OPEN', 'CLOSED', 'DRAFT');
CREATETABLEjobs
(
job_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title VARCHAR(255) NOT NULL,
description TEXTNOT NULL,
requirements TEXTNOT NULL,
status job_status DEFAULT 'DRAFT',
closing_date DATE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP,
hr_creator_id UUID NOT NULL-- logical foreign-key reference
);
CREATEINDEXidx_jobs_statusON jobs (status);
CREATEINDEXidx_jobs_hr_creatorON jobs (hr_creator_id);
External URL prefix: **/api/v1**Internal URL prefix: /internal/api/v1 or port 8081
All request/response bodies are wrapped in a unified ApiResponse envelope (examples omitted).
3.1 user service
Method
Path
Auth
Description
POST
/auth/login
Public
Log in and receive a JWT
POST
/auth/register
Public
Candidate registration
POST
/auth/hr-register
JWT (HR)
HR creates another HR account
GET
/internal/users/{id}
Internal
Retrieve user information by ID
3.2 job service
Method
Path
Auth
Description
GET
/jobs
Public
Browse jobs (pagination & optional status filter)
GET
/jobs/{id}
Public
Job details
POST
/jobs
JWT (HR)
Create job
PATCH
/jobs/{id}
JWT (HR)
Update title / description / requirements / status
DELETE
/jobs/{id}
JWT (HR)
Delete job
POST
/jobs/{id}/close
JWT (HR)
Close job
POST
/jobs/{id}/open
JWT (HR)
Re-open job
GET
/internal/jobs/{id}
Internal
Job info for the application service
3.3 application service
Method
Path
Auth
Description
POST
/applications
JWT (Candidate)
Apply for a job; multipart/form-data upload resume; returns application ID
GET
/applications
JWT
Candidate: own applications; HR: paginated search by job_id / status
GET
/applications/{id}
JWT
View application details (including assessment and chat state)
PATCH
/applications/{id}
JWT (HR)
Update hr_decision, hr_comments, or status
GET
/applications/{id}/messages
JWT (HR)
HR fetches all chat messages
POST
/applications/{id}/chat
JWT (Candidate)
Create or fetch the chat session for this application
POST
/chat/{session_id}/messages
JWT (Candidate)
Send message → AI reply; returns ai_message + complete_flag
The requirements, database schemas, and APIs above cover the entire business domain: registration & login, job
management, application workflow, AI chat & scoring, HR decisions, and candidate self-service progress tracking.
JWTs have no refresh/revocation mechanism, and services expose only the minimal internal APIs needed to complete this
robust yet minimal feature loop.