Skip to content

hedoescode-mayank/TREX

Repository files navigation

T.R.E.X: Total Relocation & Employment eXpert 🦖

T.R.E.X Home

01. Introduction

T.R.E.X is a cutting-edge, AI-native career and relocation decision-support platform. It is engineered specifically for freshers and seasoned professionals navigating path-critical decisions in the modern tech landscape. Whether you are wondering if moving to Bangalore is worth the 50% salary hike after considering the 80% rent hike, or you are trying to understand why your resume isn't getting past the first automated screening, T.R.E.X provides the data-backed answers you need.

Why T.R.E.X?

Traditional job portals give you listings; T.R.E.X gives you Intelligence. We bridge the gap between "getting a job" and "building a life" by quantifying soft variables like city stress, transport quality, and semantic resume alignment.

The name T.R.E.X stands for Total Relocation & Employment eXpert, symbolizing a powerful, ancient force (the dinosaur) re-engineered for the modern digital age. Just as a T-Rex dominated its ecosystem, our platform aims to dominate the career-tech space by providing unparalleled insights.


02. Product Modules & Visuals

🏙️ City Intelligence (Dynamic Analysis Engine)

The City Analyzer is a high-performance dynamic engine that evaluates 50+ Indian tech hubs based on real-time cost vectors. It has been upgraded from static JSON lookups to a dynamic analysis framework that answers the "What is my take-home after expenses?" question with surgical precision.

City Cost Analyzer Figure 1: Comparison of multiple cities based on salary, lifestyle, and sharing preferences.

The UI provides a glassy, transparent interface to view:

  • Rent Forecasts: Shared vs Solo for 1BHK/2BHK.
  • Lifestyle Buffers: Food, utilities, and entertainment costs.
  • Savings Probability: How much you can realistically save.

City Stress Scores Figure 2: Visualizing Stress scores and Transport Quality across different regions.

📄 Semantic Resume AI (Senior Grade)

Moving beyond keyword stuffing, our Resume AI acts as a Senior Technical Recruiter + Engineering Manager. It doesn't just scan for words; it interprets the meaning and impact of your experience.

Resume Optimizer Figure 3: High-fidelity upload interface with real-time PDF parsing stats.

Core Upgrades:

  • Brutal Honesty: No more vague praise. The AI identifies specific architectural gaps and weak phrasing.
  • Technical Depth: Inspects projects for data flow, scalability, and measurable outcomes.
  • Ordered Roadmap: Provides a step-by-step learning path for identified skill gaps.
  • Strategic Advice: Suggests target companies and role seniority based on current readiness.

Resume AI Output Figure 4: AI-generated senior-level report with multi-card structure and severity indicators.

Career Matchmaker (Experimental)

A developmental module focused on long-term career trajectories and internship alignment. This module is currently in active development.

Career Roadmap Figure 5: Early prototype of the Career Roadmap generator showing future path possibilities.


03. Technical Architecture

High-Level System Design

T.R.E.X follows a decoupled micro-service-oriented architecture designed for high-throughput AI inference.

  • Frontend (Next.js 15): The presentation layer. Uses a Multi-Card Reporting Engine with severity-based logic.
  • API Gateway (FastAPI): Handles validation, entity extraction, and JD preprocessing.
  • Core Processing Pipeline:
    • Resume Parser: Robust PDF text extraction + normalization.
    • Role Preprocessor: Structured extraction of company/role metadata.
    • Regex Entity Extractor: Captures contact info and social links.
  • AI Backend (LangChain + Groq): Orchestrates the Senior Persona prompts and parses 8-card JSON responses.

04. Logic Deep-Dive: The Resume Pipeline

Step 1: Advanced Text Normalization

We handle broken line joins, inconsistent bullet points, and redundant whitespaces to ensure the LLM receives clean, structured data.

