- Add sanitizeMdxContent() in lib/knowledge.ts to escape < followed by numbers (fixes MDX compilation error in production-deployment guide) - Create BotPageTemplate component for bot page deduplication - Refactor medical-expert, research-assistant, artistic-advisor pages to use new template pattern - Template handles: bot lookup, fallback, navigation, layout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Botsmann - AI Bot Suite
Overview
A modern, futuristic AI-powered bot platform featuring intelligent assistants for legal, language learning, research, and more. Built with Next.js 14, featuring a cutting-edge design with gradient backgrounds, glassmorphism effects, and smooth animations.
Architecture
The platform follows a Next.js-based architecture with the following structure:
botsmann/
├── app/ # Main Next.js application
│ ├── api/ # API routes
│ ├── bots/ # Individual bot applications
│ │ ├── medical-expert/ # Medical Expert (Imhotep) bot
│ │ ├── research-assistant/ # Research Assistant (Nerd) bot
│ │ └── ... # Other specialized bots
│ └── ... # Other app directories
├── components/ # Shared UI components
├── data/ # Static data and configuration
├── lib/ # Shared utilities and helper functions
├── public/ # Static assets
│ └── images/ # Image assets used across the platform
└── types/ # TypeScript type definitions
Technology Stack
- Frontend: React, Next.js, TailwindCSS
- Backend: Next.js API routes, OpenAI API integration
- Styling: TailwindCSS with custom utility classes
- Testing: Jest, React Testing Library
- Deployment: Vercel
Getting Started
Prerequisites
- Node.js 18+ and npm
- OpenAI API key
Installation
-
Clone the repository:
git clone https://github.com/yourusername/botsmann.git cd botsmann -
Install dependencies:
npm install -
Copy
.env.exampleto.envand add your OpenAI API key:cp .env.example .envThen edit
.envto include your OpenAI API key:OPENAI_API_KEY=your_api_key_here -
Start the development server:
npm run dev -
Open http://localhost:3000 in your browser.
Development Workflow
Creating a New Bot
-
Create a new directory in
app/bots/with your bot's name (e.g.,app/bots/your-bot-name/) -
Create the following files:
page.tsx: Main entry point for your bot's UIREADME.md: Documentation specific to your botstyles.module.css: Bot-specific styles (if needed)/components/: Directory for bot-specific components
-
Add your bot's metadata to
data/bots.tsto have it appear in the main directory
Code Conventions
- Use TypeScript for all new code
- Use functional components with React hooks
- Follow the component organization pattern established in existing bots
- Document all components with JSDoc comments
- Keep components modular and reusable when possible
Testing
Run tests with:
npm test
Write tests for components in a __tests__ directory alongside the component.
Contributing
-
Create a new branch for your feature:
git checkout -b feature/your-feature-name -
Make your changes and commit them:
git commit -m "Add new feature/fix" -
Push to your branch:
git push origin feature/your-feature-name -
Create a pull request against the main branch
🚀 Deployment
Automated Deployment (Recommended)
This project uses GitHub Actions for fully automated deployment to Vercel with comprehensive monitoring and testing.
Prerequisites
- Vercel Account: Create an account on Vercel
- GitHub Repository: Connect your GitHub repository to Vercel
- Environment Variables: Configure the following secrets in your GitHub repository:
VERCEL_TOKEN: Vercel access tokenVERCEL_ORG_ID: Vercel organization IDVERCEL_PROJECT_ID: Vercel project IDVERCEL_TEAM_URL: Your Vercel team URL
Deployment Process
-
Push to Main Branch:
git add . git commit -m "Your commit message" git push origin main -
Automatic Deployment:
- GitHub Actions workflow triggers automatically
- Dependencies are installed and optimized for production
- Code is linted and tested
- Application is built with production optimizations
- Deployment is pushed to Vercel production environment
- Health checks are performed
-
Deployment Features:
- Production Deployments: Automatic on main branch pushes
- Preview Deployments: Automatic for pull requests
- Rollback Support: Instant rollback to previous deployments
- Performance Monitoring: Real-time metrics and analytics
Monitoring and Verification
- Build Logs: Available in GitHub Actions and Vercel dashboard
- Deployment Status: Real-time updates in GitHub repository
- Performance Metrics: Lighthouse scores and Core Web Vitals
- Error Tracking: Automated error monitoring and alerts
Manual Deployment (Alternative)
# Build the application
npm run build
# Deploy to Vercel
vercel --prod
Environment Variables
Set the following environment variables in your Vercel project:
OPENAI_API_KEY: Your OpenAI API key (if using OpenAI features)NEXT_PUBLIC_BASE_URL: Base URL of your deploymentNEXT_PUBLIC_DEPLOY_TIME: Auto-populated deployment timestamp
Custom Domain Configuration (Optional)
- Purchase a domain through a domain registrar
- Add the domain in your Vercel project settings
- Configure DNS settings as instructed by Vercel
- Verify domain ownership
- Enable HTTPS for your custom domain
Bot Documentation
For details on specific bots, see their individual README files: