A modern, responsive SaaS platform providing AI-powered educational assistance specifically designed for Sri Lankan students. Built with Node.js backend and Next.js frontend.
- RESTful API with authentication via API keys
- Firebase Authentication for user management
- Gemini AI Integration for intelligent responses
- Rate Limiting & Security with CORS protection
- Professional Dashboard with usage analytics
- Sinhala Language Support - Native language processing
- O/L & A/L Syllabus - Sri Lankan curriculum focused
- Educational AI Tutor - Mathematics, Physics, and more
- Responsive Design - Works on mobile, tablet, desktop
apiplatform_ready/
βββ apiplatform_ready/ # Backend API Server (Node.js + Express)
β βββ server.js # Main server file with security fixes
β βββ package.json # Backend dependencies
β βββ .env # Environment variables (create from .env_copy)
βββ frontend/ # Frontend SaaS Dashboard (Next.js + TypeScript)
β βββ src/
β β βββ app/ # Next.js App Router
β β βββ components/ # Reusable UI components
β β βββ contexts/ # React contexts (Auth)
β β βββ lib/ # Firebase config
β β βββ services/ # API service layer
β βββ package.json # Frontend dependencies
β βββ .env.local # Frontend environment vars (create from .env copy)
βββ README.md # This file
- Node.js 18+ and npm
- Firebase project with Authentication enabled
- Google Gemini API key
cd apiplatform_ready
cp .env_copy .env
# Edit .env with your Firebase and Gemini credentials
npm install
npm startBackend will run on http://localhost:3000
cd frontend
cp ".env copy" .env.local
# Edit .env.local with your Firebase config
npm install
npm run devFrontend will run on http://localhost:3001
# Firebase Admin SDK
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_CLIENT_EMAIL=your-client-email
FIREBASE_DATABASE_URL=your-database-url
# Gemini AI
GEMINI_API_KEY=your-gemini-api-key
# Server Config
PORT=3000
ALLOWED_ORIGINS=http://localhost:3001# Firebase Web SDK
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
# Backend API
NEXT_PUBLIC_API_URL=https://endpoint.apilageai.lkcurl -X POST https://endpoint.apilageai.lk/api/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"message": "Hello, how are you?"}'{
"success": true,
"response": "Hello! I'm doing well, thank you for asking.",
"credits_remaining": 45,
"timestamp": "2025-09-18T10:30:00Z"
}- Desktop: Split-screen login with Sinhala marketing content
- Mobile: Full-screen optimized with mobile logo
- Tablet: Adaptive layout for all screen sizes
- Navigation Bar - Clean SaaS-style header
- Stats Cards - Credits and usage analytics
- API Key Management - Copy/paste functionality
- Quick Tester - Built-in API testing tool
- Documentation - Complete API reference
# Backend
npm start # Production server
npm run dev # Development with nodemon
# Frontend
npm run dev # Development server with Turbopack
npm run build # Production build
npm run start # Production server- Clean Architecture - Separated concerns with services, contexts, components
- TypeScript - Full type safety across the frontend
- Tailwind CSS - Modern utility-first styling
- shadcn/ui - High-quality component library
- β Environment Variables - No hardcoded secrets
- β Firebase Admin SDK - Secure authentication
- β CORS Protection - Configurable allowed origins
- β API Rate Limiting - Prevent abuse
- β Input Validation - Sanitized requests
The backend is containerized and ready for WSO2 Choreo deployment with:
- Docker support (planned)
- Environment variable management
- Production logging
- Health check endpoints
Fully responsive design tested on:
- iOS Safari - iPhone/iPad compatibility
- Android Chrome - All Android devices
- Desktop Browsers - Chrome, Firefox, Safari, Edge
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push branch:
git push origin feature/amazing-feature - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Email: support@apilageai.lk
- Documentation: Available in dashboard
- GitHub Issues: Report bugs and request features
- Docker containerization for Choreo
- Advanced rate limiting
- Analytics dashboard
- Multi-language support expansion
- Mobile app (React Native)
Built with β€οΈ for Sri Lankan students and developers
π±π° ΰΆ ΰΆ΄ΰ·ΰΆ½ΰΆΰ· AI - ΰ·ΰ·βΰΆ»ΰ· ΰΆ½ΰΆΰΆΰ·ΰ·ΰ· ΰΆ ΰΆ±ΰ·ΰΆΰΆΰΆΊ