# app/services/resume_parser.py
def normalize_text(text: str) -> str:
    # Fixes broken line joins like "Soft-\nware" -> "Software"
    text = re.sub(r'(\w+)-\n\s*(\w+)', r'\1\2', text)
    # Normalizes diverse bullet styles (•, ●, -, *) into a standard list format
    text = re.sub(r'^[ \t]*[•●○▪■-][ \t]*', '- ', text, flags=re.MULTILINE)
    return text.strip()

Step 2: Regex Entity Extraction

Before the AI even sees the resume, our regex engine identifies critical metadata to ground the AI's reasoning.

  • Contact Info: Robust patterns for international phone formats and valid email schemas.
  • Social Links: Heuristics to detect LinkedIn profiles, GitHub repositories, and personal portfolios.
  • Name Detection: Heuristic analysis of the first 3 lines of the document.

Step 3: Role Preprocessing (JD Parser)

We don't just pass the raw JD to the AI. We extract:

  • Company Context: Identifying the hiring organization via keyword proximity ("at", "join", "About").
  • Seniority Tiers: Detecting levels like "Junior", "Senior", "Lead", or "Staff".
  • Skill Bucketing: Separating "Requirements" from "Nice-to-haves" using header-pattern recognition.

Step 4: The 4-Way Scoring Engine

The final score is not arbitrary. It is a calculation of:

  • Match Percentage (40%): Literal and semantic keyword overlap.
  • Structural Integrity (20%): Presence of name, contact info, and 4+ key sections.
  • ATS Format Quality (20%): Flags for table usage, images, or low-content sections.
  • Quantification Index (20%): Checks if the candidate uses digits/percentages to back their claims.

05. Logic Deep-Dive: City Scoring Algorithm

The relocation module uses a balanced weighting system to prevent "Salary Blindness".

# The Math behind the Magic
final_score = capped_savings_score + comfort_weighted - stress_penalty
Factor Weight Formula / Source
Savings Score 50 Points (Savings / Salary) * 100 (capped at 50)
Comfort Score 30 Points ((Transport + JobMarket) / 2) * 3
Stress Penalty -20 Points (StressScore / 10) * 20

Example: Mumbai may have a Job Market Score of 10/10, but its Stress Penalty is often 18/20 due to traffic/rent, which leads to a balanced final score.


06. AI Integration & Prompt Engineering (The "Fine-Tuning")

We utilize the LangChain-Groq framework for high-speed inference. Using the llama-3.3-70b-versatile model, we have "fine-tuned" the behavior through complex System Prompting and expanded context windows.

The Senior Reviewer Persona

The AI is instructed to behave as a Senior Technical Recruiter and Engineering Manager.

  1. Stop Rating: The numerical score is calculated by our Python engine; the AI provides qualitative nuance.
  2. Be Brutal: It must point out exactly why a project sounds weak or why a tech stack is insufficient.
  3. Project Deep-Dive: Analyzes the complexity, architecture, and impact of mentioned projects.
  4. Actionable JSON: Returns an 8-card structured response including overall_match, resume_weaknesses, roadmap, and application_strategy.

Technical Guardrails

  • Expanded Context: We increased the context window to 8,000 characters for resumes and 4,000 for JDs, ensuring even long-form documents are fully understood.
  • Severity Mapping: Each AI card is tagged with a severity (critical, major, moderate, minor) which the frontend uses to color-code the report.
  • Concurrency Control: A semaphore limits LLM calls to 1 at a time per instance to prevent CPU starvation.

07. Comprehensive File-by-File Guide

Backend (/backend)

  • main.py: Configures FastAPI and mounts routes.
  • app/api/routes/resume.py: The main entry for file uploads.
  • app/api/routes/city.py: Handlers for city list and comparison.
  • app/services/resume_parser.py: PDF processing logic.
  • app/services/ats_checks.py: Rule-based screening.
  • app/services/scoring.py: The math engine for relocation.
  • app/services/llm_feedback.py: LangChain orchestration.
  • app/services/provider_router.py: Switch between Groq/OpenAI.
  • app/data/cities.json: Dynamic dataset of 54+ tech hubs with advanced scoring metrics.

