AI-powered guidance platform for Indian students pursuing global education. Built with Next.js 14, Supabase, and Groq AI.
- AI Chatbot: Conversational assistant powered by Groq API (Moonshot/Kimi K2)
- Smart Profile Detection: Automatically extracts student information from conversations
- University Recommendations: Personalized suggestions based on profile
- Country Comparisons: Side-by-side analysis with interactive charts
- Streaming Responses: Real-time AI responses via Server-Sent Events
- Authentication: Email/password and Google OAuth via Supabase
- Hybrid Caching: Intelligent data caching with staleness management
- PDF Reports: Generate custom study abroad reports on-demand
- Multiple Chat Sessions: Manage parallel conversations with history
Before you begin, ensure you have:
- Node.js 18+ and npm installed
- A Supabase account (supabase.com)
- A Groq API key (console.groq.com)
- Git
npm installCreate a .env.local file in the root directory:
cp .env.example .env.localEdit .env.local with your credentials:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Groq API
GROQ_API_KEY=your_groq_api_key
# Site Configuration
NEXT_PUBLIC_SITE_URL=http://localhost:3000- Go to your Supabase project dashboard
- Navigate to the SQL Editor
- Run the database schema from
database/schema.sql
The schema includes:
chat_sessions- Store conversation historyuniversities_cache- Cache university datacountries_cache- Cache country informationsaved_comparisons- Save comparison charts
In your Supabase dashboard:
- Go to Authentication β Providers
- Enable Email provider
- Enable Google provider:
- Add your Google OAuth credentials
- Set redirect URL:
http://localhost:3000/auth/callback
- Visit console.groq.com
- Create an account or sign in
- Generate an API key
- Add it to your
.env.localfile
npm run devOpen http://localhost:3000 in your browser.
study-abroad-ai/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication pages
β β βββ login/
β β βββ signup/
β β βββ forgot-password/
β βββ (dashboard)/ # Protected dashboard routes
β β βββ chats/
β β βββ comparisons/
β β βββ profile/
β βββ api/ # API routes
β β βββ auth/
β β βββ chat/
β β βββ groq/
β βββ about/
β βββ page.tsx # Landing page
βββ components/
β βββ ui/ # Shadcn/ui components
β βββ chat/ # Chat interface components
β βββ layout/ # Layout components
βββ lib/
β βββ supabase/ # Supabase clients
β βββ groq/ # Groq API integration
β βββ utils.ts # Utility functions
βββ types/ # TypeScript type definitions
βββ public/ # Static assets
The chat system uses streaming responses for a real-time experience:
// Stream AI responses via SSE
const stream = await streamChatCompletion(messages, ADVISOR_SYSTEM_PROMPT)
// Messages are saved to Supabase with full history
await supabase
.from('chat_sessions')
.update({ messages: [...messages, { role: 'assistant', content: response }] })Data is cached intelligently to balance freshness and performance:
- Universities: 30 days
- Countries: 7 days
- Job Market: 14 days
- Deadlines: 1 day
Stale data is returned immediately while refreshing in the background.
Student profiles are automatically extracted from conversations:
const profileData = await extractProfile(messages)
// Returns: education level, field, budget, preferences, etc.- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
npm run build- Add your production domain to Supabase authentication settings
- Update
NEXT_PUBLIC_SITE_URLin environment variables - Configure Google OAuth redirect URLs for production
- Set up Supabase Row Level Security (RLS) policies
- Review and optimize API rate limits
See database/schema.sql for the complete database schema including:
- Chat sessions with JSONB message arrays
- University and country data caches
- Saved comparisons
- Indexes for performance
This is a project built for a French client. If you want to extend it:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is proprietary and confidential.
rm -rf node_modules
rm package-lock.json
npm install- Verify your environment variables are correct
- Check that your Supabase project is active
- Ensure RLS policies allow your operations
- Verify your API key is valid
- Check API rate limits
- Ensure you're using a supported model name
For issues or questions:
- Check the documentation
- Review existing issues on GitHub
- Contact the development team
After setup, you can:
- Customize the landing page in
app/page.tsx - Seed university data using
public/data/universities-seed.json - Configure AI prompts in
lib/groq/prompts.ts - Add more Shadcn components as needed
- Implement remaining features:
- Dashboard pages (in progress)
- Chat interface with streaming (in progress)
- Comparison charts (in progress)
- Profile management (in progress)
- PDF report generation (to be implemented)
Built with β€οΈ for Indian students pursuing global education