An AI-powered government services platform that helps citizens discover schemes, verify documents, and navigate bureaucratic processes with ease.
🏆 DevPost Project • 🚀 Quick Start • ✨ Features • ⚙️ Setup • 🐳 Docker
Frontend: React 18 · TypeScript · Vite · Tailwind CSS · shadcn/ui
Backend: Django 5.2.6 · DRF · PostgreSQL · Google Gemini AI · UV Package Manager
Infrastructure: Docker · Redis · nginx
- 🚀 Quick Start
- ✨ Features
- ⚙️ Setup Instructions
- 🐳 Docker Deployment
- 🔑 Admin Access
- 📦 DigiLocker Package
- 🤖 AI Integration
- 🧪 Testing
- 🏗️ Architecture
- 🔮 Future Development
- 📄 License
- Python 3.11+ with UV package manager
- Node.js 18+ with npm
- Docker Desktop (for containerized deployment)
- Google Gemini API Key from AI Studio
# Clone the repository
git clone https://github.com/frankmathewsajan/agsa-gov-agent-ai.git
cd agsa-gov-agent-ai
# Setup environment and deploy
npm run docker:setup:env # Interactive setup
npm run docker:setup # Build and start everything
# Access your application
# Frontend: http://localhost
# Backend: http://localhost:8000
# Admin: http://localhost:8000/admin# Backend setup
cd backend
uv sync # Install dependencies
cp .env.template .env # Copy environment file
# Add your Gemini API key to .env
uv run python manage.py migrate
uv run python manage.py runserver
# Frontend setup (new terminal)
cd ../
npm install
npm run dev- Scheme Discovery: AI-powered search for government schemes and benefits
- Eligibility Assessment: Automated qualification checking based on user profile
- Document Management: Secure upload, storage, and verification of government documents
- Application Assistance: Step-by-step guidance for scheme applications
- Google Gemini Integration: Advanced natural language processing for user queries
- Context-Aware Responses: Maintains conversation history and user context
- Intent Classification: Automatically categorizes user requests (eligibility, documents, forms)
- Confidence Scoring: AI response reliability metrics with fallback handling
- DigiLocker Integration: Mock implementation of India's digital document locker
- OTP-Based Authentication: Secure phone number verification
- KYC Compliance: Comprehensive user profiling and verification
- Document Security: Encrypted storage and secure access controls
- Responsive Design: Works seamlessly across desktop, tablet, and mobile
- Real-time Chat: Interactive AI assistant with typing indicators
- Document Viewer: Secure in-browser document preview and download
- Progressive Enhancement: Graceful fallbacks when services are unavailable
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated API key (starts with
AIza...) - Keep this key secure - you'll need it for configuration
# Clone the repository
git clone https://github.com/frankmathewsajan/agsa-gov-agent-ai.git
cd agsa-gov-agent-ai
# Backend configuration
cd backend
uv sync # Install Python dependencies
cp .env.template .env # Create environment fileEdit backend/.env and add your configuration:
# Required: Add your Gemini API key
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Customize other settings
DEBUG=True
SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///db.sqlite3cd backend
uv run python manage.py migrate # Create database tables
uv run python manage.py collectstatic # Collect static filesuv run python manage.py createsuperuser
# Follow prompts to create admin credentials# Terminal 1: Backend server
cd backend
uv run python manage.py runserver
# Terminal 2: Frontend development server
cd ..
npm install
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
# Interactive environment setup
npm run docker:setup:env
# One-command deployment
npm run docker:setup
# Access applications
# Frontend: http://localhost
# Backend: http://localhost:8000# Production environment
npm run docker:build # Build images
npm run docker:up # Start services
npm run docker:down # Stop services
npm run docker:logs # View logs
npm run docker:clean # Clean everything
# Development environment
npm run docker:dev:up # Start dev environment
npm run docker:dev:down # Stop dev environment
npm run docker:dev:logs # View dev logs
# Service-specific operations
npm run docker:backend:logs # Backend logs only
npm run docker:frontend:logs # Frontend logs only
npm run docker:db:logs # Database logs only| Service | Production Port | Development Port | Purpose |
|---|---|---|---|
| Frontend (nginx) | 80 | 3001 | React application |
| Backend (Django) | 8000 | 8001 | API server |
| Database (PostgreSQL) | 5432 | 5433 | Data storage |
| Redis | 6379 | 6380 | Caching & sessions |
After setting up the application, create an admin user to access the Django admin panel:
# Local development
cd backend
uv run python manage.py createsuperuser
# Docker environment
docker-compose exec backend uv run python manage.py createsuperuserAccess the admin panel at http://localhost:8000/admin to:
- 📄 Manage Documents: Upload and organize government documents
- 👥 User Management: View and manage user accounts
- 🏛️ Scheme Administration: Add and modify government schemes
- 📊 System Monitoring: View application logs and statistics
- 🔧 Configuration: Manage system settings and API keys
- Login to admin panel with superuser credentials
- Navigate to "Documents" section
- Click "Add Document" to upload new documents
- Set document type, visibility, and metadata
- Documents become available to users through the main interface
AGSA includes a custom DigiLocker package (backend/digilocker/) that provides a mock implementation of India's digital document locker system.
backend/digilocker/
├── __init__.py # Package initialization
├── client.py # Main DigiLocker client
├── exceptions.py # Custom exception classes
├── models.py # Data models and schemas
└── client_db.py # Database interaction layer
from digilocker.client import DigiLockerClient
# Initialize client
client = DigiLockerClient()
# Authenticate user
client.authenticate(mobile_number="9876543210")
client.verify_otp(otp="123456")
# Fetch user documents
documents = client.get_documents()
# Download specific document
document_data = client.download_document(doc_id="DOC123")- Mobile Verification: User provides mobile number
- OTP Generation: System sends verification code
- OTP Validation: User enters code for authentication
- Session Management: Secure session creation and maintenance
- Document Access: Authenticated access to user documents
- OTP-based Authentication: No passwords, only secure mobile verification
- Session Management: Time-limited authenticated sessions
- Document Encryption: Secure storage and transmission of sensitive documents
- Access Logging: Comprehensive audit trails for document access
The DigiLocker package is designed to be modular and extensible:
# Custom document validator
class CustomDocumentValidator:
def validate_aadhaar(self, document):
# Implementation for Aadhaar validation
pass
def validate_pan(self, document):
# Implementation for PAN validation
pass
# Integration with external services
client = DigiLockerClient(
validator=CustomDocumentValidator(),
storage_backend=AWSS3Storage(),
notification_service=SMSService()
)The application uses Google Gemini Pro for intelligent chat responses:
# backend/chat/ai_service.py
import google.generativeai as genai
class GeminiChatService:
def __init__(self):
genai.configure(api_key=settings.GEMINI_API_KEY)
self.model = genai.GenerativeModel('gemini-1.5-flash')
def analyze_user_message(self, message, context=None):
# AI processing with government service specialization
response = self.model.generate_content(prompt)
return self.parse_ai_response(response)- Intent Classification: Automatically categorizes user queries
- Confidence Scoring: Reliability metrics for AI responses
- Context Preservation: Maintains conversation history
- Fallback Handling: Graceful degradation when AI is unavailable
- Government Domain Expertise: Specialized knowledge of Indian government schemes
- User sends message via React frontend
- Frontend calls
/api/chat/API endpoint - Backend processes with
GeminiChatService - Gemini AI generates contextual response
- Response includes structured data (intent, confidence, actions)
- Frontend displays with AI indicators and typing animations
cd backend
# Populate test data
uv run tests/populate_sample_data.py
# Run specific test categories
uv run tests/test_complete_flow.py # End-to-end testing
uv run tests/test_chat_api.py # AI chat functionality
uv run tests/test_api.py # Authentication & documents
uv run tests/test_frontend_backend_integration.py # Integration tests
# Run all Django tests
uv run python manage.py test| Test File | Purpose |
|---|---|
test_complete_flow.py |
End-to-end user journey testing |
test_chat_api.py |
AI chat functionality and Gemini integration |
test_api.py |
Authentication and document API testing |
test_frontend_backend_integration.py |
Cross-system integration tests |
populate_sample_data.py |
Database seeding with sample data |
# Future implementation with Vitest + React Testing Library
npm run test
npm run test:coverage
npm run test:e2e┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React Frontend │ │ Django Backend │ │ Google Gemini │
│ (Vite + TS) │◄──►│ (DRF + SQLite) │◄──►│ AI Service │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ nginx │ │ PostgreSQL │ │ Redis │
│ (Production) │ │ (Production) │ │ (Sessions) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- React 18: Modern React with hooks and context
- TypeScript: Type-safe development
- Vite: Fast build tool and dev server
- Tailwind CSS: Utility-first styling
- shadcn/ui: High-quality UI components
- React Router: Client-side routing
- Framer Motion: Smooth animations
- Django 5.2.6: Modern Python web framework
- Django REST Framework: API development
- UV Package Manager: Fast Python dependency management
- PostgreSQL: Production-ready database
- Redis: Caching and session storage
- Google Gemini AI: Advanced language model
- CORS Configuration: Secure cross-origin requests
- CSRF Protection: Cross-site request forgery prevention
- Secure Headers: XSS, clickjacking, and content type protection
- Input Validation: Comprehensive data sanitization
- Error Handling: Secure error messages without information leakage
AGSA is currently a proof-of-concept prototype demonstrating the potential of AI-powered government services. This implementation showcases core functionality and user experience patterns.
- Production-grade Authentication: Integration with actual DigiLocker API
- Advanced Encryption: End-to-end encryption for sensitive documents
- Audit Logging: Comprehensive security event tracking
- Penetration Testing: Security vulnerability assessments
- Compliance Certification: SOC 2, ISO 27001 compliance
- Real API Integration: Connection to actual government databases
- Multi-state Support: Support for different state government schemes
- Document Verification: Real-time verification with issuing authorities
- Blockchain Integration: Immutable document verification system
- Inter-agency Connectivity: Seamless data sharing between departments
- Custom Fine-tuning: Government-specific language model training
- Multi-language Support: Regional language processing capabilities
- Advanced NLP: Better intent recognition and entity extraction
- Predictive Analytics: Proactive scheme recommendations
- Voice Interface: Speech-to-text and text-to-speech capabilities
- User Analytics: Comprehensive usage patterns and insights
- Performance Monitoring: Real-time system health and performance
- Scheme Effectiveness: Data-driven policy recommendations
- Citizen Feedback: Automated sentiment analysis and feedback processing
- Predictive Modeling: Anticipating citizen needs and service gaps
- Microservices Architecture: Scalable service decomposition
- Load Balancing: High-availability deployment patterns
- CDN Integration: Global content delivery optimization
- Caching Strategies: Multi-layer caching for performance
- Auto-scaling: Dynamic resource allocation based on demand
The ultimate goal is to create a comprehensive digital government platform that:
- Eliminates bureaucratic friction for citizens
- Provides instant access to all government services
- Uses AI to predict and fulfill citizen needs proactively
- Ensures transparency and accountability in government processes
- Bridges the digital divide with multilingual, accessible interfaces
This project was showcased on DevPost as part of demonstrating innovative solutions for government digitization challenges.
This project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Please see our Contributing Guidelines for details on:
- Code of conduct
- Development setup
- Pull request process
- Issue reporting
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- DevPost: Project Page
Built with ❤️ for a better digital India
🏛️ AGSA - Making Government Services Accessible to All
git clone <repo-url>
cd agsa-gov-agent-ai
npm install
npm run devcd backend
uv sync
uv run manage.py migrate
uv run manage.py runserverServers:
- Frontend (Vite): http://localhost:8081
- Backend (Django): http://localhost:8000
Create backend/.env:
GEMINI_API_KEY=your_google_gemini_api_key_here
SECRET_KEY=your_django_secret_key
DEBUG=TrueAGSA is a full-stack AI-powered government service assistant that:
- Real Authentication: Phone+OTP login/registration with Django backend
- KYC Integration: Comprehensive Know Your Customer data collection
- Document Management: Upload, download, and verify government documents
- AI-Powered Chat: Google Gemini-powered conversational assistant for scheme discovery, eligibility checks, and application guidance
- Real-time Processing: Contextual AI responses with confidence scoring and intent classification
The system integrates real AI capabilities with government service workflows, replacing previous mocks with production-ready APIs.
| Route | File | Purpose |
|---|---|---|
/ |
src/pages/Index.tsx |
Landing page with hero, features, and call-to-action |
/auth |
src/pages/Auth.tsx |
Phone+OTP authentication with real backend integration |
/documents |
src/pages/Documents.tsx |
Document upload/download with Django file handling |
/chat |
src/pages/Chat.tsx |
Google Gemini-powered AI assistant with contextual responses |
* |
src/pages/NotFound.tsx |
404 fallback page |
POST /api/auth/send-otp/- Send OTP to phone numberPOST /api/auth/verify-otp/- Verify OTP and authenticatePOST /api/auth/register/- Register new user with KYC dataGET /api/auth/profile/- Get user profile informationPOST /api/auth/logout/- Logout user session
GET /api/documents/- List user's uploaded documentsPOST /api/documents/upload/- Upload new document (multipart/form-data)GET /api/documents/{id}/download/- Download document (base64 encoded)
POST /api/chat/sessions/- Create new chat sessionGET /api/chat/sessions/{id}/- Get chat session with message historyPOST /api/chat/send/- Send message and get AI responsePOST /api/chat/eligibility/- Check scheme eligibilityPOST /api/chat/form-assistance/- Get form filling assistance
backend/
├── agsa/ # Main Django project
│ ├── settings.py # Django configuration + Gemini API setup
│ ├── urls.py # Root URL configuration
│ └── wsgi.py/asgi.py # WSGI/ASGI application
├── api/ # Authentication & documents API
│ ├── models.py # User, UserProfile, Document models
│ ├── views.py # Auth, profile, document endpoints
│ ├── serializers.py # DRF serializers
│ └── urls.py # API routes
├── chat/ # AI-powered chat system
│ ├── models.py # ChatSession, ChatMessage, ChatContext models
│ ├── ai_service.py # Google Gemini integration
│ ├── views.py # Chat endpoints with AI processing
│ ├── serializers.py # Chat-specific serializers
│ └── urls.py # Chat routes
├── digilocker/ # DigiLocker integration (future)
└── tests/ # Comprehensive test suite
- Google Gemini Integration: Real AI responses with confidence scoring
- Session Management: Persistent chat sessions with context
- Document Handling: Secure file upload/download with base64 encoding
- KYC Data Collection: Comprehensive user profiling during registration
- Intent Classification: AI categorizes user queries (eligibility, documents, forms)
- Fallback Handling: Graceful degradation when AI services are unavailable
The backend includes a comprehensive testing framework in backend/tests/:
| Test File | Purpose |
|---|---|
test_complete_flow.py |
End-to-end user journey testing |
test_chat_api.py |
AI chat functionality and Gemini integration |
test_api.py |
Authentication and document API testing |
test_frontend_backend_integration.py |
Cross-system integration tests |
populate_sample_data.py |
Database seeding with sample data |
simple_test.py |
Basic connectivity and health checks |
Running Tests:
cd backend
# Populate sample data
uv run tests/populate_sample_data.py
# Run specific test suites
uv run tests/test_complete_flow.py
uv run tests/test_chat_api.py
# Run all tests
uv run manage.py test# Future implementation with Vitest + React Testing Library
npm run test
npm run test:coverage| Category | File | Notes |
|---|---|---|
| Entry | index.html |
Base HTML, fonts, metadata, social OG tags |
| Bootstrap | src/main.tsx |
Creates React root and renders <App /> |
| App Shell | src/App.tsx |
Providers: Auth Context, Toast, Routes |
| Pages | src/pages/*.tsx |
Main application views (Index, Auth, Documents, Chat) |
| Components | src/components/ui/* |
shadcn/ui + Radix primitives (accessible building blocks) |
| Services | src/services/*.ts |
API clients for auth, documents, chat |
| Contexts | src/contexts/*.tsx |
React contexts for global state management |
| Hooks | src/hooks/*.ts |
Custom React hooks (toast, auth, etc.) |
| Utilities | src/lib/utils.ts |
Helper functions and utilities |
| Assets | src/assets/* |
Images, logos, and static resources |
| Styling | src/index.css, tailwind.config.ts |
Tailwind configuration + global styles |
| Category | File/Directory | Notes |
|---|---|---|
| Django Project | backend/agsa/ |
Main Django configuration and settings |
| Auth API | backend/api/ |
User authentication, profiles, documents |
| Chat API | backend/chat/ |
AI-powered chat with Gemini integration |
| AI Service | backend/chat/ai_service.py |
Google Gemini API integration |
| Models | */models.py |
Database schema definitions |
| Serializers | */serializers.py |
DRF request/response serialization |
| Views | */views.py |
API endpoint implementations |
| Tests | backend/tests/ |
Comprehensive test suite |
| Database | backend/db.sqlite3 |
SQLite database (development) |
| Dependencies | backend/pyproject.toml |
UV package management |
The assistant in Chat.tsx is a state machine–like heuristic using keyword matching:
- Detects “scheme”, “benefit”, “subsidy” → eligibility flow
- Then “document”, “verify”, “yes” → document verification status messages
- Then “form”, “application”, “prepare” → application summary Messages are stored in local component state; timestamps + simple formatted rendering.
To integrate a real LLM:
- Extract
simulateAssistantResponseinto a service module. - Replace keyword logic with API call (e.g.,
/api/chatstreaming). - Normalize responses into the
Messageshape. - Add loading & error states (TanStack Query or custom controller).
- Phone+OTP: Primary authentication method
- Session Management: Django session-based authentication
- KYC Integration: Comprehensive user profiling during registration
- Profile Management: Secure user data storage and retrieval
Authentication Flow:
- User enters phone number
- Backend sends OTP via SMS (simulated)
- User verifies OTP
- Session established with Django backend
- User proceeds to KYC or main app
The system collects comprehensive KYC data:
- Personal Information (name, DOB, address)
- Government IDs (Aadhaar, PAN, voter ID)
- Income and employment details
- Family information
- Document uploads and verification
- Upload: Multipart form data with validation
- Storage: Django file handling with secure paths
- Download: Base64 encoded responses for browser compatibility
- Metadata: Document type, upload date, verification status
Supported Document Types:
- Government IDs (Aadhaar, PAN, Passport)
- Income proofs (salary slips, ITR)
- Address proofs (utility bills, bank statements)
- Educational certificates
- Custom document types
// Frontend document service
export const documentService = {
uploadDocument: (file: File, documentType: string) =>
api.post('/api/documents/upload/', formData),
getDocuments: () =>
api.get('/api/documents/'),
downloadDocument: (id: string) =>
api.get(`/api/documents/${id}/download/`)
};- Tailwind CSS: Utility-first styling with consistent design tokens
- shadcn/ui + Radix: Accessible component primitives
- Framer Motion: Smooth animations and micro-interactions
- Responsive Design: Mobile-first approach with desktop optimization
cnhelper: Conditional class merging utility- Design Tokens: Consistent spacing, colors, typography
- Accessibility: ARIA labels, keyboard navigation, screen reader support
- Motion System: Entrance animations, loading states, transitions
- React Context: Global auth state and user management
- Local State: Component-specific state (forms, UI)
- Service Layer: API communication and data transformation
- Error Handling: Centralized error boundaries and toast notifications
- Database: SQLite (development) / PostgreSQL (production ready)
- Session Management: Django sessions for authentication
- File Storage: Local file system (development) / cloud storage ready
- AI Context: Persistent chat sessions with conversation history
- Frontend: npm with Vite for fast development
- Backend: UV (modern Python package manager) for dependency management
npm run dev # Start development server (http://localhost:8081)
npm run build # Production build
npm run preview # Preview production build
npm run lint # ESLint code checkinguv sync # Install dependencies
uv run manage.py migrate # Apply database migrations
uv run manage.py runserver # Start Django server (http://localhost:8000)
uv run manage.py createsuperuser # Create admin user
uv run manage.py collectstatic # Collect static files (production)Create backend/.env with:
# Required
GEMINI_API_KEY=your_google_gemini_api_key_here
SECRET_KEY=your_django_secret_key_here
# Optional
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:8081cd backend
uv run manage.py makemigrations
uv run manage.py migrate
uv run tests/populate_sample_data.py # Add sample data| Priority | Enhancement | Status |
|---|---|---|
| ✅ | Real Authentication | Complete - Phone+OTP with Django backend |
| ✅ | AI Chat Integration | Complete - Google Gemini integration |
| ✅ | Document Management | Complete - Upload/download with validation |
| ✅ | KYC Data Collection | Complete - Comprehensive user profiling |
| 🔄 | Production Deployment | In Progress - Docker + cloud setup |
| 🔄 | Enhanced AI Features | In Progress - Scheme recommendations, form assistance |
| Priority | Enhancement | Summary |
|---|---|---|
| 📋 | Real SMS Integration | Replace OTP simulation with actual SMS service |
| 📋 | Advanced Document Verification | AI-powered document authenticity checking |
| 📋 | Scheme Database Integration | Connect to real government scheme databases |
| 📋 | Multi-language Support | Hindi + regional language support |
| 📋 | Offline Capabilities | PWA features for limited connectivity scenarios |
| Priority | Enhancement | Summary |
|---|---|---|
| 📋 | Admin Dashboard | Django admin interface for user management |
| 📋 | Analytics Integration | User journey tracking and insights |
| 📋 | API Rate Limiting | Protect AI endpoints from abuse |
| 📋 | Advanced Testing | Comprehensive E2E testing with Playwright |
| 📋 | Performance Optimization | Caching, CDN, database optimization |
Use this lightweight branching model:
git checkout -b feat/<short-name>
# implement
git commit -m "feat(chat): add streaming support"
git push origin feat/<short-name>Open a PR; include before/after screenshots for UI changes.
src/
api/ # API clients, request/response schemas
services/ # Domain logic (eligibility, documents, chat orchestration)
store/ # Zustand / Redux / Jotai (if needed)
types/ # Shared TypeScript types
tests/ # Unit & integration tests
Currently no .env file required. When adding backends define e.g.:
VITE_API_BASE_URL=https://api.example.com
VITE_OPENAI_API_KEY=... (never commit)
Access via import.meta.env.VITE_API_BASE_URL.
| Script | Purpose |
|---|---|
npm run dev |
Start Vite dev server |
npm run build |
Production build (outputs to dist/) |
npm run build:dev |
Development-mode build (useful for profiling) |
npm run preview |
Preview built assets locally |
npm run lint |
Run ESLint over the repo |
- Vite: fast HMR & TS integration
- shadcn/ui + Radix: accessible primitives without heavy design overhead
- React Query prepared: future async data orchestration
- Framer Motion: subtle motion for perceived polish
- Keyword-based assistant: rapid prototyping before committing to LLM costs
Install (future): vitest, @testing-library/react, @testing-library/user-event, jsdom.
Example test target candidates:
- Chat flow triggers (eligibility → documents → summary)
- KYC integration state transitions
- Auth mode switch (login/register + phone/email)
- Add
aria-live="polite"region for incoming assistant messages - Ensure focus trapping in dialogs (when added later)
- Provide skip-to-content link on landing
- Confirm color contrast (run tooling)
Any static host works (Netlify, Vercel, Cloudflare Pages, GitHub Pages):
npm run build
# deploy dist/ directoryWhen adding server features, introduce a /api proxy in vite.config.ts.
- Sanitize user input before sending to LLM / backend
- Rate limit scheme lookups
- Use token-based session (JWT / HttpOnly cookie) for persisted auth
- Implement audit logging for sensitive eligibility queries
| Need | Modify File(s) | Notes |
|---|---|---|
| Add real chat backend | src/pages/Chat.tsx, new src/services/chat.ts |
Extract simulation → service |
| Persist user profile | src/pages/Auth.tsx, src/pages/KYC.tsx, add src/api/user.ts |
Replace timeouts with API |
| Add scheme catalog | New: src/api/schemes.ts, src/services/eligibility.ts |
Query + filter + rank |
| Add global store | New: src/store/* |
Manage auth/session outside pages |
| Add dark mode toggle | Navbar.tsx, use next-themes or CSS class toggle |
Tailwind dark: support |
git checkout -b feat/<feature-name>
# Implement changes
git commit -m "feat(chat): add real-time AI responses"
git push origin feat/<feature-name>
# Open pull request with screenshots for UI changes- Frontend: ESLint + Prettier configuration
- Backend: Black formatting + Django best practices
- TypeScript: Strict type checking enabled
- Testing: Write tests for new features
- Documentation: Update README for significant changes
src/
├── components/ui/ # Reusable UI components
├── pages/ # Main application pages
├── services/ # API clients and data services
├── contexts/ # React context providers
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── assets/ # Static resources
backend/
├── agsa/ # Django project configuration
├── api/ # Authentication and documents
├── chat/ # AI chat functionality
├── tests/ # Test suites
└── docs/ # API documentation
- CORS Configuration: Proper cross-origin request handling
- Session Management: Django's built-in session security
- Input Validation: DRF serializers with validation
- File Upload Security: Type and size validation
- Environment Variables: Sensitive data in .env files
- HTTPS enforcement
- Rate limiting on AI endpoints
- Input sanitization for LLM prompts
- Audit logging for sensitive operations
- Database connection encryption
- Static file security headers
- Code Splitting: Lazy loading for routes
- Image Optimization: Compressed assets
- Bundle Analysis: Regular bundle size monitoring
- Memoization: React.memo for expensive components
- Debounced Inputs: Reduced API calls
- Database Indexing: Optimized queries
- Caching Strategy: Redis for session data
- AI Response Caching: Reduce Gemini API calls
- File Storage: CDN for document serving
- Connection Pooling: Database connection optimization
Frontend Build Errors:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm installBackend Database Issues:
# Reset database (development only)
rm backend/db.sqlite3
uv run manage.py migrate
uv run tests/populate_sample_data.pyGemini API Errors:
# Check API key in .env file
echo $GEMINI_API_KEY
# Test API connectivity
uv run tests/test_chat_api.py- Django REST Framework browsable API: http://localhost:8000/api/
- Swagger/OpenAPI documentation (future): http://localhost:8000/docs/
# Authentication
curl -X POST http://localhost:8000/api/auth/send-otp/ \
-H "Content-Type: application/json" \
-d '{"phone_number": "+919876543210"}'
# Chat message
curl -X POST http://localhost:8000/api/chat/send/ \
-H "Content-Type: application/json" \
-H "Cookie: sessionid=<session_id>" \
-d '{"session_id": "uuid", "message": "What schemes am I eligible for?"}'This project is licensed under the MIT License - see the LICENSE file for details.
Primary Maintainer: AGSA Development Team
Support: Create an issue on GitHub for bugs or feature requests
Documentation: This README is updated with each major release
Current Status: ✅ Production-ready with real AI integration and comprehensive backend APIs
Note: This system now includes real AI capabilities, authentication, and document management. All previous mocks have been replaced with production-ready implementations.