1. System Overview & Problem Statement
The modern landscape of technical education and talent acquisition suffers from acute friction: universities produce high volumes of student talent, yet enterprises struggle to source verified, job-ready candidates at scale. Simultaneously, career services platforms remain passive job boards rather than intelligent matching engines.
To bridge this structural gap, the Internship Portal was conceptualized and engineered during the intensive 60-day DBERT incubation sprint. This project functions as an autonomous, full-stack ecosystem designed to streamline lifecycle management for internships, candidate evaluation, application tracking, and automated profile triage.
In the domain of AI Agent Development, building static CRUD interfaces is insufficient. Production systems demand robust state management, deterministic validation, resilient API gateways, and orchestration layers capable of interacting with external Large Language Models (LLMs) safely and efficiently. This technical case study outlines the architectural blueprints, code patterns, and engineering trade-offs executed during the deployment of the portal.
Core Project References - Production Source Code: https://github.com/thanveshburra-cell/Internship-Portal - Interactive Live Deployment: https://internship-portal.dbert.in - DBERT Verified Credential: https://dbert.in/verify/CERT-DBERT-2026-AIML-023 - Pre-Screening Rubric Score: 55/100 (High Merit)
2. Architectural Blueprint & Technical Stack Decisions
The system is architected as a modular, monolithic Flask application utilizing a Model-View-Controller (MVC) separation of concerns. This design optimizes for development velocity and maintainability while preserving strict separation between the persistence layer, application logic, and presentation interface.
Technology Stack Selection - Core Framework: Python / Flask (chosen for explicit request lifecycle management, extensive ecosystem, and seamless integration with Python-based NLP libraries). - Database & ORM: PostgreSQL paired with SQLAlchemy ORM (enforcing strict relational schemas, foreign-key constraints, and ACID compliance for application tracking). - Authentication & Security: Werkzeug security hashing, role-based access control (RBAC), and session-scoped tokens. - AI/LLM Integration: Google Gemini API via Bring-Your-Own-Key (BYOK) architecture, enabling dynamic candidate assessment parsing. - Infrastructure: Gunicorn WSGI server, Nginx reverse proxy, and containerized cloud hosting.
ASCII Architecture Diagram
+---------------------------------------------------------------------------------+
| CLIENT LAYER |
| (HTML5 / Tailwind CSS / Jinja2) |
+---------------------------------------------------------------------------------+
|
v
+---------------------------------------------------------------------------------+
| NGINX GATEWAY |
| (SSL Termination / Rate Limiting) |
+---------------------------------------------------------------------------------+
|
v
+---------------------------------------------------------------------------------+
| APPLICATION RUNTIME (GUNICORN) |
| |
| +---------------------------------------------------------------------------+ |
| | Flask Controller Layer | |
| | (Route Handlers / RBAC Middleware / Request Sanitization) | |
| +---------------------------------------------------------------------------+ |
| | | |
| v v |
| +-----------------------------+ +-----------------------------+ |
| | Core Domain Services | | External AI Clients | |
| | (Application Workflow, | | (Google Gemini API, | |
| | User Profile Management) | | Structured Parsing) | |
| +-----------------------------+ +-----------------------------+ |
+---------------------------------------------------------------------------------+
| |
v v
+---------------------------------+ +-----------------+
| PostgreSQL Database | | External LLM |
| (ACID Transactions / ORM Layer)| | Endpoints |
+---------------------------------+ +-----------------+3. Core Implementation & Engineering Highlights
To maintain production reliability, the application implements stringent data validation, defensive error handling, and structured communication patterns with external third-party services.
1. Robust Application Tracking & State Management
Managing candidate progression requires atomic database operations to prevent race conditions during status updates (e.g., transitioning an application from PENDING to SHORTLISTED).
from flask import Blueprint, request, jsonify
from extensions import db
from models import Application, JobListingapplication_bp = Blueprint('application_bp', __name__)
@application_bp.route('/api/applications/<int:app_id>/status', methods=['PATCH']) def update_application_status(app_id): """ Atomically updates candidate application state with validation. """ payload = request.get_json() new_status = payload.get('status')
valid_states = {'PENDING', 'REVIEWING', 'SHORTLISTED', 'REJECTED', 'ACCEPTED'} if new_status not in valid_states: return jsonify({"error": f"Invalid status transition target: {new_status}"}), 400
try: application = db.session.get(Application, app_id) if not application: return jsonify({"error": "Application resource not found."}), 404
application.status = new_status db.session.commit()
return jsonify({ "message": "Application state synchronized successfully", "application_id": application.id, "current_status": application.status }), 200
except Exception as e: db.session.rollback() # Log exception in production logging pipeline return jsonify({"error": "Internal database transaction failure."}), 500 ```
2. External AI Integration with Graceful Degradation
The portal incorporates an AI evaluation module leveraging the Gemini API. Because external network requests can fail or time out, the implementation wraps calls in explicit exception handlers and validates API key structures via the user's BYOK mechanism.
import os
import google.generativeai as genai
from flask import current_appdef evaluate_candidate_profile(resume_text, job_description): """ Evaluates candidate text against job criteria using Gemini API with fallback behavior. """ api_key = os.environ.get("GEMINI_API_KEY") if not api_key: raise ValueError("GEMINI_API_KEY environment variable is not configured.")
genai.configure(api_key=api_key)
prompt = f""" Analyze the following candidate resume against the provided job description. Provide a JSON response with keys: 'match_score' (int 0-100), 'strengths' (list), and 'gaps' (list).
Job Description: {job_description}
Candidate Resume: {resume_text} """
try: model = genai.GenerativeModel('gemini-pro') response = model.generate_content(prompt)
if not response or not response.text: raise RuntimeError("Empty response payload received from Gemini inference endpoint.")
return { "status": "success", "evaluation": response.text }
except Exception as e: current_app.logger.error(f"AI Agent inference pipeline failure: {str(e)}") return { "status": "error", "message": "Automated evaluation service temporarily unavailable." } ```
4. Engineering Hurdles, Edge Cases & Performance Tuning
During the 60-day development cycle, three critical engineering hurdles were encountered and systematically resolved:
- Third-Party API Latency and Blocking Operations
- - Challenge: Synchronous calls to the Gemini API during HTTP request-response cycles caused gateway timeouts under high concurrency.
- - Solution: Implemented structured error boundaries, timeout wrappers, and decoupled non-blocking validation checks to ensure UI responsiveness even when external LLM endpoints experience latency spikes.
- Input Sanitization and Prompt Injection Mitigations
- - Challenge: Allowing raw user-submitted resume text to interface directly with LLM prompts opened vectors for indirect prompt injection.
- - Solution: Applied strict regex-based filtering, token length restrictions, and system-prompt boundary delimiters (
---) to isolate user data from instructional context.
- Rubric Compliance & Domain Realignment
- - Challenge: The pre-screening evaluation rubric highlighted that while the application demonstrated pristine full-stack engineering (earning 55/100 High Merit), it initially leaned heavily on traditional CRUD structures rather than custom ML modeling.
- - Solution: Documented the architectural scope clearly, establishing the application as an AI agent orchestration portal utilizing external cognitive services while enforcing rigorous backend engineering standards.
5. Deployment, Live Verification & Reflections
Deploying the Internship Portal to a live production environment (internship-portal.dbert.in) provided vital lessons in cloud reliability, environment variable isolation, and process management via Gunicorn and Nginx.
Receiving a pre-screening score of 55/100 (High Merit) from the DBERT evaluation committee served as both validation of our full-stack rigor and a catalyst for deeper architectural growth. While the submission successfully delivered an operational, secure portal with robust role management, the feedback underscored the distinct boundary between integrating third-party AI APIs and building native machine learning pipelines.
Key Takeaways from the DBERT Incubation Sprint: - Defensive Engineering: Production applications must never assume external services (like LLM APIs or databases) will respond instantaneously or without error. - Architectural Clarity: Separating orchestration logic from persistence layers is mandatory for long-term maintainability. - Continuous Evaluation: Rubric-driven development ensures that code meets professional industry benchmarks well before production release.
Interested in building production AI & Full Stack systems with 1:1 mentorship and verified credentials? Explore the [DBERT AI Fellowship](https://lms.dbert.in).