Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
266b947
Phase 0: make analysis pipeline real, honest, and provider-agnostic
claude Jun 6, 2026
3fe85de
Phase 1: injection hardening, real data sources, concurrent pipeline
claude Jun 6, 2026
34477ae
Phase 2: resume/ATS analysis, URL ingest, structured verdict
claude Jun 6, 2026
1d0ef39
Phase 3: persistence, auth, application tracking
claude Jun 6, 2026
f2ad03b
Phase 4: CI, real salary data, Telegram bot, password reset
claude Jun 6, 2026
21f1146
Phase 5: COL data, salary cache bug, Alembic, application export
claude Jun 6, 2026
90f3727
Phase 6: browser scraper, async queue, email, Docker
claude Jun 6, 2026
6c07158
Phase 7: rate limiting, bot→queue, UI/UX overhaul
claude Jun 6, 2026
6a90770
Phase 8: application/interview stage tracker + analytics
claude Jun 6, 2026
abb3dc2
Phase 9: master CV + project gallery + tailored CV/cover letter
claude Jun 6, 2026
1d48f8b
Phase 10: deterministic constraint check + tone presets + re-check
claude Jun 6, 2026
dd97100
Phase 11: soft constraint suggestions + master CV revision history
claude Jun 6, 2026
51ff20b
Phase 12: PDF export for tailored CVs / cover letters
claude Jun 6, 2026
705d5cc
Phase 13: bulk project + application import (CSV + LLM)
claude Jun 6, 2026
020bd71
Phase 14: revision diff, master CV PDF, artifact A/B comparison
claude Jun 6, 2026
0d41bdf
Phase 15: Telegram account linking + stage notifications
claude Jun 6, 2026
155831b
Phase 16: timeline visualizations + word-level inline diff
claude Jun 6, 2026
f19d3ff
Phase 17: resumable analysis pipeline + inactivity reminders
claude Jun 6, 2026
f2fd12a
Phase 18: structured logging, metrics, timing, audit log
claude Jun 6, 2026
7d46c90
Phase 19: background analysis with cross-session resume
claude Jun 6, 2026
d252f7a
Phase 20: TOTP-based two-factor authentication
claude Jun 6, 2026
afefb22
Phase 21: public read-only application share links
claude Jun 6, 2026
2e14f4b
Phase 22: REST API + long-lived bearer tokens
claude Jun 6, 2026
d2e8530
Phase 23: outbound webhooks on events
claude Jun 6, 2026
04a371a
Phase 24: OAuth login (Google / GitHub)
claude Jun 6, 2026
7e2cfbe
Phase 25: security headers (CSP/HSTS) + cookie/transport hardening
claude Jun 6, 2026
bbac588
Phase 26: Postgres-tested migrations in CI
claude Jun 6, 2026
53fbbf8
Phase 27: Chrome extension (MV3) driving the REST API
claude Jun 6, 2026
4b02b4f
Deployment: regenerate uv.lock + Replit compatibility analysis
claude Jun 6, 2026
116f471
Fix CI: editable install failed on flat-layout package discovery
claude Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.git
.github
__pycache__/
*.pyc
.venv/
venv/
data/
*.db
*.sqlite*
.env
.env.*
!.env.example
tests/
attached_assets/
*.png
.streamlit/secrets.toml
84 changes: 84 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copy to .env and fill in whichever provider you want to use.
# Auto-detection order: Anthropic -> OpenAI -> Featherless.
# Override with LLM_PROVIDER=anthropic|openai|featherless.

# Anthropic (Claude)
# ANTHROPIC_API_KEY=sk-ant-...
# ANTHROPIC_BASE_URL= # optional; SDK uses default if unset

# OpenAI
# OPENAI_API_KEY=sk-...

# Featherless (OpenAI-compatible, hosts Qwen / DeepSeek)
# FEATHERLESS_API_KEY=...

# Tuning (optional)
# LLM_PROVIDER=anthropic
# LLM_TEMPERATURE=0.4
# LLM_MAX_TOKENS=2000
# LLM_MAX_RETRIES=3

# Persistence
# DATABASE_URL=postgresql://user:pass@localhost:5432/joboffer
# Default (unset): SQLite at ./data/joboffer.db (created automatically).

# Phase 1 data sources (optional, degrade honestly if unset)
# NEWS_API_KEY=... # newsapi.org for real company news
# LAYOFFS_DATASET_URL=... # JSON dataset URL with layoff records

# Phase 4 — real salary benchmarks via Adzuna (free tier, ~1000 calls/month)
# Sign up at https://developer.adzuna.com/
# ADZUNA_APP_ID=...
# ADZUNA_APP_KEY=...

# Phase 5 — real cost-of-living data (JSON dataset, e.g. self-hosted Numbeo
# scrape or any city-keyed index). Each record needs a "city" field; supported
# numeric fields: cost_of_living_index, rent_index, groceries_index,
# local_purchasing_power, monthly_rent_1bedroom_city_center, etc.
# COL_DATASET_URL=...

# Migrations: set to 1 to opt into Alembic-managed schema. When unset, init_db
# uses create_all (zero-config). With USE_ALEMBIC=1 run `alembic upgrade head`
# at deploy time.
# USE_ALEMBIC=1

# Async job queue (optional — needs the [worker] extra: celery + redis).
# When unset, analysis runs in-process. docker-compose sets this automatically.
# CELERY_BROKER_URL=redis://localhost:6379/0
# CELERY_RESULT_BACKEND=redis://localhost:6379/0