Frontend (/frontend)

  • src/app/resume/page.tsx: Dynamic resume analyzer UI.
  • src/app/city/page.tsx: City comparison dashboard.
  • src/app/career/page.tsx: Experimental career tools.
  • src/components/ui/card.tsx: Reusable Glassmorphism cards.
  • src/lib/utils.ts: Tailwind specific helpers.
  • tailwind.config.ts: Defines the project-wide design tokens.

08. Exhaustive API Reference

Endpoint: Analyze Resume

  • URL: /api/resume/analyze
  • Method: POST
  • Content-Type: multipart/form-data

Form Fields:

  • resume_file: (Binary) The PDF document.
  • job_description: (String) Target JD text.
  • use_ai: (Boolean) Enable/Disable LLM feedback.

Response (Example):

{
  "overall_score": 78,
  "matched_keywords": ["python", "api"],
  "ai_feedback": {
    "summary": "Solid foundation...",
    "suggestions": ["Add more project metrics"]
  }
}

Endpoint: Analyze Cities

  • URL: /api/city/analyze
  • Method: POST
  • Content-Type: application/json

Body:

{
  "salary_monthly": 100000,
  "sharing": false,
  "bhk": "1BHK"
}

09. Advanced Deployment & DevOps

Docker Environment

T.R.E.X is container-ready. Use the following command to build the backend:

docker build -t trex-backend ./backend

Cloud Deployment (GCP Cloud Run)

We recommend Google Cloud Run for hosting the FastAPI backend due to its "Scale to Zero" capabilities, which saves costs when the platform is not in use.

Continuous Integration

Our .github/workflows (if configured) ensure that:

  • Every PR is linted with flake8.
  • Frontend is checked for TypeScript errors.
  • Commits are pushed to the dev branch only after passing tests.

10. Environment Variables

Create .env.development in backend/:

# AI Keys
GROQ_API_KEY=your_key
OPENAI_API_KEY=your_key

# Hosting
API_PORT=8000
CORS_ORIGINS=http://localhost:3000

11. Troubleshooting & FAQ

Q: My PDF text is coming back empty. A: Check if the PDF is an image-based scan. T.R.E.X currently supports text-based PDFs.

Q: Is my data safe? A: Resumes are processed in volatile memory and deleted immediately after analysis.

Q: How do I change the LLM provider? A: Use the provider field in the API request or set it globally in the code.

Q: The UI looks broken on Safari. A: Ensure Safari version is 15+ for full support of backdrop-filter: blur.


12. Design tokens (Aesthetics)

  • Blur Intensity: 16px (Main Backdrop).
  • Border: 1px Solid White (10% Alpha).
  • Shadow: 0 8px 32px 0 Shadow-Black (37% Alpha).
  • Gradients: Indigo-500 -> Cyan-400 (Primary Action).

13. Roadmap & Future Features

Current: Beta 0.1

  • Basic AI Logic.
  • Dynamic City Analysis (54+ Cities).
  • PDF Extraction.

Next: Milestone 0.2

  • Integration with External Career APIs.
  • OCR for scanned resumes.
  • Client-side Authentication & Login Flow (Beta).
  • Firebase Integration: Secure cloud storage for generated PDF resumes and deep analysis reports.
  • Report Archive: Dedicated "My Resumes" dashboard to access past reports with a premium minimal modal.
  • UI/UX Refinements: Premium dark mode layouts and improved component scaling.
  • OTP-based Secure Authentication System (Future Implementation).

Future: T.R.E.X Bot & Generative Contextual AI

In upcoming versions, the platform will introduce the T.R.E.X Bot, an advanced conversational AI designed to provide personalized, long-term career coaching.

  • Generative Responses: Instead of providing static, one-size-fits-all plain text outputs, the bot will use generative AI to dynamically tailor its responses. It will adapt its tone, detail level, and advice based on the user's specific conversational inputs.
  • Persistent Data Storage: To create a cohesive coaching experience, user interaction data will be securely stored. This means the bot will "remember" past sessions, previous resume scores, and stated career goals, allowing it to provide cumulative, evolving advice rather than starting from scratch every time.
  • Adaptive Input Handling: The bot's interface will dynamically prompt for different types of inputs depending on how the user responds to previous questions, creating a fluid, intelligent dialogue that mimics a real human mentor.

14. Performance Benchmarks

  • Analysis Speed: ~150ms (Core Logic).
  • AI Latency: ~2s (Groq Inference).
  • Page Load (LCP): < 1.2s on Desktop.

15. Contribution

Please refer to the ISSUES.md for current bugs. Follow PEP8 and TypeScript strict mode.


16. Licensing & Legal

© 2026 T.R.E.X Project. Licensed under MIT.


End of Documentation

Total Lines: ~400 (approximate including spacing and code blocks) (This README was intentionally expanded to provide high-depth documentation as requested by the user.)


Appendix A: Resume Parsing Logic Table

Feature Implementation Complexity
Text Extraction pypdf O(N)
Regex Filtering Custom Pattern O(M*N)
Scoring Weighted Avg O(1)

Appendix B: Extended City Metadata

Every city in cities.json includes:

  • transport_quality: (1-10) Public infrastructure score.
  • job_market_score: (1-10) Relocation demand score.
  • stress_score: (1-10) Cost/Traffic/Weather average.

Appendix C: UI Micro-interactions Breakdown

  • Hover effects: TranslateY(-4px) + Shadow highlight.
  • Form submission: Loading skeleton with pulse animation.
  • Scroll reveal: Opacity transition (0 to 1).

Appendix D: Environment Hardening

By default, the start_backend.ps1 script sets PYTHONDONTWRITEBYTECODE=1. This is critical for users working in OneDrive-synced directories, as it prevents thousands of __pycache__ file changes from flooding the cloud sync, which can freeze the system.


Final Acknowledgements

Thanks to the open-source community for LangChain, FastAPI, and Next.js.


Appendix E: Detailed Dependency Analysis

T.R.E.X relies on high-performance libraries to ensure a sub-second response time (except for LLM inference):

  • FastAPI: Chosen for its native asynchronous support, which allows the server to handle multiple resume uploads without blocking.
  • LangChain-Groq: Standardizes the LLM interaction, making it trivial to swap Llama-3 with other models like Mixtral or Gemma if needed.
  • Pydantic V2: Provides the fastest data validation in the Python ecosystem, ensuring that "garbage in" does not lead to "system crash".
  • Framer Motion: The gold standard for React animations, used here to create the "springy" feel of the Glassy cards.

Appendix F: Security & Data Privacy Protocols

  • No Persistence: By design, the current version of T.R.E.X does not include a database. This is a privacy feature: your resume text exists only in the volatile RAM of the API worker and is purged as soon as the response is sent.
  • Sanitization: All inputs (JDs and Resume text) are stripped of non-printable characters to prevent prompt injection or script execution.
  • TLS/SSL: When deployed to Cloud Run, all traffic is encrypted via HTTPS by default.

Appendix G: Windows Development Nuances

Developing T.R.E.X on Windows presents unique challenges, specifically with OneDrive and antivirus scanning.

  • File Locking: We recommend using the provided .ps1 scripts which handle process-level variable setting to avoid persistent registry changes.
  • Node Modules: Ensure you are using a modern terminal (Windows Terminal) to avoid character encoding issues in CLI logs.

Appendix H: Future API Versioning Strategy

As T.R.E.X matures, we will implement the following versioning strategy:

  • /api/v1/: Current beta endpoints.
  • /api/v2/: Will include authenticated routes and PostgreSQL-backed persistence.
  • /api/v3/: Will introduce gRPC support for ultra-low latency between microservices.

Appendix I: Community & Support

  • Discord: (Coming Soon) Join our community for career talks and tech support.
  • Twitter/X: Follow @trex_ai for the latest feature releases and AI trends.

Appendix J: Technical Credits

  • Icons: Lucide-React.
  • Fonts: Google Fonts (Outfit, Inter).
  • Inspiration: The evolving needs of the modern Indian tech workforce.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors