Spaces:
Sleeping
A newer version of the Streamlit SDK is available: 1.61.1
Mini-ATS Implementation Summary
What Was Built
A complete single-file Streamlit application (streamlit_app.py) that transforms the original JD2GH candidate finder into a full-featured mini Applicant Tracking System (ATS).
File Structure
/Users/amirsh/Documents/Repo/hack/
βββ streamlit_app.py # Main application (~1800 lines, single file)
βββ requirements.txt # Python dependencies
βββ .env # API keys (gitignored)
βββ .env.example # Environment template
βββ README.md # Complete documentation
βββ run_streamlit.sh # Startup script
βββ ats.db # SQLite database (auto-created)
βββ venv/ # Python virtual environment
Key Features Implemented
1. Database Layer (SQLModel)
7 Models with Timestamps:
JobPosting- Job details, parsed requirements, weights, statsCandidate- GitHub profiles, portfoliosJobCandidateMatch- Per-job scoring, evidence, statusInvitation- Tokenized invite links with expiryAssessmentTemplate- Test questions (Soft/Tech)AssessmentAttempt- Results, duration, anti-cheat metrics
Database Functions:
init_db()- Auto-creates tables on startuprecalc_job_stats()- Updates candidate counts- Automatic timestamps (created_at, updated_at)
2. Utilities
File Upload Support:
extract_text_from_upload()- Supports PDF, DOCX, MD, TXT- Uses pypdf for PDF extraction
- Uses python-docx for Word documents
Token Management:
make_token()- URL-safe invitation tokensparse_token()- Token validation and parsing
JSON Helpers:
json_dumps()- Safe serializationjson_loads()- Safe deserialization with defaults
3. AI & GitHub Integration
Gemini Wrapper:
gemini_extract_spec()- Extracts structured JD data- Returns: role, languages, topics, must_have, nice_to_have
- Lowercase normalization for matching
GitHub Discovery:
run_discovery_for_job()- Reuses existing search_github_users()- Scores candidates using existing score_user()
- Returns: login, name, location, followers, stars, portfolio, scores, evidence
Assessment Templates:
seed_assessment_templates()- Creates default tests- Soft Skills: 5 MCQs (7 minutes)
- Technical: 8 MCQs (20 minutes)
4. Multi-Page Navigation
5 Pages:
Dashboard
- Job posts, candidates, applied, tested metrics
- Active job listings table
- Click-through to other pages
Job Postings
New Job Tab:
- Form: title, city, synonyms, min repos
- JD input: text area OR file upload
- AI extraction with Gemini
- Editable multiselect chips (languages, topics, must_have, nice_to_have)
- Weight sliders (skills, activity, quality, completeness)
- Save to database
Manage Tab:
- Card grid of existing jobs
- Stats per job
- Edit and delete buttons
- "Open Dataset" β navigates to Candidates
Candidates
- Job selector dropdown
- Config display (city, synonyms, min repos, skills)
- Run/Refresh Discovery button
- Searches GitHub
- Scores candidates
- Upserts to database
- Filters:
- "Has all must-haves" checkbox
- "Active in last 90 days" checkbox
- Top N Display:
- Slider to select top candidates
- Profile cards with scores and evidence
- Invite button β generates token link
- Full Dataset Table
- Export: CSV and JSON download buttons
Tests (HR)
- Job selector
- Table of all assessment attempts
- Columns: login, name, kind, scores, duration, anti-cheat metrics, status
- Real-time view of candidate test results
Candidate Portal
- Token-based access via URL parameter
- Profile Form:
- Name, email, LinkedIn, years experience
- Save β updates candidate record
- Marks invitation as used
- Updates match status to "APPLIED"
- Assessment Buttons:
- Start Soft Skills Test (7 min)
- Start Technical Test (20 min)
- Shows completion status and scores
- Active Assessment:
- Timer display (MM:SS countdown)
- Auto-submit on timeout
- Anti-cheat tracking display
- MCQ questions with radio buttons
- Submit button
- Scoring with penalties
- Updates match status to "TESTED"
5. Assessment System
Features:
- Timer with countdown display
- Auto-submit on timeout
- MCQ questions rendered from templates
- Lightweight anti-cheat JavaScript:
- Tab switch detection (visibilitychange event)
- Copy/paste blocking
- Scoring:
- Soft: 2 points per question, max 10
- Tech: Scaled to 10 points
- Penalties: -1 for >2 tab switches, -1 for copy/paste
- Results stored in AssessmentAttempt table
- Job stats auto-updated
6. Reused Code
From Original App:
extract_jd_spec()- Gemini extraction (kept as fallback)search_github_users()- GitHub GraphQL search (async)score_user()- Scoring algorithm with subscores- All existing GitHub query logic
- All existing scoring formulas
New Wrappers:
gemini_extract_spec()- Calls original, adds normalizationrun_discovery_for_job()- Orchestrates search + scoring
Technical Constraints Met
β
Single file - Everything in streamlit_app.py
β
Reuse existing code - All GitHub/Gemini functions preserved
β
SQLite + SQLModel - Local persistence with ORM
β
Minimal dependencies - Only added pypdf, python-docx
β
No email - Copyable invitation links
β
Lightweight anti-cheat - JavaScript event listeners
β
Simple UI - Clean Streamlit components, no custom CSS
Dependencies Added
pypdf # PDF text extraction
python-docx # DOCX text extraction
(All others were already in requirements.txt)
Testing Checklist
- Database initialization on startup
- Job creation with JD extraction
- File upload (PDF, DOCX, MD, TXT)
- Editable requirement chips
- Weight sliders
- GitHub discovery and scoring
- Candidate filtering
- Invitation generation
- Token-based portal access
- Profile form save
- Assessment timer
- MCQ rendering
- Anti-cheat tracking
- Assessment submission and scoring
- Dashboard metrics
- CSV/JSON export
Usage Flow
- Start:
./run_streamlit.shorstreamlit run streamlit_app.py - Create Job: Job Postings β New Job β upload/paste JD β extract β edit β save
- Find Candidates: Candidates β select job β Run Discovery
- Invite: Top N β click Invite β copy link
- Candidate Flow: Opens link β fills profile β takes tests
- Review: Tests (HR) β view scores and anti-cheat data
- Track: Dashboard β see overall metrics
Code Statistics
- Total Lines: ~1800
- Models: 7 SQLModel classes
- Pages: 5 Streamlit pages
- Functions: ~15 utility/wrapper functions
- Reused: 3 original functions (extract_jd_spec, search_github_users, score_user)
- Database Tables: 6 tables with auto-timestamps
- Assessment Questions: 13 total (5 soft + 8 tech)
What Makes This a "Mini-ATS"
- Complete Lifecycle: Discovery β Invitation β Application β Assessment β Review
- Database Persistence: All data stored locally with relationships
- Multi-User Support: Separate candidate portal vs HR views
- Assessment Platform: Timed tests with scoring and anti-cheat
- Analytics: Dashboard with KPIs and job stats
- Export: CSV/JSON for external analysis
Future Enhancements (Not Implemented)
- Email integration (SendGrid, AWS SES)
- PostgreSQL for multi-user/production
- Enterprise proctoring APIs
- Advanced analytics dashboard
- Video interviews
- ATS integrations (Greenhouse, Lever)
- Candidate pipeline stages
- Automated email campaigns