How kaushikjaincodes/hackathon-backend works
Main components
• API Layer (Frontend Gateway): Represented by the FastAPI server. Here, the “routers” directory contains modules for endpoints (chat, loan, request, users) which act as entry points for client requests.
• Business Logic Layer: This includes:
• The “services” directory, which contains distinct services such as:
▪ Bureau Service – for credit score normalization.
▪ LLM Service – which integrates with the Llama 8B model for AI-based report generation.
▪ Supabase Service – for interacting with your PostgreSQL/Supabase database.
• The “prompts” directory, where various AI prompt templates are maintained (e.g., ais_prompt, bank_statement, chat_prompt, credit_score_prompt) to tailor input to the AI model.
• Configuration and Utility Components:
• “app/config/settings.py” for configuration settings.
• “app/utils/pdf_reader.py” for reading PDF files, likely used for processing documents.
• Data Persistence: While not shown as explicit directories, your README specifies integration with PostgreSQL and Supabase, indicating a database layer that supports data storage.
Relationships and interactions
• Each endpoint then interacts with the corresponding service components. For example, the “loan” router would call the Bureau and LLM services to process and generate loan assessment reports.
• The prompt templates feed into the LLM service for generating AI-powered recommendations. Indicate this connection by linking the prompts component to the LLM service.
• The Supabase service is responsible for database interactions (e.g., storing normalized credit scores, conversation logs, etc.).
• The configuration component (settings.py) essentially underpins the initialization of these services, so a connection from “config” to each major component should be visible.
• Any file utilities (like the PDF reader) should be shown as support services that process input documents which might eventually feed into the overall workflow.
Architectural patterns and design principles
• The application follows a layered architecture – clearly separating the API (routers), business logic (services, prompts), and configuration/utilities.
• There is a modular design where each functional concern (credit score normalization, AI-based loan assessment, chat functionality) is encapsulated within its own module.
• Integration points with external services such as external credit bureaus and the database (Supabase/PostgreSQL).
Relevant technologies
• FastAPI as the backend framework managing the HTTP layer.
• Llama 8B AI model integrated via the LLM service.
• Supabase/PostgreSQL for persistent data storage.
• Python and PDM for dependency management & application setup.
Final checklist for the principal software engineer
• As many details as possible to reflect the real interactions and modular structure of the project – do not hesitate to break down high-level components further (for example, separate out individual routers or services if needed).