A production full-stack CRM for DVC Engineering Ltd — a structural engineering consultancy based in London. Pulls granted planning applications, scores and vets leads, assigns to engineers with O365 calendar events, and sends AI-generated outreach via Resend.
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (Pages Router), React 18 |
| Database | Supabase (Postgres + RLS) |
Resend (crm@dvceng.com) |
|
| AI Generation | Anthropic Claude (claude-sonnet-4-20250514) |
| Calendar | Microsoft Graph API (O365) |
| Hosting | Vercel (with cron jobs) |
| Auth | JWT (HttpOnly cookies + localStorage) |
- Create a new project at supabase.com
- Run
db/schema.sqlin the SQL editor - Copy Project URL and anon key →
NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY - Copy service role key →
SUPABASE_SERVICE_ROLE_KEY
- Add and verify
dvceng.comdomain at resend.com - Add DNS records as instructed
- Create API key →
RESEND_API_KEY
- Create account at console.anthropic.com
- Generate API key →
ANTHROPIC_API_KEY
See docs/azure-setup.md for full steps.
Request a key: GET https://api.planning.org.uk/v1/generatekey?email=jesan@dvceng.com
Set → PLANNING_API_KEY
git push origin main
# Import repo at vercel.com, add all env vars, deploy
# Add CNAME: crm.dvceng.com → cname.vercel-dns.com| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY |
Service role key (server only) |
JWT_SECRET |
Random 32+ char string |
RESEND_API_KEY |
Resend API key |
EMAIL_FROM |
crm@dvceng.com |
ANTHROPIC_API_KEY |
Anthropic API key |
MS_TENANT_ID |
Azure tenant ID |
MS_CLIENT_ID |
Azure app client ID |
MS_CLIENT_SECRET |
Azure client secret |
PLD_API_HEADER |
Planning London Datahub header |
PLANNING_API_KEY |
api.planning.org.uk key |
DIRECTOR_EMAIL |
jesan@dvceng.com |
CRON_SECRET |
Random 32+ char string |
| Schedule | Route | Action |
|---|---|---|
0 7 * * * |
/api/cron/daily-intelligence |
Stagnancy digest, reminders, re-engagement, lapse warnings |
0 8 * * 1 |
/api/cron/weekly-reengage |
Weekly re-engagement emails |
WARNING: Change these immediately after deployment via Supabase SQL.
Default login:
jesan@dvceng.com/DVC2024!Change
UPDATE users SET password_hash = '$2b$10$...' WHERE email = 'jesan@dvceng.com';Use a bcrypt generator to hash your new password.