Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import firebase_admin | |
| from firebase_admin import credentials, firestore, initialize_app | |
| from config import Config | |
| st.set_page_config(layout="centered", page_icon="Assets/Logo.png", page_title="Enhance") | |
| def main(): | |
| try: | |
| # Validate configuration | |
| Config.validate_config() | |
| # Initialize Firebase | |
| if not firebase_admin._apps: | |
| cred = credentials.Certificate(Config.get_firebase_credentials()) | |
| initialize_app(cred) | |
| db = firestore.client() | |
| except ValueError as e: | |
| st.error(f"🔧 Configuration Error: {str(e)}") | |
| st.info(""" | |
| **To fix this issue:** | |
| **For Local Development:** | |
| 1. Copy `.env.example` to `.env` | |
| 2. Fill in your actual API keys in the `.env` file | |
| 3. Run `python startup_check.py` to validate your setup | |
| **For Hugging Face Spaces:** | |
| 1. Go to your Space settings | |
| 2. Add the required environment variables as secrets | |
| 3. Restart your Space | |
| **Required Environment Variables:** | |
| - `GROQ_API_KEY` | |
| - `FIREBASE_PROJECT_ID` | |
| - `FIREBASE_PRIVATE_KEY` | |
| - `FIREBASE_CLIENT_EMAIL` | |
| - `FIREBASE_CLIENT_X509_CERT_URL` | |
| """) | |
| st.stop() | |
| except Exception as e: | |
| st.error(f"❌ Initialization Error: {str(e)}") | |
| st.info("Please check your configuration and try again.") | |
| st.stop() | |
| # Add branding to sidebar | |
| with st.sidebar: | |
| st.image('Assets/Logo1.png', use_container_width=True) | |
| st.markdown("---") | |
| page = st.radio("Choose Your Tool", ["LinkedIn Enhancer", "Resume Enhancer"]) | |
| if page == "LinkedIn Enhancer": | |
| from linkedin_main import linkedin_interface | |
| linkedin_interface() | |
| else: | |
| from resume_inhance import resume_enhancer | |
| resume_enhancer() | |
| if __name__ == "__main__": | |
| main() |