# Browser scraper (optional — needs the [browser] extra: playwright).
# Enables headless rendering for JS job boards + Numbeo COL where APIs are
# paid/unavailable. Heavy; opt in explicitly. Then: `playwright install chromium`.
# BROWSER_SCRAPER_ENABLED=1

# Email delivery (optional — for password-reset emails). All five required.
# SMTP_HOST=smtp.example.com
# SMTP_PORT=587
# SMTP_USERNAME=...
# SMTP_PASSWORD=...
# EMAIL_FROM=no-reply@yourdomain.com
# SMTP_USE_TLS=1
# APP_BASE_URL=https://yourdomain.com # makes reset emails contain a full link

# Rate-limiting tuning (defaults are usually fine). MAX = attempts, WINDOW = sec.
# RL_LOGIN_MAX=10
# RL_LOGIN_WINDOW=300
# RL_REGISTER_MAX=5
# RL_REGISTER_WINDOW=3600
# RL_RESET_MAX=5
# RL_RESET_WINDOW=3600
# RL_ANALYSIS_MAX=30
# RL_ANALYSIS_WINDOW=3600

# UI / discoverability
# TELEGRAM_BOT_USERNAME=YourBot # if set, sidebar shows a link to t.me/...
# REDIS_URL=redis://localhost:6379/1 # distributed rate-limit backend (else in-mem)

# Telegram bot channel (alternative to the Streamlit UI)
# TELEGRAM_BOT_TOKEN=... # from @BotFather

# Password reset — self-hosted convenience flag.
# Set to 1 ONLY in single-user/self-hosted deployments to display reset
# tokens directly in the UI. Leave UNSET in multi-tenant production.
# RESET_TOKEN_SURFACE_IN_UI=1
108 changes: 108 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: unittest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Telegram extra so the bot-handler tests can run.
pip install -e ".[telegram]"

- name: Show installed package versions
run: pip freeze | sort

- name: Run unit tests
# Strip any provider keys the CI environment may inject so the demo
# smoke test exercises the no-key path deterministically.
env:
ANTHROPIC_API_KEY: ""
OPENAI_API_KEY: ""
FEATHERLESS_API_KEY: ""
LLM_PROVIDER: ""
run: python -m unittest discover -s tests -v

migrations-postgres:
name: alembic up/down/up on Postgres
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: joboffer
POSTGRES_PASSWORD: joboffer
POSTGRES_DB: joboffer_ci
ports:
- 5432:5432
# Wait for the DB to be ready before the job's steps run.
options: >-
--health-cmd "pg_isready -U joboffer -d joboffer_ci"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install "psycopg[binary]>=3.1"

- name: Migrate up, down to base, and back up (Postgres)
# SQLite's permissive DDL hides issues that Postgres enforces (real
# ALTER semantics, FK ordering, type strictness). Running the full
# up/down/up cycle here catches migrations that only work on SQLite.
env:
DATABASE_URL: postgresql+psycopg://joboffer:joboffer@localhost:5432/joboffer_ci
run: |
python -m alembic upgrade head
python -m alembic downgrade base
python -m alembic upgrade head

- name: Verify final schema has the latest tables
env:
DATABASE_URL: postgresql+psycopg://joboffer:joboffer@localhost:5432/joboffer_ci
run: |
python - <<'PY'
import os
from sqlalchemy import create_engine, inspect
eng = create_engine(os.environ["DATABASE_URL"])
tables = set(inspect(eng).get_table_names())
required = {
"users", "applications", "application_stages",
"master_cvs", "projects", "application_artifacts",
"telegram_links", "audit_events", "background_analyses",
"user_two_factor", "application_shares", "api_tokens",
"webhooks", "webhook_deliveries", "oauth_identities",
}
missing = required - tables
assert not missing, f"missing tables after migrate: {missing}"
print(f"OK: {len(required)} expected tables present on Postgres")
PY
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ logs/
*.db
*.sqlite
*.sqlite3
data/

# User uploads
uploads/
Expand All @@ -66,3 +67,9 @@ user_data/
*token*
config.json
credentials.json

# …but legitimate code that happens to contain those words must be tracked.
!migrations/versions/*token*
!tests/**/*token*
!services/**/*token*
!db/**/*token*
9 changes: 9 additions & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
headless = true
address = "0.0.0.0"
port = 5000
# XSRF protection guards Streamlit's own widget callbacks. Keep it on; this
# is the default, pinned here so a future edit doesn't silently disable it.
enableXsrfProtection = true
# CORS must stay off for XSRF protection to function (Streamlit ties the two
# together). The app is same-origin, so this is correct.
enableCORS = false
# Don't gather usage stats from a self-hosted deployment.
[browser]
gatherUsageStats = false
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1
FROM python:3.12-slim AS base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1

WORKDIR /app

# System deps: build tools for any wheels that need them; curl for healthchecks.
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential curl \
&& rm -rf /var/lib/apt/lists/*

# Install Python deps first (better layer caching). Copy only metadata so a
# code change doesn't bust the dependency layer.
COPY pyproject.toml ./
# Editable install needs the package dirs to exist at build time.
COPY . .
RUN pip install --upgrade pip && pip install ".[telegram]"

EXPOSE 5000

# Default command runs the Streamlit web app. The worker/bot override this in
# docker-compose.
CMD ["streamlit", "run", "app.py", \
"--server.address=0.0.0.0", "--server.port=5000", "--server.headless=true"]
Loading
Loading