Botsmann - AI Bot Platform
Overview
Botsmann is a platform for creating, showcasing, and managing AI bots built with the OpenAI API. Each bot provides specialized functionality through a custom web interface that connects to a ChatGPT-powered backend.
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
GitHub Setup
The Botsmann platform uses GitHub for version control and as a deployment source:
-
Push to GitHub:
# Add all changes git add . # Commit changes with a descriptive message git commit -m "Your commit message" # Push to the GitHub repository git push origin <branch-name> -
Merge to Main Branch:
- Create a pull request on GitHub
- Review code changes
- Merge into the main branch
Vercel Deployment
The platform is configured for deployment on Vercel. Deployments are automatically triggered when changes are pushed to the main branch.
-
Initial Vercel Setup:
- Create an account on Vercel
- Connect your GitHub account to Vercel
- Import the Botsmann repository
- Vercel will automatically detect the Next.js project
-
Environment Variables: Set the following environment variables in the Vercel project settings:
OPENAI_API_KEY: Your OpenAI API keyNEXT_PUBLIC_BASE_URL: The base URL of your deployment (e.g., https://botsmann.vercel.app)
-
Deployment Options:
- Production Deployment: Automatically triggered when pushing to the main branch
- Preview Deployments: Automatically created for pull requests
- Manual Deployment: Can be triggered from the Vercel dashboard
-
Monitoring Deployments:
- Monitor build logs in the Vercel dashboard
- Check deployment status in the GitHub repository
- View detailed analytics and performance metrics in Vercel
-
Rollback (if needed):
- Use the Vercel dashboard to view deployment history
- Select a previous successful deployment to instantly rollback
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: