Spaces:
Running
Running
metadata
title: CA Study Assistant
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
CA Study Assistant
This is a full-stack AI-powered study assistant for Chartered Accountant students.
- Frontend: React
- Backend: FastAPI
- Deployment: Docker on Hugging Face Spaces
How it Works
The application is containerized using Docker and orchestrated with Docker Compose.
- The frontend is a React app served by Nginx.
- The backend is a FastAPI server running with Uvicorn.
- Nginx acts as a reverse proxy, forwarding API requests from the frontend to the backend.
π Quick Setup
1. Environment Configuration
# Copy the example environment file
cp env.example .env
# Edit .env with your API keys
nano .env
Required environment variables:
GOOGLE_API_KEY
: Get from Google AI StudioQDRANT_URL
: Your Qdrant cloud cluster URLQDRANT_API_KEY
: Your Qdrant cloud API key
2. Run System Diagnostic
cd backend
python diagnostic.py
This will check all dependencies and configurations.
3. Start the Application
# Using Docker (recommended)
docker-compose up --build
# Or run locally
cd backend && python backend_api.py
cd frontend && npm start
π§ Troubleshooting File Uploads
If file uploads aren't working, check:
- Environment Variables: Ensure all required vars are set
- API Connectivity: Backend must connect to Qdrant and Google APIs
- File Size: Large files (>10MB) may timeout
- File Format: Only PDF, DOCX, and TXT are supported
- Server Status: Check browser console and server logs
Common Upload Errors:
Error | Cause | Solution |
---|---|---|
Network Error | Server not running | Start backend server |
500 Server Error | Missing API keys | Check environment variables |
413 File Too Large | File exceeds 100MB limit | Use files smaller than 100MB |
415 Unsupported Type | Wrong file format | Use PDF/DOCX/TXT only |
Timeout | Large file/slow connection | Wait longer or use smaller files |
File Upload Limits:
- Maximum file size: 100MB per file
- Supported formats: PDF, DOCX, TXT
- Recommended size: Under 10MB for faster processing
- Multiple files: Can upload multiple files simultaneously
Debug Steps:
- Run
python backend/diagnostic.py
- Check browser developer console
- Check backend server logs
- Verify network connectivity to external APIs