System Requirements
Before you begin, ensure your system meets these requirements:Node.js
Version 20 or higherCheck your version:
Package Manager
npm, yarn, or pnpmAny modern package manager works:
- npm (comes with Node.js)
- yarn 1.22+
- pnpm 8+
Recommended: Use Node.js 20 LTS for best compatibility and performance.
Installation Methods
Choose your preferred installation method:- npm
- yarn
- pnpm
Install with npm
Install Dependencies
- Next.js 16.0: React framework
- React 19: UI library
- Vercel AI SDK v5: AI integration
- Tailwind CSS 4: Styling
- Zod 4: Schema validation
- And more (see
package.json)
Setup Environment
.env.local with your configuration (see Environment Variables below)Start Development Server
Environment Variables
GIMA uses environment variables for configuration. All variables are validated at startup using Zod schemas.Required Variables
These API keys are required for the chatbot to function:GROQ API key for LLaMA 3.3 language model (main chat functionality)
- Format: Must start with
gsk_ - Get it: console.groq.com/keys
- Free tier: Yes, generous limits
Google Gemini API key for voice transcription and image analysis
- Format: Must start with
AIza - Get it: makersuite.google.com/app/apikey
- Free tier: Yes, 1500 requests/day
Optional Variables
Runtime environment
- Values:
development,production,test - Effect: Changes logging, error handling, and security headers
Base URL of the application (for production deployments)
Feature Flags
Control optional features using these environment variables:Enable localStorage persistence for chat historyWhen enabled:
- Messages persist across page refreshes
- Stored in browser localStorage with key
gima_chat_history - Users can clear history manually
- Chat history only exists in memory
- Cleared on page refresh
Enable voice-activated work order commands
Enable PDF upload and analysis
Complete .env.local Example
.env.local
Key Technologies
GIMA is built with modern, production-ready technologies:Next.js 16
App Router with server components
- File-based routing
- Server Actions for API calls
- Built-in optimization
React 19
Latest React with concurrent features
- Improved performance
- Better Suspense
- Enhanced hooks
Vercel AI SDK v5
AI framework for chat and streaming
useChathook- Streaming responses
- Tool calling support
Tailwind CSS 4
Utility-first CSS framework
- Responsive design
- Dark mode support
- Custom theme
TypeScript 5
Type safety throughout
- Strict mode enabled
- Full IDE support
- Runtime validation
Zod 4
Schema validation for data
- Type inference
- Runtime safety
- Error handling
Available Scripts
The project includes several npm scripts for development and testing:Project Structure
Understanding the project layout:Verification Steps
After installation, verify everything works:Test Basic Chat
- Open http://localhost:3000
- Type: “Hola, ¿qué puedes hacer?”
- Press Enter
Test Voice Input (Optional)
- Click the microphone icon
- Allow browser microphone access
- Say something like “Prueba de voz”
- Text should appear in the input box
Test Image Analysis (Optional)
- Click the image upload icon
- Upload a photo of equipment or machinery
- The AI should analyze and describe the image
Troubleshooting
Common issues and solutions:Installation fails with module not found errors
Installation fails with module not found errors
Symptoms:Solution:
- Delete
node_modulesand lock file: - Ensure you’re using Node.js 20+:
ZodError: Expected string, received undefined
ZodError: Expected string, received undefined
Symptoms:
Server crashes on startup with Zod validation errors for environment variables.Cause:
Missing or incorrectly formatted API keys in
.env.local.Solution:- Verify
.env.localexists and has correct keys - Check key formats:
- GROQ: starts with
gsk_ - Google: starts with
AIza
- GROQ: starts with
- On Windows, ensure UTF-8 encoding (not UTF-16):
Chat not responding / Streaming fails
Chat not responding / Streaming fails
Symptoms:
Messages don’t appear, or chat shows error state.Solution:
- Check browser console (F12) for errors
- Verify API keys are valid:
- Test GROQ key at console.groq.com
- Test Google key at AI Studio
- Check rate limits (GROQ: 30 req/min)
- Restart dev server:
npm run dev
Voice input not working
Voice input not working
Symptoms:
Microphone button does nothing or shows error.Solution:
- Grant browser microphone permission
- Check if HTTPS or localhost (WebRTC requires secure context)
- Verify
GOOGLE_GENERATIVE_AI_API_KEYis set - Try fallback: Voice should work with Web Speech API if Gemini fails
Image analysis fails
Image analysis fails
Symptoms:
Uploading images shows error or no response.Solution:
- Check image size (max 10MB by default)
- Verify
GOOGLE_GENERATIVE_AI_API_KEYis set - Check supported formats: JPEG, PNG, WebP
- Check Gemini quota at AI Studio
Port 3000 already in use
Port 3000 already in use
Symptoms:Solution:
Use a different port:Or kill the process using port 3000:
TypeScript errors in IDE
TypeScript errors in IDE
Symptoms:
Red squiggly lines in VS Code but code runs fine.Solution:
- Restart TypeScript server in VS Code:
- Cmd/Ctrl + Shift + P
- “TypeScript: Restart TS Server”
- Ensure you opened the project root (not a parent folder)
- Check
.vscode/settings.jsonfor TypeScript config
Build fails but dev works
Build fails but dev works
Symptoms:
npm run dev works but npm run build fails.Solution:- Run type-check to find issues:
- Fix any TypeScript errors
- Check for environment variables used in build (must be set)
- Clear Next.js cache:
Development Workflow
Recommended workflow for contributing to GIMA:Setup Git Hooks
Husky automatically installs Git hooks for:
- Pre-commit: Lints and formats staged files
- Commit-msg: Validates commit message format
Commit with Conventional Commits
feat, fix, docs, style, refactor, perf, test, build, ci, choreNext Steps
Now that you have GIMA installed:Configuration Guide
Learn about advanced configuration options
Core Features
Explore multimodal chat capabilities
AI Tools
Discover AI-powered maintenance tools
Architecture
Understand the system architecture
Getting Help
If you encounter issues not covered here:GitHub Issues
Report bugs or request features
View Source Code
Browse the full source code