┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Frontend │ │ Backend │ │ Mistral │
│ (Next.js) │◄───►│ (FastAPI) │◄───►│ AI │
└─────────────┘ └─────────────┘ └─────────────┘
▲ ▲
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Browser │ │ GameFAQs │
│ Storage │ │ Website │
└─────────────┘ └─────────────┘
- Purpose: Modern web interface for user interaction
- Key Features:
- Guide management interface
- Interactive chat with AI
- Game selection and navigation
- User settings and preferences
- Directory Structure:
frontend/ ├── src/ │ ├── components/ # Reusable UI components │ ├── pages/ # Next.js pages │ ├── api/ # API client code │ ├── hooks/ # Custom React hooks │ └── styles/ # CSS and styling ├── public/ # Static assets └── package.json # Dependencies
- Purpose: API server and business logic
- Key Features:
- Guide management
- Chat functionality
- API key management
- Data persistence
- Directory Structure:
gamefriend/ ├── api/ # API endpoints ├── chat/ # Chat functionality ├── guide/ # Guide management ├── models/ # Data models └── utils/ # Utility functions
- Frontend:
- Guide list view
- Guide download interface
- Game selection
- Backend:
- Guide storage
- GameFAQs scraping
- File system operations
- Frontend:
- Chat interface
- Message history
- Real-time updates
- Backend:
- Mistral AI integration
- Chat history management
- Context handling
- User initiates guide download in web interface
- Frontend calls backend API
- Backend scrapes GameFAQs
- Guide is stored and indexed
- Frontend updates guide list
- User sends message in web interface
- Frontend calls chat API endpoint
- Backend processes with Mistral AI
- Response is returned to frontend
- Chat interface updates
- User browses available games
- Frontend fetches game list from API
- User selects game for chat
- Context is maintained in backend
- Chat history is preserved
- React state for UI components
- API client for data fetching
- Local storage for preferences
- WebSocket for real-time updates
- Database for persistent storage
- In-memory cache for performance
- Session management
- API key storage
GET /api/guides- List available guidesPOST /api/guides/download- Download new guideGET /api/guides/{game_id}- Get specific guideDELETE /api/guides/{game_id}- Remove guide
POST /api/chat/start- Start new chat sessionPOST /api/chat/message- Send messageGET /api/chat/history- Get chat historyDELETE /api/chat/session- End chat session
- JWT authentication
- Rate limiting
- Input validation
- CORS configuration
- API key encryption
- Secure storage
- Input sanitization
- Error handling
- Horizontal scaling
- Load balancing
- Caching strategies
- Database optimization
- User accounts
- Guide sharing
- Community features
- Mobile app
- API response time
- Frontend optimization
- Asset delivery
- Real-time updates