5.1 KiB
5.1 KiB
Dealspace AI - Lovable Prototype Specification
Generated from file tree analysis of Misha's Lovable prototype
Overview
Dealspace AI is a data room platform for M&A transactions with AI-powered diligence assistance. It provides role-based access for sellers and buyers with different views and capabilities.
Architecture
Frontend (React/TypeScript)
- Pages: Analytics, AuditLog, Auth, Contacts, Dashboard, DealRoom, DealRooms, ICMemos, RequestList, Settings, PlatformGuide
- Components: AppLayout, AppShell, AtlasGlobalChat, AtlasSidebar, DealRequestsPanel, NavLink
- Hooks: useAuth, useOrganization, useTheme, useUserRole
- Lib: api, utils
- UI Framework: Shadcn/UI components (extensive component library)
Backend (Supabase)
- Database: PostgreSQL with RLS (Row Level Security)
- Edge Functions: 5 serverless functions for AI and business logic
- Auth: Supabase authentication with demo mode
Database Schema (Inferred)
Based on migration files found:
20260214204302_ecf07ab9-408c-4285-aaa7-fa863ab0bf44.sql20260214210921_76c3250f-a80f-48c6-811e-bd63c5df73b9.sql20260214212128_b9b50ed5-01a1-452c-8980-08cf8f01de07.sql20260214222633_87b2d0bd-eb15-4756-8276-688939090180.sql20260214224626_6cd97efe-10ea-46f3-9127-62bbc9d89cba.sql
The database likely contains tables for:
- Organizations
- Users and roles (seller/buyer/admin)
- Deals and deal rooms
- Documents and folders
- Diligence requests
- Comments and audit logs
- Buyer groups and permissions
Atlas AI System
Edge functions identified:
- atlas-chat: AI chat interface for document questions
- compute-deal-score: Calculate deal risk/completion scores
- demo-login: Demo account creation for testing
- folder-summary: AI-generated folder/document summaries
- generate-ic-memo: Investment Committee memo generation
User Roles & Features
Seller (Owner) Role
- Full dashboard access
- Create and manage deal rooms
- Upload documents and organize folders
- Manage diligence request lists
- View analytics and audit logs
- Manage contacts and settings
- No IC Memo access
Buyer (Viewer) Role
- Limited dashboard (only assigned deals)
- View deal rooms they have access to
- See only their buyer group's request lists
- IC Memo generation tool
- Platform guide access
- No analytics, contacts, audit logs, or settings
Key Features
1. Deal Management
- Deal rooms with folder organization
- Document upload and management
- Deal timelines (IOI, LOI, exclusivity tracking)
- Deal status and stage tracking
2. Request Lists
- Buyer group segmentation
- Seller and buyer comment columns
- Atlas AI status tracking (fulfilled/partial/missing)
- CSV import/export capability
- Confidence scoring
3. Atlas AI Integration
- Document chat interface
- Folder summaries
- Deal scoring algorithms
- IC memo generation
- Concise responses with document links
4. Role-Based Security
- Row-level security in database
- Role-based sidebar navigation
- Filtered data access per buyer group
- Audit logging of all actions
5. UI/UX Features
- Light/dark mode toggle
- Responsive design
- Real-time updates
- Toast notifications
- Modal dialogs and forms
Authentication System
- Supabase auth integration
- Demo accounts for testing (separate seller/buyer logins)
- Organization-based access control
- Session management
File Structure
src/
├── pages/ # Main application pages
├── components/ # Reusable components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and API layer
├── integrations/ # Supabase client and types
└── components/ui/ # Shadcn UI components
supabase/
├── migrations/ # Database schema changes
└── functions/ # Edge functions for AI/backend logic
Technology Stack
- Frontend: React 18, TypeScript, Vite
- UI: Tailwind CSS, Shadcn/UI, Lucide Icons
- State: React hooks, Context API
- Backend: Supabase (PostgreSQL, Auth, Edge Functions)
- AI: OpenAI integration via edge functions
- Deployment: Lovable hosting platform
Notes
This specification was generated from file tree analysis. The actual implementation details, database schema, and API contracts would need to be extracted from the source code for a complete rebuild in Go.
Key areas needing deeper investigation:
- Complete database schema from migration files
- API endpoint definitions from edge functions
- Component props and state management patterns
- Authentication flow and RLS policies
- AI prompt engineering and model configurations
Migration Considerations for Go
- Database: Migrate PostgreSQL schema, implement similar RLS patterns
- Auth: Implement JWT-based auth with organization scoping
- AI Integration: Port edge function logic to Go handlers
- Role System: Recreate buyer/seller role distinctions
- Real-time: Consider WebSocket implementation for live updates
- File Upload: Implement document storage and management
- Audit: Create comprehensive audit logging system