Gatewayz is a comprehensive AI model management platform, providing a unified interface for accessing and managing various Large Language Models (LLMs). The platform offers model browsing, interactive chat functionality, performance analytics, and developer tools.
- Unified Model Access: Browse and access 300+ AI models from 60+ providers through a single interface
- Interactive Chat: Real-time chat interface with multiple AI models
- Model Analytics: Comprehensive rankings and performance insights
- Developer Tools: API management, settings, and integration tools
- Responsive Design: Modern UI with dark/light theme support
- Authentication: Secure user authentication with Privy (email, Google, GitHub)
- Home: Landing page with featured models and platform overview
- Models: Comprehensive model browser with filtering and search capabilities
- Chat: Interactive chat interface with model selection
- Inbox: AI coding agent inbox powered by Terragon (see docs/TERRAGON_INBOX_SETUP.md)
- Rankings: Performance analytics and model comparisons
- Settings: User preferences, API keys, and configuration management
- Developers: Developer resources and documentation
- Organizations: Organization management and team features
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Icon library
- Recharts - Data visualization
- Chart.js - Advanced charting capabilities
- Privy - Web3-native authentication with email, Google, and GitHub
- NextAuth.js - Additional authentication support
- Google Genkit - AI orchestration framework
- Google AI - Gemini model integration
- Firebase - Backend services and database
- ESLint - Code linting
- PostCSS - CSS processing
- pnpm - Package management
- Faker.js - Mock data generation
gatewayz-frontend/
βββ src/
β βββ ai/ # AI integration and flows
β β βββ dev.ts # Development AI configuration
β β βββ flows/
β β β βββ chat-flow.ts # Chat flow implementation
β β βββ genkit.ts # Genkit AI setup
β βββ app/ # Next.js App Router pages
β β βββ api/ # API routes
β β β βββ auth/ # Authentication endpoints
β β β βββ init-db/ # Database initialization
β β β βββ test-db/ # Database testing
β β βββ chat/ # Chat interface
β β βββ models/ # Model browser
β β β βββ [name]/ # Dynamic model pages
β β βββ organizations/ # Organization management
β β β βββ [name]/ # Dynamic organization pages
β β βββ rankings/ # Analytics dashboard
β β βββ settings/ # User settings
β β β βββ account/ # Account management
β β β βββ activity/ # Activity logs
β β β βββ credits/ # Credit management
β β β βββ integrations/# Integration settings
β β β βββ keys/ # API key management
β β β βββ presets/ # Preset management
β β β βββ privacy/ # Privacy settings
β β β βββ provisioning/# Provisioning settings
β β βββ developers/ # Developer resources
β βββ components/ # Reusable UI components
β β βββ ui/ # Base UI components (Radix UI)
β β βββ auth/ # Authentication components
β β βββ chat/ # Chat-specific components
β β βββ dashboard/ # Analytics components
β β βββ layout/ # Layout components
β β βββ models/ # Model-related components
β β βββ providers/ # Context providers
β β βββ theme-provider.tsx # Theme management
β βββ hooks/ # Custom React hooks
β β βββ use-auth.ts # Authentication hook
β β βββ use-mobile.tsx # Mobile detection
β β βββ use-toast.ts # Toast notifications
β β βββ useModelData.ts # Model data management
β βββ lib/ # Utilities and data
β β βββ data.ts # Model and analytics data
β β βββ database.ts # Database utilities
β β βββ firebase.ts # Firebase configuration
β β βββ models-data.ts # Model definitions
β β βββ privy.ts # Privy authentication config
β β βββ provider-data.ts# Provider information
β β βββ utils.ts # General utilities
β βββ styles/ # Global styles
βββ docs/ # Documentation
βββ public/ # Static assets
β βββ assets/ # Images and icons
β βββ *.svg # SVG assets
βββ apphosting.yaml # Firebase App Hosting config
- Node.js 18+
- pnpm (recommended) or npm
- Privy account (for authentication)
- Google AI API key (for Genkit)
-
Clone the repository
git clone <repository-url> cd gatewayz-frontend
-
Install dependencies
pnpm install # or npm install -
Environment Setup Create a
.env.localfile in the root directory:# Privy Configuration NEXT_PUBLIC_PRIVY_APP_ID=your-privy-app-id # Google AI API Key (for Genkit) GOOGLE_AI_API_KEY=your-google-ai-api-key
-
Privy Setup
- Create a Privy account at dashboard.privy.io
- Create a new app and get your App ID
- Configure login methods (email, Google, GitHub)
- Set up OAuth providers for Google and GitHub
- Add your domain to authorized domains
-
Start development server
pnpm dev # or npm run dev -
Start AI development server (in a separate terminal)
pnpm genkit:dev
The application will be available at http://localhost:3000
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm typecheck- Run TypeScript type checkingpnpm genkit:dev- Start Genkit AI development serverpnpm genkit:watch- Start Genkit with file watching
- Privy Integration: Web3-native authentication with multiple providers
- Multiple Login Methods: Email/password, Google OAuth, GitHub OAuth
- Secure Session Management: JWT-based authentication with automatic refresh
- User Profile Management: Comprehensive user settings and preferences
- 300+ Models: Access to models from OpenAI, Google, Anthropic, Meta, and more
- Advanced Filtering: Filter by modality, context length, pricing, and capabilities
- Real-time Search: Instant model discovery with intelligent search
- Performance Metrics: Token usage, latency, and cost tracking
- Dynamic Model Pages: Individual pages for each model with detailed information
- Multi-Model Support: Switch between different AI models seamlessly
- Session Management: Persistent chat history with local storage
- Real-time Responses: Streaming AI responses with loading states
- Model Selection: Easy model switching with categorized options
- Custom Styling: Dedicated CSS for chat interface
- Performance Rankings: Model performance comparisons across categories
- Usage Statistics: Token generation and model usage analytics
- Trend Analysis: Historical performance data with interactive charts
- Category Filtering: Filter analytics by model categories and time ranges
- Interactive Charts: Advanced data visualization with Chart.js and Recharts
- API Management: Manage API keys and provider settings
- Integration Guides: Documentation for API integration
- Settings Panel: Comprehensive configuration options
- Provider Management: Control which AI providers to use
- Database Management: Built-in database initialization and testing tools
- Team Management: Organization-based user management
- Resource Sharing: Shared access to models and configurations
- Billing Management: Organization-level billing and usage tracking
The application uses Privy for authentication. Configure your Privy app:
-
Dashboard Configuration:
- Enable email, Google, and GitHub login methods
- Configure OAuth providers with proper redirect URIs
- Set up your app appearance and branding
-
Environment Variables:
NEXT_PUBLIC_PRIVY_APP_ID=your-privy-app-id
-
OAuth Provider Setup:
- Google: Set up OAuth in Google Cloud Console
- GitHub: Create OAuth app in GitHub Developer Settings
- Use Privy's callback URLs for both providers
Firebase is used for backend services. Configure in src/lib/firebase.ts:
const firebaseConfig = {
projectId: "your-project-id",
appId: "your-app-id",
storageBucket: "your-storage-bucket",
apiKey: "your-api-key",
authDomain: "your-auth-domain",
messagingSenderId: "your-sender-id"
};AI models are configured in src/ai/genkit.ts and model data is managed in src/lib/models-data.ts.
The application supports dark/light themes with configuration in tailwind.config.ts and theme provider in src/components/theme-provider.tsx.
The project is configured for Firebase App Hosting with apphosting.yaml:
run: pnpm run build && pnpm run startEnsure all required environment variables are set in your deployment environment:
NEXT_PUBLIC_PRIVY_APP_IDGOOGLE_AI_API_KEY
- Set up proper OAuth redirect URIs for production domains
- Configure Firebase project for production
- Set up proper CORS policies
- Configure Google Analytics (already included)
- App Router: Uses Next.js 15 App Router for modern routing
- TypeScript: Full type safety throughout the application
- Component Library: Radix UI components with custom styling
- State Management: React hooks and context for state management
- Error Handling: Comprehensive error boundaries and error handling
useAuth: Authentication state managementuseMobile: Mobile device detectionuseToast: Toast notification managementuseModelData: Model data fetching and management
/api/auth/[...nextauth]: NextAuth.js authentication/api/init-db: Database initialization/api/test-db: Database testing endpoints
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open 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 repository
- Check the documentation in the
docs/folder - Review the component examples in
src/components/ - Check the Privy documentation for authentication issues
The platform includes comprehensive testing tools for validating tool/function calling capabilities across AI models.
# Set your API key
export GATEWAYZ_API_KEY="your_api_key_here"
# List models with tool calling support
pnpm tsx test-tool-calling.ts --list
# Run a simple test
pnpm tsx test-tool-calling-simple.ts
# Test with curl
bash test-tool-calling-curl.shtest-tool-calling.ts- Full test suite with multiple scenariostest-tool-calling-simple.ts- Quick minimal exampletest-tool-calling-curl.sh- Shell script using curlTOOL_CALLING_README.md- Quick start guideTOOL_CALLING_TESTS.md- Complete documentationTOOL_CALLING_EXAMPLE_OUTPUT.md- Example outputs
- GPT-4o mini (OpenAI)
- Qwen: Qwen2 72B A16B 2507 (FREE) β
- Qwen: Qwen2 57B A14B 2507
- DeepSeek: DeepSeek V3.5
- Anthropic: Claude 3.7 Sonnet
- Google: Gemini 2.1 Pro
- And more...
See TOOL_CALLING_README.md for detailed instructions.
- Tool Calling Tests - Tool/function calling test suite
- Privy Documentation
- Next.js Documentation
- Google Genkit Documentation
- Radix UI Documentation
- Tailwind CSS Documentation