A Flask-based AI assistant for creating cabinetry quotes with Gmail integration.
- AI-powered quote generation using Google Gemini
- Gmail draft creation for quotes
- Vector search through past quotes for context
- RESTful API endpoints
- Railway account
- Google Cloud Project with Gmail API enabled
- OAuth 2.0 credentials
Set these environment variables in your Railway project:
GOOGLE_API_KEY- Your Google Gemini API keyGOOGLE_CLIENT_ID- OAuth client ID from Google CloudGOOGLE_CLIENT_SECRET- OAuth client secret from Google CloudGOOGLE_REFRESH_TOKEN- OAuth refresh token
CLIENT_EMAIL- Default client email for drafts (default: client-email@example.com)BOOKKEEPING_EMAIL- Default bookkeeping email for drafts (default: bookkeeping@example.com)PORT- Port for the application (automatically set by Railway)
-
Connect Repository
- Connect your GitHub repository to Railway
-
Set Environment Variables
- In Railway dashboard, go to Variables
- Add all required environment variables listed above
-
Deploy
- Railway will automatically detect the Python app and deploy it
- The
railway.jsonfile configures the build and deployment
GET /- Health checkGET /health- Detailed health statusPOST /chat- Send message to AI assistantPOST /create_draft- Create Gmail draft (requires Google auth)
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables in
.envfile -
Run locally:
python app.py
app.py- Main Flask applicationrequirements.txt- Python dependenciesrailway.json- Railway deployment configurationProcfile- Alternative deployment configurationfaiss_index.bin- Vector search indexquote_data.pkl- Quote data for contexttoken.json- Local OAuth credentials (not for production)
- App crashes on startup: Check that all required environment variables are set
- Gmail not working: Verify Google OAuth credentials and refresh token
- Knowledge base not loading: Ensure
faiss_index.binandquote_data.pklare present - Port issues: Railway automatically sets the PORT environment variable