A specialized AI coding assistant that helps with code analysis, debugging, and generation.
- π€ AI-Powered Code Assistant: Uses Gemini 2.5 Flash Preview for intelligent code analysis
- π¬ Real-time Chat: Stream responses with markdown rendering
- π Code Editor: Built-in CodeMirror editor with syntax highlighting
- π Secure Authentication: Firebase Auth with Google OAuth and Email/Password
- πΎ Chat History: Persistent storage in Firestore
- π Code Compilation: Direct integration with online compiler
- π± Mobile Responsive: Works seamlessly on desktop and mobile
Frontend:
- Vanilla JavaScript (ES6+)
- Tailwind CSS
- CodeMirror (code editor)
- LZString (compression)
- Firebase SDK (Auth & Firestore)
- Marked.js (markdown rendering)
Backend:
- Python 3.x
- Flask
- Google Generative AI SDK (Gemini 2.5 Flash Preview)
- Firebase Admin SDK
- Flask-CORS
Database:
- Firebase Firestore (NoSQL)
- Python 3.8+
- Node.js (for frontend development)
- Firebase account
- Google AI API key
- Clone the repository:
git clone https://github.com/notamitgamer/ada-web.git
cd ada-web- Install Python dependencies:
pip install -r requirements.txt- Create a
.envfile (use.env.exampleas template):
cp .env.example .env- Configure environment variables in
.env:
GEMINI_API_KEY=your_actual_gemini_api_key
FIREBASE_CREDENTIALS={"type":"service_account",...}
PORT=5000
- Run the backend:
python backend.pyThe frontend is a static HTML application. Simply open index.html in a browser or serve it using a local server:
python -m http.server 5500Then visit: http://localhost:5500
users (collection)
ββ {uid} (document)
ββ email: string
ββ displayName: string
ββ photoURL: string
ββ createdAt: timestamp
ββ chats (subcollection)
ββ {chatUUID} (document)
ββ title: string
ββ createdAt: timestamp
ββ updatedAt: timestamp
ββ messages: array[
{
role: "user" | "model",
content: string,
timestamp: timestamp
}
]
- Go to Firebase Console
- Select project:
ada-ai-aranag - Navigate to Project Settings > Service Accounts
- Generate new private key
- Use the downloaded JSON for
FIREBASE_CREDENTIALSenvironment variable
Streams AI responses for code queries.
Headers:
Authorization: Bearer <firebase_id_token>
Content-Type: application/json
Body:
{
"message": "Why is this loop infinite?",
"history": [],
"codeContext": "while(i > 0) { ... }",
"fileContext": "",
"sessionId": "uuid-v4"
}Generates a short title for chat sessions.
Headers:
Authorization: Bearer <firebase_id_token>
Content-Type: application/json
Body:
{
"message": "First user message"
}-
Create a new Web Service on Render.com
-
Connect your GitHub repository:
notamitgamer/ada-web -
Configure the service:
- Name:
ada-web-backend(or your preferred name) - Region: Choose closest to your users
- Branch:
main - Build Command:
pip install -r requirements.txt - Start Command:
gunicorn backend:app --workers 2 --threads 2 --timeout 120 - Plan: Free (or paid for better performance)
- Name:
-
Set Environment Variables:
GEMINI_API_KEY: Your Gemini API key (get from https://aistudio.google.com/app/apikey)FIREBASE_CREDENTIALS: Full JSON string from Firebase service accountFLASK_DEBUG:False(for production)PYTHON_VERSION:3.11.0(optional, auto-detected)
-
Deploy! Render will automatically deploy your backend.
The repository includes a render.yaml file for automatic configuration. Simply connect your repo and Render will use this file for setup.
The backend provides a /health endpoint for monitoring:
- URL:
https://your-app.onrender.com/health - Response:
{"status": "healthy", "timestamp": "..."}
Render's free tier spins down after 15 minutes of inactivity. Use UptimeRobot to keep it alive:
- Create a free UptimeRobot account
- Add New Monitor:
- Monitor Type:
HTTP(s) - Friendly Name:
Ada Web Backend - URL:
https://ada-web.onrender.com/health - Monitoring Interval:
5 minutes(free tier)
- Monitor Type:
- Save - UptimeRobot will ping your backend every 5 minutes to keep it alive!
Deploy index.html to:
- GitHub Pages
- Netlify
- Vercel
- Any static hosting service
Update the API URL in index.html:
const API_URL = 'https://your-backend.onrender.com/api/chat';python test_backend.py- Python: Follow PEP 8
- JavaScript: ES6+ with consistent formatting
- Use meaningful variable names
- Comment complex logic
β Firebase ID Token verification on backend β CORS protection β Environment variable protection β Server-side authentication validation β Secure API key storage
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
MIT License - see LICENSE file for details
Amit Dutta
- Website: amit.is-a.dev
- Project: Ada AI
- Google Gemini AI for powering the code assistant
- Firebase for authentication and database
- CodeMirror for the code editor
- The open-source community