A modern chat application for INC with password-protected access and Mistral AI integration for intelligent conversations with multiple colleagues.
- Password-Protected Access: Secure authentication using Vercel environment variables
- Multiple AI Colleagues: Chat with Dennis (Merk specialist) and Niels (Design Expert) powered by Mistral AI Agents
- File Management: Upload files directly to Mistral's knowledge base for agent training
- Conversation History: Maintains chat history per colleague with persistent storage
- Modern UI: Clean, responsive interface built with Next.js and Tailwind CSS
- Frontend: Next.js 16, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- AI: Mistral AI Agents API
- Storage: Mistral File Storage API
- Authentication: Secure cookie-based sessions with SHA-256 hashing
Create a .env.local file (see .env.example for template):
# Mistral AI Configuration
MISTRAL_API_KEY=your-mistral-api-key
MISTRAL_AGENT_ID_DENNIS=your-dennis-agent-id
MISTRAL_WORKSPACE_ID_DENNIS=your-dennis-workspace-id
MISTRAL_AGENT_ID_NIELS=your-niels-agent-id
MISTRAL_WORKSPACE_ID_NIELS=your-niels-workspace-id
# File Upload Configuration
MAX_UPLOAD_MB=20
# Authentication
APP_PASSWORD=your-secure-passwordSet these environment variables in Vercel Project Settings → Environment Variables:
MISTRAL_API_KEY: Your Mistral API keyMISTRAL_AGENT_ID_DENNIS: Dennis agent ID from Mistral StudioMISTRAL_WORKSPACE_ID_DENNIS: Dennis workspace ID from Mistral StudioMISTRAL_AGENT_ID_NIELS: Niels agent ID from Mistral StudioMISTRAL_WORKSPACE_ID_NIELS: Niels workspace ID from Mistral StudioMAX_UPLOAD_MB: Maximum file upload size (default: 20)APP_PASSWORD: Secure password for app access
APP_PASSWORD variable must ONLY be set in Vercel environment variables. Never commit it to the repository.
Each colleague is configured as a Mistral AI Agent with:
- Agent ID: Unique identifier from Mistral Studio
- Workspace ID: Associated Mistral workspace for file storage
- Role: Specialized expertise
| Colleague | Role | Status |
|---|---|---|
| Dennis | Merk specialist | ✅ Active |
| Niels | Design Expert | ✅ Active |
- Clone the repository:
git clone https://github.com/PeterPeterinc/Baind-INC-webapp.git
cd Baind-INC-webapp- Install dependencies:
npm install- Create
.env.localwith your configuration:
cp .env.example .env.local
# Then edit .env.local with your actual credentials- Run the development server:
npm run dev- Open http://localhost:3000 with your browser
- The app is password-protected
- Login with the password set in
APP_PASSWORDenvironment variable - Sessions are stored in secure HTTP-only cookies
- Session duration: 7 days
- Push your code to GitHub
- Connect your repository to Vercel at vercel.com
- Set all required environment variables in Vercel Project Settings
- Vercel will automatically deploy on every push to main branch
Important: Ensure APP_PASSWORD is set in Vercel environment variables before deploying.
- Passwords are never stored in plain text
- Session tokens are SHA-256 hashed
- All API routes validate origin and rate limit
- Environment variables are never committed to repository
- Use
.env.localfor local development (it's in.gitignore)
POST /api/auth/login- Authenticate with passwordPOST /api/auth/logout- Logout and clear sessionPOST /api/chat- Send message to colleague's Mistral agentGET /api/storage- List uploaded filesPOST /api/storage/upload- Upload file to MistralDELETE /api/storage/[id]- Delete file from Mistral
MIT