Ace
ff56cea4b8
feat: add Facebook account tracking and management
...
- 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.
2026-06-23 14:18:18 +02:00
Ace
1adc4806fa
Files Changed
...
Security Fixes
File Change
.env.local Placeholder JWT secret (rotate to random value: openssl rand -base64 64)
src/middleware.ts Removed /api/auth/me bypass; API routes return JSON 401 (not 302 redirect)
src/lib/auth.ts sameSite: "lax" → "strict" (create + destroy cookie); SVG name chars are pre-computed (no injection)
src/lib/avatar.ts Added sanitizeName() — strips non-alphanumeric/safe chars, max 50 chars
src/app/api/users/route.ts POST restricted to super_admin; validates role against whitelist ["sales","admin","super_admin","dev"]; validates active defaults to true
src/app/api/users/[id]/route.ts DELETE restricted to super_admin; blocks self-deletion
src/app/api/leads/[id]/route.ts GET: non-admin users filtered by assigned_to; PATCH: ownership check + score validated 0-100 range
src/app/api/leads/route.ts DELETE: ownership + admin check; GET: ownership filter for non-admin users
src/app/api/conversations/[id]/messages/route.ts GET/POST: verify user is a conversation_participant before access
rust-ai/src/main.rs CORS: AllowOrigin::list(["localhost:3006", "127.0.0.1:3006"]) (was Any)
Performance Fixes
File Change
src/app/api/leads/route.ts Added limit (default 50), offset query params; ownership filter in SQL
src/app/api/users/route.ts Added limit (default 50), offset query params
src/app/api/conversations/route.ts Added LIMIT 50
src/app/api/leads/[id]/notes/route.ts Added limit (default 50), offset query params
src/app/api/conversations/[id]/messages/route.ts Added limit (default 100), offset, before query params
src/app/(dashboard)/chats/page.tsx Pruned to 5 cached conversations; useMemo wraps messages/conversation/filteredConversations; otherParticipant moved outside component; added 10MB file size limit; recordingChunksRef cleared on discard
src/app/(dashboard)/leads/[id]/page.tsx Optimistic status update rolls back on fetch failure
database/migrations/003_chat.sql Added composite index idx_messages_conversation_created on (conversation_id, created_at DESC)
Code Quality Fixes
File Change
src/lib/ai.ts Removed dead getInstructions()/updateInstructions() (called nonexistent /ai/instructions)
src/lib/auth.ts bcrypt.hash(password, 12) — kept (acceptable, OWASP-recommended)
src/app/login/page.tsx "Forgot password?" button now shows alert to contact admin (was no-op)
src/components/users/user-form-dialog.tsx Password min 6 → 8 chars
26 silent catch {} blocks across 16 files (see below) Added console.warn("...") context messages
2026-06-23 09:45:30 +02:00
Ace
d891197d8b
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-22 22:02:43 +02:00
Ace
b81f391df5
Got facebook to work test tomorrow with new accounts please
2026-06-22 22:00:56 +02:00
caitlin
ba947cea87
I fixed the lightmode on the sidebar and added
...
more colour themes. I fixed the settings buttons.
2026-06-22 16:26:45 +02:00
caitlin
c5766d1624
Fixed notifications button
2026-06-22 15:39:55 +02:00
Ace
be5808f3fc
AI somewhat added
2026-06-22 12:37:38 +02:00
Ace
571af27f50
added update from code pull new changes now
2026-06-19 10:19:57 +02:00
William_Britz
e5726fdbb2
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-19 09:53:52 +02:00
William_Britz
ebc29c47a4
ANYTHING
2026-06-19 09:52:24 +02:00
Ace
6ffbc7c9b4
uh added some stuff forgot got drunk
2026-06-18 23:04:20 +02:00
Ace
adbcc4b9af
feat: add system monitor component and API for performance metrics
...
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
2026-06-18 22:48:03 +02:00
caitlin
f5d09298a2
fixed css
2026-06-18 16:57:59 +02:00
caitlin
02ef2b9f1f
I Fixed the notifications
2026-06-18 16:52:30 +02:00
caitlin
6fe41b6c96
I added functionality to the notification button
2026-06-18 16:47:31 +02:00
caitlin
1e4b8df8dd
I added functioonality to the notifications
2026-06-18 16:43:26 +02:00
William_Britz
e7e4d371c2
Updated Login
2026-06-18 16:12:10 +02:00
William_Britz
b19a00c6c2
Updated the Login
2026-06-18 16:10:02 +02:00
Hannah_Bagga
13555c3fab
Fix duplicate import of use() in leads/[id] page
2026-06-18 16:09:31 +02:00
Ace
0880c13890
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-18 15:46:02 +02:00
Ace
5b115ae9ff
SuperAdmin changes
2026-06-18 15:45:59 +02:00
Hannah_Bagga
3d03440ffa
Changed Dashboards
2026-06-18 15:37:08 +02:00
Hannah_Bagga
10b5de7a21
Fix ESLint import paths and Next.js 15 params type for leads page
2026-06-18 15:32:08 +02:00
Hannah_Bagga
0898ad4ebf
Changed the dashboards
2026-06-18 15:21:56 +02:00
TroodonEnjoyer
03fbe13938
New changes to topbar.tsx
2026-06-18 14:26:54 +02:00
TroodonEnjoyer
ca96f4b185
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-18 13:49:18 +02:00
TroodonEnjoyer
e6a6face98
Merge: resolve topbar conflict, align types with DB schema
2026-06-18 13:48:58 +02:00
caitlin
a0d8420a2f
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-18 13:46:30 +02:00
TroodonEnjoyer
c6ce93c564
yo
2026-06-18 13:45:57 +02:00
caitlin
24dc4855d7
Fixed button in view
2026-06-18 13:45:46 +02:00
Ace
de6cbfccc2
Ewan fuckup fix
2026-06-18 13:44:05 +02:00
caitlin
178677aa85
Merge branch 'main' of https://git.coastit.co.za/caitlin/CRM_ENVR
2026-06-18 13:27:33 +02:00
TroodonEnjoyer
277c719963
Merge: fix conflicts, add auth system with PostgreSQL, seed data, and 4 demo users
2026-06-18 13:26:27 +02:00
TroodonEnjoyer
5238b59140
Added 4 Demo Users, with Coast emails, Hierarchy, roles etc.
2026-06-18 13:13:29 +02:00
Ace
8cb49167f4
added Voice, blueticks, fixed messages, fixed search conversation, added scroll functionality, fixed file uploads & download added in screenshot paste function too, changed back to the orignal emoji pack
2026-06-18 12:25:28 +02:00
caitlin
fd2d4ff976
I fixed the filter for all the leads
2026-06-18 12:15:44 +02:00
caitlin
7a42e3c41c
I fixed the runtime error that appeared.
...
I fixed the size error regarding both graphs.
2026-06-18 09:38:06 +02:00
caitlin
f1a1db5ff6
This is the template for us to work on.
2026-06-17 17:35:54 +02:00
caitlin
3f839bc0fc
Replace Recharts charts with custom SVG components
...
- Lead status: custom SVG donut with radial gradients, hover effects, percentage tooltips
- Leads per month: custom SVG grouped bar chart with hover dimming, gradient bars
- Tooltip colors fixed to use theme variables
- Right-panel lead status icon colors updated
2026-06-17 17:05:15 +02:00
Ace
c29fd287c4
users changed
2026-06-17 17:00:57 +02:00
Ace
0fead80e1f
Updated user profile - Ace
2026-06-17 16:28:07 +02:00
Ace
d6d784cef3
Added in Logo's and worked on Avatars and Chats
2026-06-17 16:26:32 +02:00
caitlin
4898bf7142
Initial commit
2026-06-17 13:51:22 +02:00