A modern, responsive frontend for AgentBay - a platform where users interact with intelligent AI agents through chat, voice, and file upload.
- Authentication: Secure login/signup with JWT tokens
- Agent Dashboard: Browse and interact with AI agents
- Chat Interface: Real-time messaging with AI agents
- File Upload: Drag & drop file uploads for context
- Voice Input: Record and transcribe voice messages
- Custom Agents: Create personalized AI agents with specific tools
- Dark Theme: Beautiful glass morphism design
- Responsive: Works seamlessly on mobile, tablet, and desktop
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Components: shadcn/ui
- State Management: React Context
- API Client: Fetch API with custom wrapper
- File Handling: react-dropzone
- Themes: next-themes
-
Clone the repository ```bash git clone cd agentbay-frontend ```
-
Install dependencies ```bash npm install
yarn install
pnpm install ```
-
Set up environment variables ```bash cp .env.example .env.local ```
Edit
.env.local
and set your backend API URL: ```env NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 ``` -
Run the development server ```bash npm run dev
yarn dev
pnpm dev ```
-
Open your browser Navigate to http://localhost:3000
This frontend is designed to work with a Python backend that exposes the following endpoints:
Endpoint | Method | Description |
---|---|---|
/login |
POST | User authentication |
/signup |
POST | User registration |
/agents |
GET | List available agents |
/chat |
POST | Send message to agent |
/transcribe |
POST | Audio transcription |
/upload |
POST | File upload |
/custom-agent |
POST | Create custom agent |
/credits |
GET | Get user credits |
Login/Signup Response: ```json { "token": "jwt_token_here", "user": { "id": "user_id", "email": "user@example.com" } } ```
Agents Response: ```json [ { "id": "agent_1", "name": "Data Analyst", "description": "Analyzes data and provides insights", "tools": ["calculator", "chart_generator"] } ] ```
Chat Response: ```json { "message": "AI agent response here" } ```
``` agentbay-frontend/ ├── app/ # Next.js App Router pages │ ├── auth/ # Authentication pages │ ├── dashboard/ # Main dashboard │ ├── chat/ # Chat interface │ ├── agents/ # Agent management │ └── globals.css # Global styles ├── components/ # Reusable components │ ├── ui/ # shadcn/ui components │ ├── agent-card.tsx # Agent display card │ ├── chat-interface.tsx # Main chat component │ ├── chat-bubble.tsx # Individual message │ ├── file-upload.tsx # File upload component │ └── voice-input.tsx # Voice recording ├── contexts/ # React contexts │ └── auth-context.tsx # Authentication state ├── lib/ # Utilities │ ├── api.ts # API client │ └── utils.ts # Helper functions └── hooks/ # Custom hooks └── use-toast.ts # Toast notifications ```
The application uses a custom dark theme with glass morphism effects:
- Colors: Dark gradients with blue/purple accents
- Components: Glass-effect cards with backdrop blur
- Typography: Clean, modern font hierarchy
- Animations: Smooth transitions and hover effects
- Responsive: Mobile-first design approach
- Update the
Agent
interface inlib/api.ts
- Modify the
AgentCard
component to display new fields - Update the backend integration accordingly
- Modify
app/globals.css
for global styles - Update
tailwind.config.ts
for theme customization - Edit component-specific styles in individual files
- All API calls are centralized in
lib/api.ts
- Add new endpoints by extending the
ApiClient
class - Update environment variables in
.env.local
- Push your code to GitHub
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push
-
Build the application: ```bash npm run build ```
-
Start the production server: ```bash npm start ```
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Commit changes:
git commit -am 'Add new feature'
- Push to branch:
git push origin feature/new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation for common solutions
- Contact the development team
Note: This frontend is ready for production use and seamlessly integrates with LangChain-based Python backends. Make sure your backend implements the expected API endpoints for full functionality.