Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ __pycache__/
target/
backend_rs/target/


# Private keys
github.private-key.pem
45 changes: 45 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Leddger AI: Comprehensive Development Changelog
*June - August 2026*

This document outlines the entire development history, feature implementations, and architectural decisions made over the course of the project build.

---

## 1. Authentication & Security
- **Firebase & Google OAuth**: Resolved complex Firebase Auth integration issues (`auth/operation-not-allowed`) and successfully deployed a robust Google OAuth sign-in flow.
- **GitHub App Integration**: Configured and integrated a dedicated GitHub App (App ID `4104415`) for candidate authorization.
- Users can securely grant Leddger AI read-only access to specific private repositories and profile data.
- Designed the initial OAuth callback route to exchange temporary codes for user access tokens.
- **Google Cloud Verification**: Addressed Google Cloud domain verification issues by deploying `google-site-verification` HTML tags and metadata to confirm ownership of `https://leddger-ai.netlify.app`.

## 2. Core Dashboard & Candidate Analytics
- **Smart Profile Image Switcher**: Built a dynamic avatar component that automatically fetches a candidate's GitHub profile picture, with a fallback to their manually uploaded resume photo in a clean, pill-shaped UI.
- **GitHub Project Analysis UI**: Engineered a high-end dashboard to analyze candidate repositories:
- **Commit Pulse Graph**: A micro-chart timeline illustrating commit activity to assess genuine engagement.
- **Tech Stack Distribution**: Minimalist horizontal progress bars displaying the language breakdown (e.g., TypeScript 70%, Python 30%).
- **AI Analysis Summary**: A specialized card component reserved for LLM-generated insights on code readability, modular structure, and security.

## 3. Recruiter Tools: Form Builder & Bulk Outreach
- **Form Customizer UI (Phase 1)**: Built a dark-themed (Charcoal `#1A1D1D`, Mint `#D7FEFA`) dashboard allowing recruiters to toggle form fields (Resume, GitHub Repo Access, Portfolio Link) and add custom recruiter notes.
- **Bulk Delivery Drawer (Phase 2)**: Engineered a slide-out Outreach Campaign drawer.
- **Single Invite**: Manual email input for one-off candidate outreach.
- **Bulk Campaign**: Implemented a drag-and-drop zone for `.csv` or `.xlsx` files that parses columns (Email, Candidate Name) and prepares automated mass outreach.

## 4. Legal & Compliance
- **Privacy Policy & Terms of Service**: Automatically generated and integrated standard legal pages (`/privacy` and `/terms`) directly into the router, specifically outlining how Google user data is accessed, used, and stored to comply with Google's API Services User Data Policy.

## 5. UI/UX: The Landing Page & Navigation
- **Dynamic Scroll Navbar**: Rebuilt the navigation bar into a minimalist text layout that smoothly animates into a visible, "floating pebble" background upon scrolling.
- **Landing Page Enhancements**: Implemented an exact pixel-perfect design matching provided design references, maintaining a unified cream background while heavily utilizing the dark charcoal/mint accent theme across internal tools.

## 6. Template Builder Engine & Architecture (Latest)
- **Advanced Routing**: Migrated the entire internal dashboard from basic React state (`activeTab`) to **React Router DOM**. This ensures persistent URLs, working back-buttons, and flawless state maintenance upon browser refresh.
- **Three Core Builders**: Developed standalone builders for **Student**, **Employee**, and **Team** evaluation templates.
- **Device-Responsive Live Preview**: Added a floating device toggle that seamlessly morphs the preview canvas between a 900px Desktop Monitor layout and a 375px Smartphone layout with independent internal scrolling.
- **Dynamic Email Domain Enforcer**: Implemented an industry-standard **Bracket Syntax** parser (`@[branch].sreenidhi.edu.in`).
- Recruiters type templates with variables wrapped in brackets.
- The Live Preview automatically converts this into a sleek, inline **Compound Input Field**, locking down the domain while letting the candidate edit the bracketed variables (like their specific branch).

## 7. Environment Readiness
- Secured all sensitive keys (GitHub Client Secret, Private `.pem` keys).
- Injected Cloudinary credentials (`CLOUDINARY_CLOUDNAME`, `API_KEY`) to prepare for the upcoming unified asset upload pipeline.
26 changes: 26 additions & 0 deletions docs/authentication-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Authentication Flow & Firebase Integration

This document details the changes made to the authentication architecture in the Leddger-AI application.

## 1. Persistent Sessions (Logout on Refresh Fix)

**Issue**: The application previously logged the user out whenever the page was refreshed.
**Cause**: The application was strictly relying on ephemeral React state (`user` and `tokens`) to track authentication status, which resets on page reload.

**Solution**:
- Implemented `onAuthStateChanged` from `firebase/auth` within a `useEffect` hook in `App.jsx`.
- This hook actively listens to Firebase's underlying session state. If Firebase detects an active session (which it automatically persists in IndexedDB/Local Storage), it immediately restores the React state (`setUser`, `setTokens`, and `setShowDashboard(true)`).
- Added a `localStorage` fallback wrapper to ensure the UI immediately registers the user as logged in while the Firebase SDK initializes.

