Files Created:
lib/supabase.ts- Supabase client configuration
Features:
- Client-side and server-side Supabase clients
- Database schema for employees table
- SQL setup script in SETUP_INSTRUCTIONS.md
Status: ✅ Complete (requires user setup)
Files Created:
app/api/employees/create/route.ts- Employee registration APIapp/api/auth/login/route.ts- Authentication APIapp/api/send-email/route.ts- Email automation API
Files Modified:
app/api/chat/route.ts- Text chatbot API with OpenAI function calling
Features:
- Employee creation with validation
- Email uniqueness check
- Plain-text password matching (demo only)
- Multi-recipient email routing (IT, HR, Manager)
- Email template generation
- Resend integration
- OpenAI GPT-4o-mini integration for text chatbot
- Function calling for automated email sending (text chatbot)
Status: ✅ Complete
Files Modified:
components/hr-onboarding-dashboard.tsx
Changes:
- Connected form submission to
/api/employees/create - Real database storage via Supabase
- Error handling and user feedback
- Success confirmation with employee details
Status: ✅ Complete
Files Modified:
components/employee-auth/login-form.tsx
Changes:
- Real authentication against Supabase
- Credential matching (email + password)
- Error handling for invalid credentials
- User profile retrieval on successful login
Status: ✅ Complete
Files Created:
components/anam-avatar-chatbot.tsx
Features:
- Anam AI SDK integration
- Video avatar streaming
- Voice input/output
- Function calling for email automation
- Three email functions: IT, HR, Manager
- Real-time status indicators
- Error handling and reconnection
- Microphone permission handling
Function Calling:
- send_email_to_it: License/access requests → IT Support
- send_email_to_hr: Policy/benefits questions → HR Team
- send_email_to_manager: Manager communications → Employee's ManagerStatus: ✅ Complete
Files Created:
components/text-chatbot.tsx- Text-based chat with function callingcomponents/dual-chatbot-interface.tsx- Mode switcher component
Features:
- Toggle between Text and Avatar modes
- Seamless switching
- Consistent styling
- Employee context passed to both modes
- Text chatbot now has email sending capabilities via OpenAI function calling
- Three email functions: IT, HR, Manager (same as avatar)
Function Calling (Text Chatbot):
- send_email_to_it: License/access requests → IT Support
- send_email_to_hr: Policy/benefits questions → HR Team
- send_email_to_manager: Manager communications → Employee's ManagerStatus: ✅ Complete
Files Modified:
components/employee-dashboard.tsx
Changes:
- Replaced
OnboardingChatbotwithDualChatbotInterface - Added manager_email to user type
- Passed employee context to chatbot components
Status: ✅ Complete
Files Modified:
package.json
Added:
@supabase/supabase-js^2.39.0resend^3.2.0@anam-ai/js-sdk^4.4.0@ai-sdk/openai^2.0.59
Status: ✅ Complete and installed
Files Created:
SETUP_INSTRUCTIONS.md- Detailed setup guideDEMO_GUIDE.md- Live demo presentation scriptREADME.md- Project overview and quick startIMPLEMENTATION_SUMMARY.md- This file
Status: ✅ Complete
- HR can create new employees via form
- Data stored in Supabase database
- Immediate credential generation
- Real-time employee list display
- Login with HR-created credentials
- Database validation
- Session management
- Personalized dashboard access
- Voice-activated AI assistant
- Natural language understanding
- Automatic email routing based on intent
- Function calling to backend API
- Email delivery via Resend
- Text chat mode
- Avatar chat mode
- Easy toggle between modes
- Consistent user experience
v0-onboarding-agent-ui-ux/
├── app/
│ ├── api/
│ │ ├── auth/
│ │ │ └── login/route.ts ✨ NEW
│ │ ├── employees/
│ │ │ └── create/route.ts ✨ NEW
│ │ ├── send-email/route.ts ✨ NEW
│ │ └── chat/route.ts (existing)
│ ├── layout.tsx
│ ├── page.tsx
│ └── globals.css
├── components/
│ ├── employee-auth/
│ │ └── login-form.tsx ✏️ MODIFIED
│ ├── anam-avatar-chatbot.tsx ✨ NEW
│ ├── text-chatbot.tsx ✨ NEW
│ ├── dual-chatbot-interface.tsx ✨ NEW
│ ├── employee-dashboard.tsx ✏️ MODIFIED
│ ├── hr-onboarding-dashboard.tsx ✏️ MODIFIED
│ ├── employee-portal.tsx (existing)
│ ├── employee-profile.tsx (existing)
│ ├── onboarding-checklist.tsx (existing)
│ ├── onboarding-chatbot.tsx (kept for reference)
│ └── integrations-panel.tsx (existing)
├── lib/
│ ├── supabase.ts ✨ NEW
│ └── utils.ts (existing)
├── SETUP_INSTRUCTIONS.md ✨ NEW
├── DEMO_GUIDE.md ✨ NEW
├── IMPLEMENTATION_SUMMARY.md ✨ NEW
├── README.md ✏️ MODIFIED
├── package.json ✏️ MODIFIED
└── .env.local.example (blocked by gitignore)
HR fills form
↓
POST /api/employees/create
↓
Supabase INSERT into employees table
↓
Success response
↓
UI updates with new employee
Employee enters credentials
↓
POST /api/auth/login
↓
Supabase SELECT with email + password match
↓
Return employee profile
↓
Dashboard displays with user data
Employee speaks to avatar: "I need Adobe license"
↓
Anam AI processes speech
↓
AI detects intent → send_email_to_it function
↓
Function call to frontend handler
↓
POST /api/send-email with function details
↓
API formats email template
↓
Resend sends email to it-support@raspberry-coffee.com
↓
API returns success to frontend
↓
Frontend returns success to Anam AI
↓
Avatar confirms: "I've sent your request to IT Support!"
- Create Supabase project
- Run SQL to create employees table
- Copy API credentials
- Add to .env.local
- Create Resend account
- Generate API key
- Add to .env.local
- (Optional) Verify domain
- Create
.env.localfile - Add Supabase credentials
- Add Resend API key
- Verify Anam AI keys are present
- Run
pnpm dev - Test HR employee creation
- Test employee login
- Test AI avatar with microphone
- Test email automation
- Verify emails in Resend dashboard
Test Case: License Request
-
HR Action
- Create employee: Kai Yang / kai.yang@raspberry-coffee.com / demo123
-
Employee Action
- Login with credentials
- Navigate to chatbot
- Click "Avatar" mode
- Allow microphone
- Say: "I need access to Adobe Creative Cloud license"
-
Expected Result
- AI understands request
- Email sent to it-support@raspberry-coffee.com
- Email contains:
- Employee name: Kai Yang
- Employee email: kai.yang@raspberry-coffee.com
- Request type: License Request
- Details: Adobe Creative Cloud license
- AI confirms: "I've sent your request to IT Support!"
- Avatar ID: 30fa96d0-26c4-4e55-94a0-517025942e18 (Professional avatar)
- Voice ID: 6bfbe25a-979d-40f3-a92b-5394170af54b (Friendly voice)
- LLM: GPT-4.1 Mini (Fast and cost-effective)
- Session Length: 30 minutes (1800 seconds)
- Sender: onboarding@raspberry-coffee.com (configurable)
- Recipients:
- IT: it-support@raspberry-coffee.com
- HR: hr@raspberry-coffee.com
- Manager: From employee profile (manager_email)
employees (
id UUID PRIMARY KEY,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
name TEXT NOT NULL,
role TEXT NOT NULL,
project TEXT NOT NULL,
manager_email TEXT,
onboarding_status TEXT DEFAULT 'active',
created_at TIMESTAMP DEFAULT NOW()
)This is a DEMO APPLICATION with simplified security:
- Passwords stored in plain text
- No JWT tokens
- Simple authentication
- No rate limiting
For production:
- Implement bcrypt password hashing
- Use Supabase Auth or JWT
- Add API rate limiting
- Implement CORS properly
- Add input validation/sanitization
- Use environment variable validation
- No password reset functionality
- No email verification
- No session management
- No audit logging
- No role-based access control (RBAC)
- Microphone-only input for avatar (no keyboard)
Your implementation is complete when:
- All code files created/modified
- Dependencies installed
- Documentation written
- Supabase configured (user action)
- Resend configured (user action)
- Environment variables set (user action)
- Application tested end-to-end (user action)
- Demo rehearsed (user action)
- Setup Help: See SETUP_INSTRUCTIONS.md
- Demo Help: See DEMO_GUIDE.md
- Supabase Docs: https://supabase.com/docs
- Resend Docs: https://resend.com/docs
- Anam AI Docs: https://docs.anam.ai
"We've built an intelligent onboarding platform that combines HR efficiency with AI-powered employee assistance.
HR can onboard employees in seconds, and those employees immediately have access to an AI assistant that not only answers questions but can automatically send emails to the right people.
For example, if a new employee needs a software license, they simply tell our AI avatar, and it automatically emails IT support with all the details. No forms, no searching for email addresses, no manual process.
This is powered by Anam AI's function calling, Supabase for data management, and Resend for reliable email delivery. The entire system is built with Next.js and TypeScript for type safety and developer experience."
Implementation completed successfully! Ready for setup and testing. 🚀