Hardened db.ts — added statement_timeout: 30000, idle_in_transaction_session_timeout: 10000, created transaction() helper (BEGIN/COMMIT/ROLLBACK).
Multi-step API routes wrapped in transactions — Events POST, Conversations POST use atomic blocks.
Fixed leads pagination — status filter pushed into SQL WHERE (no client-side filtering after LIMIT/OFFSET), added SELECT COUNT(*) for total.
Rewrote dashboard — SQL aggregations (COUNT + GROUP BY + date_trunc) replace loading all leads into memory.
Optimized conversations GET — merged duplicate correlated subqueries into single LEFT JOIN LATERAL.
Created migration 021_performance_indexes.sql — 8 missing indexes + set_session_user_context() function caching current_user_hierarchy_level() as session variable (avoids per-query RLS join).
Fixed build error — duplicate const other in conversations route. Also fixed a TypeScript never error in dashboard breakdown map.
Verified — npx tsc --noEmit clean, npm test (13 pass, 7 integration skip gracefully), npx next build succeeds.
- Introduced new migration for `facebook_accounts` and `facebook_scrape_logs` tables.
- Updated the scraping logic to handle Facebook accounts, including success and failure tracking.
- Implemented API endpoints for managing Facebook accounts and their scrape logs.
- Enhanced user permissions to restrict access to Facebook account management to admins and super admins.
- Added a dialog component for displaying and managing Facebook accounts in the UI.
- Updated lead fetching logic to include user role checks for assignment and access.
feat: implement conversations API with message retrieval and posting
feat: add avatar URL handling for users and update user role definitions
feat: create chat system tables in the database with initial seed data
fix: update user roles from "sales_user" to "sales" for consistency
chore: add middleware for system API route access
fixed fuckups on john's side, added a benchmark
Made Graphs actualy load from database and realtime data, graphs will update and percentages will be mathematically made, and made realtime
added chatcart edits, made graphs glow.
added in some little small home feeling fuctions
added in a slide show, in login with qoutes from creators because i want to leave a print on it saying we made this shit, we built it brick for brick
login page added qoutes some random, and made them shuffle from left to right one dissapears other come in
adding shape to the textbox for the qoutes
Fixed my chat fuckups when it comes to chats