## 2. Google OAuth Domain Verification

**Issue**: Google OAuth was throwing a domain verification error (`admin_policy_enforced` / Developer contact mismatch).
**Solution**:
- Added the Google Webmaster Tools verification HTML file (`public/googlec53d2ea560879c7c.html`) to the root of the application build.
- This allows the domain `ai.leddger@gmail.com` to be correctly verified via Google Search Console, authorizing the OAuth consent screen to be displayed to users without the "Unverified app" warning block.

## 3. Demo Mode Fallback

To ensure the application remains testable during API outages or when Firebase isn't fully configured:
- Created a robust `enterDemoMode` function.
- This allows developers and reviewers to bypass the Google Auth popup completely and populate the application state with mock user data (`photoURL`, `displayName`, etc.) to review UI components.
32 changes: 32 additions & 0 deletions docs/sidebar-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 2-Tier Sidebar Architecture

This document explains the architectural teardown and rebuild of the navigation sidebar.

## Overview
The application's navigation was migrated from a standard monolithic sidebar (with a dark `#141414` theme) to a sophisticated, separated 2-tier white navigation system.

## 1. Physical Separation (The "Double Pill" Design)

Instead of nesting the Mini Sidebar inside the main application container, it was decoupled entirely.

**Structure:**
- **Mini Sidebar (Level 1)**: Physically separated from the main app. It is rendered as an independent vertical "pill" (`width: 64px`, `border-radius: 24px`, solid white background) that floats directly on the cream canvas (`#f6eadc`).
- **Gap Margin**: The `.layout-wrapper` uses a `flex` layout with a `12px` gap. This forces a physical transparent space between the Mini Sidebar and the Secondary Sidebar.
- **Active State Highlights**: Because the Mini Sidebar is a white pill, active icons are highlighted using a subtle gray square (`#F5F5F5`), shifting away from the previous heavy drop-shadows.

## 2. Secondary Sidebar (Level 2)

The Secondary Sidebar handles sub-navigation based on the primary selection.

**Key Refactors:**
- **Alignment**: The header title (e.g., "Inbox") was changed from a stacked layout to a horizontal layout perfectly aligned with other header elements.
- **Minimalist Dividers**: Text-based category labels (like "VIEWS") were completely removed. They were replaced with thin, highly minimalist `<hr>` divider lines (`border-top: 1px solid #F0F0F0`).
- **Counts and Badges**: Secondary navigation items were upgraded to support right-aligned numerical counts (e.g., `46`, `12`, `50`) to match modern inbox designs.
- **Collapsible Headers**: Added support for collapsible section headers (e.g., "Others", "Team Inboxes") with right-aligned chevron arrows.

## 3. Removals for Cleanliness

To achieve a neater, less cluttered UI as per design specifications:
- **Toggle Collapse Button Removed**: The circular `>>` button that floated between the two sidebars was removed, enforcing a permanently expanded 2-tier layout that occupies the available widescreen real estate.
- **Sidebar Search Removed**: The secondary sidebar's inline `<Search...>` input box was deleted to reduce visual noise and tighten the header area spacing.
- **Icon Set Refactor**: Swapped all proprietary icons for standardized, thin `lucide-react` icons (rendered with `strokeWidth={1.5}` or `2`) to guarantee visual consistency.
27 changes: 27 additions & 0 deletions docs/ui-layout-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# UI Layout & Container Refactor

This document outlines the macro-level layout changes implemented in the application to achieve the "Box-in-a-Box" floating window aesthetic.

## 1. Global Background & Layout Wrapper

**Previous State**:
The `.app-container` stretched to `100vw` and `100vh`, effectively touching all edges of the browser window.

**Current State**:
- The `body` element is now purely a canvas. It uses a flex layout to center its children and applies the global cream background (`#f6eadc`).
- A new `.layout-wrapper` was introduced as the master root container.
- `.layout-wrapper` uses a mathematically precise calculation (`width: calc(100vw - 32px); height: calc(100vh - 32px);`) to ensure there is a perfect `16px` gap floating on all four edges of the screen (Top, Bottom, Left, and Right).

## 2. Floating App Container (Main Window)

**Previous State**:
The app container acted as the root layout, holding all sidebars and main content directly.

**Current State**:
- The `.app-container` has been downgraded from a master root wrapper to a specific "Main Window" container.
- It now only houses the Secondary Sidebar and the Main Workspace.
- It features a strict `border-radius: 24px`, a subtle drop shadow (`0 10px 40px rgba(0,0,0,0.05)`), and a solid white background (`#FFFFFF`).

## 3. Responsive Stretching

To prevent "wasted space" on very large widescreen monitors, the `max-width: 1600px` limitation was removed from the layout hierarchy. The layout wrapper now dynamically stretches horizontally across any screen size while maintaining the `16px` floating edge gap, making it look substantially neater and more immersive on 4K/Ultrawide displays.
Loading