An AI-powered Japanese language tutor that helps you practice conversational Japanese with real-time translations and speech synthesis.
- 🤖 AI Conversation - Practice Japanese with an AI tutor powered by Groq's llama-3.3-70b-versatile model
- 🔊 Text-to-Speech - Hear proper Japanese pronunciation
- 🎤 Voice Input - Speak in Japanese using speech recognition
- 🌐 Real-time Translation - See English translations of all messages
- 📚 Word of the Day - Learn a new Japanese word every day
- 🌓 Dark Mode - Easy on the eyes
- 📱 Responsive Design - Works perfectly on mobile, tablet, and desktop
- 🔐 Secure - API keys never exposed to the frontend
-
Clone the repository
git clone <your-repo-url> cd AfnyAI-v2
-
Install dependencies
npm install
-
Get a Groq API Key
- Visit Groq Console
- Create a new API key (it's free!)
-
Configure environment
# Copy the example file cp .env.local.example .env.local # Edit .env.local and add your Groq API key GROQ_API_KEY=your_groq_api_key_here
-
Run the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:8888 - Start chatting in Japanese! 🎉
- Navigate to
See DEPLOYMENT.md for detailed deployment instructions.
Quick deploy:
Important: After deployment, set the GROQ_API_KEY environment variable in your Netlify dashboard!
- Frontend: React 19, TypeScript, Tailwind CSS
- Backend: Netlify Serverless Functions
- AI Model: Groq llama-3.3-70b-versatile
- Build Tool: Vite
- Deployment: Netlify
AfnyAI-v2/
├── components/ # React components
│ ├── ChatView.tsx # Main chat interface
│ ├── WordOfTheDay.tsx # Daily word widget
│ └── ...
├── netlify/
│ └── functions/ # Serverless API endpoints
│ ├── chat.ts # Chat completions
│ ├── translate.ts # Translation
│ └── word-of-day.ts
├── services/
│ ├── apiService.ts # API client for Netlify functions
│ └── speechService.ts # Speech synthesis & recognition
├── App.tsx # Main application component
├── netlify.toml # Netlify configuration
└── package.json
- ✅ API keys stored securely in Netlify environment variables
- ✅ All AI requests go through serverless functions
- ✅ No sensitive data exposed to the frontend
- ✅
.env.localis gitignored by default
- Practice Greetings: Start with "こんにちは" or "はじめまして"
- Use Voice Input: Click the microphone to practice speaking
- Check Translations: All Japanese text shows English translation below
- Learn Daily Words: Click the speaker icon on the Word of the Day
- Dark Mode: Toggle with the moon/sun icon in the header
- Make sure you run
npm run dev(notvite) - Check that
.env.localhas yourGROQ_API_KEY
- Access via
http://localhost:8888(Netlify Dev port) - Not
http://localhost:5173(Vite port)
- Ensure Node.js version 18+
- Delete
node_modulesandpackage-lock.json, thennpm install
GROQ_API_KEY=your_groq_api_key_hereSet in Netlify Dashboard → Site Settings → Environment Variables:
GROQ_API_KEY= your_groq_api_key_here
MIT
Contributions are welcome! Please feel free to submit a Pull Request.