Database: PostgreSQL (Supabase) - Connected ✅
Backend API: Express.js on port 3001
Frontend: Vite + React on port 5173
Authentication: JWT-based with role-based access control
File Storage: Supabase Storage (proposal-files bucket)
npm run serverThe API will start on http://localhost:3001
In a new terminal:
npm run devThe app will open at http://localhost:5173
Demo Accounts Available:
-
Admin User
- Email:
admin@dealsentry.ai - Password:
demo - Access: Full system access, audit logs, user management
- Email:
-
Test Users (5 users)
- Emails:
test1@dealsentry.aithroughtest5@dealsentry.ai - Password:
demo(for all test users) - Access: Create proposals, review, integrations
- Emails:
-
Proposal Management
- Create, upload, and review proposals
- AI-powered risk analysis with Azure OpenAI
- Contract renewal tracking
-
Compliance Engine
- 8+ pre-configured compliance rules
- Custom rule creation (PRICING, LEGAL, STRUCTURAL)
- Real-time validation
- Risk scoring (0-100%)
-
Authentication & Security
- JWT-based authentication
- Role-based access control (6 roles)
- Secure API endpoints
- Audit logging
-
Database & Storage
- PostgreSQL with Supabase
- Seeded with demo data
- File upload support (DOCX, PDF)
- Automatic text extraction
-
Integrations Framework
- Salesforce OAuth (demo mode ready)
- HubSpot OAuth (demo mode ready)
- Gmail OAuth (demo mode ready)
- Sync logs and status tracking
-
Audit System
- Complete action history
- User activity tracking
- Proposal change logs
- 6 Users (1 admin: admin@dealsentry.ai, 5 test users: test1-5@dealsentry.ai)
- 8 Compliance Rules (discount limits, legal clauses, etc.)
- 4 Templates (Sales Proposal, MSA, SOW, NDA)
- 3 Sample Proposals (with risk reports)
- 5 Legal Clauses (indemnification, liability, etc.)
All critical environment variables are already configured:
# Database (Supabase PostgreSQL)
DATABASE_URL="postgresql://..."
SUPABASE_URL="https://..."
SUPABASE_ANON_KEY="..."
# Azure OpenAI (for AI risk analysis)
AZURE_OPENAI_ENDPOINT="https://..."
OPENAI_API_KEY="..."
AZURE_OPENAI_DEPLOYMENT="gpt-4o"
# Authentication
NEXTAUTH_SECRET="..." # JWT secret key
# Integrations (Demo Mode Enabled)
SALESFORCE_DEMO_MODE="true"
HUBSPOT_DEMO_MODE="false"
GMAIL_DEMO_MODE="false"Required: Create a storage bucket named proposal-files
- Go to Supabase Dashboard
- Navigate to Storage
- Create new bucket:
proposal-files - Set to Public (for file URLs)
# Install dependencies
npm install
# Start backend API server (port 3001)
npm run server
# Start frontend dev server (port 5173)
npm run dev
# Run both servers concurrently
npm run dev:full
# Database commands
npm run seed # Seed database with demo data
npx prisma db push # Push schema changes
npx prisma studio # Open Prisma Studio GUI
# Build for production
npm run buildBefore deploying to production, set these critical environment variables:
# Set Node environment to production
NODE_ENV=production
# Set your production domain (REQUIRED for CORS security)
PRODUCTION_URL=https://your-production-domain.com
# Use strong secrets (CHANGE THESE!)
NEXTAUTH_SECRET=your-strong-random-secret-here
# Database and other configs...
DATABASE_URL=postgresql://...
AZURE_OPENAI_ENDPOINT=https://...The application automatically restricts CORS based on environment:
- Development (
NODE_ENV != production): Allows localhost origins - Production (
NODE_ENV = production): Only allowsPRODUCTION_URL
Important: Set PRODUCTION_URL environment variable to your actual domain before deploying!
- Set
NODE_ENV=production - Set
PRODUCTION_URLto your domain - Change
NEXTAUTH_SECRETto a strong random string - Configure production database
- Set up Azure OpenAI credentials
- Configure real OAuth credentials (if using integrations)
- Test CORS is working correctly
dealsentry/
├── src/
│ ├── api/ # Backend API routes
│ │ ├── auth.ts # Authentication endpoints
│ │ ├── proposals.ts # Proposal CRUD
│ │ ├── rules.ts # Compliance rules
│ │ ├── templates.ts # Proposal templates
│ │ ├── users.ts # User management
│ │ ├── integrations.ts # Integration management
│ │ ├── oauth.ts # OAuth flows
│ │ ├── files.ts # File upload/download
│ │ ├── analyze.ts # AI risk analysis
│ │ └── audit.ts # Audit logs
│ │
│ ├── pages/ # Frontend pages
│ │ ├── Login.tsx # Authentication page
│ │ ├── Dashboard.tsx # Main dashboard
│ │ ├── Proposals.tsx # Proposal list
│ │ ├── ProposalReview.tsx # Review interface
│ │ ├── Compliance.tsx # Rules management
│ │ ├── Integrations.tsx # Integration setup
│ │ └── Audit.tsx # Audit logs (admin only)
│ │
│ ├── components/ # Reusable UI components
│ ├── lib/ # Utilities and clients
│ │ ├── api-client.ts # Frontend API client
│ │ ├── supabase.ts # Supabase client
│ │ └── db.ts # Prisma client
│ │
│ └── types/ # TypeScript definitions
│
├── prisma/
│ └── schema.prisma # Database schema
│
├── scripts/
│ └── seed-supabase.ts # Database seeding script
│
└── server.ts # Express API server
POST /api/auth/login- User loginPOST /api/auth/register- User registrationGET /api/auth/verify- Verify JWT token
GET /api/proposals- List all proposalsGET /api/proposals/:id- Get single proposalPOST /api/proposals- Create proposalPUT /api/proposals/:id/status- Update statusDELETE /api/proposals/:id- Delete proposalPOST /api/analyze/:id- Analyze with AI
GET /api/rules- List compliance rulesPOST /api/rules- Create ruleGET /api/templates- List templates
GET /api/users- List usersPOST /api/users- Create userPATCH /api/users/:id- Update user
GET /api/integrations- List integrationsPOST /api/integrations/:id/sync- Trigger syncGET /api/integrations/:id/logs- Get sync logs
GET /api/oauth/salesforce/authorize- Start Salesforce OAuthGET /api/oauth/hubspot/authorize- Start HubSpot OAuthGET /api/oauth/gmail/authorize- Start Gmail OAuth
POST /api/files/upload- Upload filePOST /api/files/extract-text- Extract text from documentGET /api/files/download/:path- Download file
GET /api/audit- Get audit logs (admin only)
- Proposal statistics
- Recent proposals
- Contract renewal alerts
- Quick actions
- List view with filters
- Status badges
- Readiness scores
- Quick actions
- Full proposal content
- AI risk analysis
- Compliance findings
- Edit and approve
- Active rules list
- Rule creation
- Rule toggle
- OAuth connection status
- Sync triggers
- Sync history
- Demo mode support
- Complete action history
- User filtering
- Proposal filtering
- Timestamp tracking
# Check if port 3001 is in use
netstat -ano | findstr :3001
# Kill process if needed
taskkill /PID <pid> /F# Verify DATABASE_URL in .env
# Check Supabase dashboard for connection status
# Try pushing schema again
npx prisma db push- Ensure backend is running on port 3001
- Check console for CORS errors
- Verify VITE_API_URL in .env (default: http://localhost:3001)
- Create
proposal-filesbucket in Supabase Storage - Ensure bucket is set to public
- Check SUPABASE_ANON_KEY in .env
-
Create Supabase Storage Bucket
- Name:
proposal-files - Access: Public
- Name:
-
Test All Features
- Login as admin and sales rep
- Create a proposal
- Run AI analysis
- Test integrations
- Review audit logs
-
Customize
- Add more compliance rules
- Create custom templates
- Configure real OAuth credentials for integrations
-
Production Deployment
- Update environment variables
- Configure domain
- Enable real OAuth apps
- Set up proper authentication with password hashing
For issues or questions:
- Check the TODO.md for known issues
- Review FRONTEND_DOCUMENTATION.md for frontend details
- See HUBSPOT_SETUP.md for integration setup
Ready to go! 🎉
Start both servers and login with the demo accounts to explore all features.