# ⚡ HRHUB QUICK REFERENCE **Copy-paste commands for instant deployment** --- ## 🖥️ LOCAL TESTING ### Mac/Linux ```bash cd hrhub ./run.sh ``` ### Windows ```bash cd hrhub run.bat ``` ### Manual Way ```bash cd hrhub pip install -r requirements.txt streamlit run app.py ``` **URL:** http://localhost:8501 --- ## 🌐 GITHUB DEPLOYMENT ### First Time Setup ```bash cd hrhub git init git add . git commit -m "Initial HRHUB deployment" git remote add origin https://github.com/YOUR-USERNAME/hrhub.git git branch -M main git push -u origin main ``` ### Update After Changes ```bash git add . git commit -m "Update description here" git push ``` --- ## ☁️ STREAMLIT CLOUD ### URL https://share.streamlit.io ### Settings - **Repository:** YOUR-USERNAME/hrhub - **Branch:** main - **Main file:** app.py --- ## 🔧 COMMON COMMANDS ### Install Dependencies ```bash pip install -r requirements.txt ``` ### Test Mock Data ```bash python data/mock_data.py ``` ### Check Python Version ```bash python --version ``` ### Create Virtual Environment ```bash python -m venv venv source venv/bin/activate # Mac/Linux venv\Scripts\activate # Windows ``` --- ## 📝 FILE LOCATIONS ### Core Files ``` app.py # Main application config.py # Settings requirements.txt # Dependencies ``` ### Data Files ``` data/mock_data.py # Demo data (current) data/data_loader.py # Real data (future) data/candidate_embeddings.npy # To be generated data/company_embeddings.npy # To be generated ``` ### Utilities ``` utils/matching.py # Cosine similarity utils/visualization.py # Network graphs utils/display.py # UI components ``` --- ## 🎯 KEY SETTINGS (config.py) ```python # Change these as needed: DEFAULT_TOP_K = 10 # Number of matches MIN_SIMILARITY_SCORE = 0.5 # Minimum threshold DEMO_MODE = True # Set False for production NETWORK_GRAPH_HEIGHT = 600 # Graph height (pixels) ``` --- ## 🐛 TROUBLESHOOTING ### Port Already in Use ```bash streamlit run app.py --server.port 8502 ``` ### Clear Cache ```bash streamlit cache clear ``` ### Force Reinstall ```bash pip install -r requirements.txt --force-reinstall ``` ### Check Logs ```bash streamlit run app.py --logger.level=debug ``` --- ## 📊 DATA SWITCHING ### Current (Mock Data) ```python # app.py line ~20 from data.mock_data import get_candidate_data, get_company_matches ``` ### Production (Real Data) ```python # app.py line ~20 from data.data_loader import get_candidate_data, get_company_matches ``` ### Turn Off Demo Banner ```python # config.py DEMO_MODE = False ``` --- ## 🔐 GITHUB TOKEN (if needed) ### Generate Token 1. GitHub → Settings → Developer settings 2. Personal access tokens → Generate new token 3. Select "repo" scope 4. Copy token ### Use Token ```bash git push Username: YOUR-USERNAME Password: [paste token here, not password] ``` --- ## 📦 SAVE EMBEDDINGS (Next Phase) ### In Your Main Code ```python import numpy as np import pickle # After generating embeddings: np.save('candidate_embeddings.npy', candidate_embeddings) np.save('company_embeddings.npy', company_embeddings) with open('candidates_processed.pkl', 'wb') as f: pickle.dump(candidates_df, f) with open('companies_processed.pkl', 'wb') as f: pickle.dump(companies_df, f) ``` ### Load in Streamlit ```python import numpy as np import pickle candidate_emb = np.load('data/candidate_embeddings.npy') company_emb = np.load('data/company_embeddings.npy') with open('data/candidates_processed.pkl', 'rb') as f: candidates = pickle.load(f) with open('data/companies_processed.pkl', 'rb') as f: companies = pickle.load(f) ``` --- ## 🎯 DEMO PREPARATION ### 5 Minutes Before ```bash # Test locally streamlit run app.py # Check URL works curl http://localhost:8501 # Close and reopen browser # Clear browser cache if needed ``` ### Backup Plan ```bash # If cloud fails, run locally: ./run.sh # Then share screen instead of URL ``` --- ## 📱 MOBILE ACCESS ### From Phone/Tablet 1. Find your computer's IP: ```bash # Mac/Linux ifconfig | grep inet # Windows ipconfig ``` 2. On phone browser: ``` http://YOUR-IP:8501 ``` --- ## 🚀 DEPLOYMENT CHECKLIST ``` ✅ git init ✅ git add . ✅ git commit -m "message" ✅ git remote add origin URL ✅ git push -u origin main ✅ Streamlit Cloud → New app ✅ Select repository ✅ Set main file: app.py ✅ Deploy ✅ Wait 2-3 minutes ✅ Test URL ✅ Share with team ``` --- ## 💡 KEYBOARD SHORTCUTS ### In Streamlit App - `R` - Rerun app - `C` - Clear cache - `Q` - Quit (terminal) ### In Terminal - `Ctrl+C` - Stop server - `Ctrl+Z` - Suspend - `Ctrl+D` - Exit --- ## 📞 QUICK SUPPORT ### Check These First 1. Python version: `python --version` (need 3.8+) 2. Dependencies: `pip list | grep streamlit` 3. Port available: `lsof -i :8501` (Mac/Linux) 4. Files present: `ls -la` ### Error Messages - "ModuleNotFoundError" → `pip install PACKAGE` - "Address already in use" → Use different port - "Permission denied" → `chmod +x run.sh` - "Git not found" → Install Git --- ## 🎓 FOR YOUR REPORT ### Architecture Diagram ``` User → Streamlit UI → app.py → utils → data ↓ config.py ``` ### Technology Stack ``` - Python 3.8+ - Streamlit (UI) - sentence-transformers (NLP) - scikit-learn (similarity) - PyVis (visualization) - Pandas (data) ``` ### Key Metrics ``` - Response time: < 1 second - Load time: < 5 seconds - Scalability: 180K companies - Code lines: ~1,500 - Modules: 7 files ``` --- ## 🔗 IMPORTANT URLS ### Resources - Streamlit Docs: https://docs.streamlit.io - Streamlit Cloud: https://share.streamlit.io - GitHub: https://github.com - Python: https://python.org ### Your Project - GitHub: https://github.com/YOUR-USERNAME/hrhub - Streamlit: https://YOUR-APP.streamlit.app - Local: http://localhost:8501 --- ## ⏰ TIME ESTIMATES ``` First deployment: 10 minutes Local testing: 2 minutes Update & redeploy: 5 minutes Add real data: 2 hours Write documentation: 1 hour Bug fixing: 30 minutes ``` --- ## ✅ FRIDAY CHECKLIST ``` □ App deployed to cloud □ URL shared with team □ Tested on 2+ browsers □ Screenshot taken □ Demo script prepared □ Backup plan ready □ Questions anticipated □ Confident with code ``` --- **REMEMBER:** ``` 1. Test locally first 2. Commit often 3. Deploy early 4. Have backup plan 5. Stay calm 6. You got this! 🚀 ``` --- *Last Updated: December 2024* *Keep this file handy during demo!*