A newer version of the Streamlit SDK is available:
1.52.1
β‘ HRHUB QUICK REFERENCE
Copy-paste commands for instant deployment
π₯οΈ LOCAL TESTING
Mac/Linux
cd hrhub
./run.sh
Windows
cd hrhub
run.bat
Manual Way
cd hrhub
pip install -r requirements.txt
streamlit run app.py
π GITHUB DEPLOYMENT
First Time Setup
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
git add .
git commit -m "Update description here"
git push
βοΈ STREAMLIT CLOUD
URL
Settings
- Repository: YOUR-USERNAME/hrhub
- Branch: main
- Main file: app.py
π§ COMMON COMMANDS
Install Dependencies
pip install -r requirements.txt
Test Mock Data
python data/mock_data.py
Check Python Version
python --version
Create Virtual Environment
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)
# 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
streamlit run app.py --server.port 8502
Clear Cache
streamlit cache clear
Force Reinstall
pip install -r requirements.txt --force-reinstall
Check Logs
streamlit run app.py --logger.level=debug
π DATA SWITCHING
Current (Mock Data)
# app.py line ~20
from data.mock_data import get_candidate_data, get_company_matches
Production (Real Data)
# app.py line ~20
from data.data_loader import get_candidate_data, get_company_matches
Turn Off Demo Banner
# config.py
DEMO_MODE = False
π GITHUB TOKEN (if needed)
Generate Token
- GitHub β Settings β Developer settings
- Personal access tokens β Generate new token
- Select "repo" scope
- Copy token
Use Token
git push
Username: YOUR-USERNAME
Password: [paste token here, not password]
π¦ SAVE EMBEDDINGS (Next Phase)
In Your Main Code
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
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
# Test locally
streamlit run app.py
# Check URL works
curl http://localhost:8501
# Close and reopen browser
# Clear browser cache if needed
Backup Plan
# If cloud fails, run locally:
./run.sh
# Then share screen instead of URL
π± MOBILE ACCESS
From Phone/Tablet
- Find your computer's IP:
# Mac/Linux
ifconfig | grep inet
# Windows
ipconfig
- 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 appC- Clear cacheQ- Quit (terminal)
In Terminal
Ctrl+C- Stop serverCtrl+Z- SuspendCtrl+D- Exit
π QUICK SUPPORT
Check These First
- Python version:
python --version(need 3.8+) - Dependencies:
pip list | grep streamlit - Port available:
lsof -i :8501(Mac/Linux) - 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!