A modern React application built with the latest stable versions of Vite, React, TypeScript, Tailwind CSS, and shadcn/ui.
- Vite v7.2.4 - Next Generation Frontend Tooling
- React v19.0.0 - Latest stable React with concurrent features
- TypeScript v5.6.2 - Type-safe development
- Tailwind CSS v3.4.17 - Utility-first CSS framework
- shadcn/ui v3.5.0 - Beautiful, accessible components
- Mastra - Agent framework for AI workflows
- OpenRouter - Unified API for multiple AI models
- Node.js v22.12.0 - JavaScript runtime
- ⚡️ Lightning fast HMR with Vite
- 🎨 Tailwind CSS for styling
- 🧩 shadcn/ui components pre-configured
- 📝 TypeScript for type safety
- 🎯 Path aliases configured (@/ for src/)
- 🌗 Dark mode support built-in
- 📦 Optimized production builds
- 🤖 AI Agent powered by Mastra & OpenRouter
- 💬 Chat interface for testing AI agents
- 🔌 Extensible agent architecture
- Node.js 20.19+ or 22.12+
- npm or yarn
Dependencies are already installed. If you need to reinstall:
```bash npm install ```
- Copy the example environment file:
```bash cp .env.example .env ```
-
Get your OpenRouter API key from https://openrouter.ai/keys
-
Add your API key to the
.envfile:
``` VITE_OPENROUTER_API_KEY=your_actual_api_key_here ```
Start the development server:
```bash npm run dev ```
The app will be available at http://localhost:5173/
Build for production:
```bash npm run build ```
Preview the production build:
```bash npm run preview ```
``` . ├── public/ # Static assets ├── src/ │ ├── agents/ # AI agent configuration │ │ ├── config.ts # Mastra & OpenRouter setup │ │ └── testAgent.ts # Test agent implementation │ ├── components/ # React components │ │ ├── ui/ # shadcn/ui components │ │ └── AgentChat.tsx # AI chat interface │ ├── lib/ # Utility functions │ ├── App.tsx # Main app component │ ├── main.tsx # Entry point │ └── index.css # Global styles ├── specs/ # Project specifications └── index.html # HTML template ```
The application includes a test AI agent powered by Mastra and OpenRouter.
- Chat Interface: Interactive UI to communicate with the AI agent
- OpenRouter Integration: Access to multiple AI models through a single API
- Extensible Architecture: Easy to add new agents and tools
- Type-Safe: Full TypeScript support for agent configuration
The test agent uses meta-llama/llama-3.1-8b-instruct:free from OpenRouter, which is free to use.
- Create a new agent file in
src/agents/ - Configure the agent with your desired model and instructions
- Export a chat function similar to
chatWithAgent - Use the agent in your components
OpenRouter provides access to many models. Some popular options:
meta-llama/llama-3.1-8b-instruct:free(Free)openai/gpt-4-turboanthropic/claude-3.5-sonnetgoogle/gemini-pro
See OpenRouter Models for the full list.
Note: The shadcn CLI has compatibility issues with Node.js v22. Components must be added manually.
To add a new component:
- Visit shadcn/ui components
- Copy the component code
- Create a new file in
src/components/ui/ - Import and use in your app
The Button component is already included as an example.
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Vite config:
vite.config.ts - TypeScript config:
tsconfig.json,tsconfig.node.json - Tailwind config:
tailwind.config.js - PostCSS config:
postcss.config.js - shadcn/ui config:
components.json
The project uses @/ as an alias for the src/ directory:
```typescript import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' ```
MIT