{"id":51063401,"url":"https://github.com/samso9th/dromo-api","last_synced_at":"2026-06-23T04:01:48.277Z","repository":{"id":366065832,"uuid":"1274891192","full_name":"Samso9th/dromo-api","owner":"Samso9th","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-20T04:42:10.000Z","size":187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T06:16:29.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samso9th.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-20T02:16:08.000Z","updated_at":"2026-06-20T04:42:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Samso9th/dromo-api","commit_stats":null,"previous_names":["samso9th/dromo-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Samso9th/dromo-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samso9th%2Fdromo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samso9th%2Fdromo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samso9th%2Fdromo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samso9th%2Fdromo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samso9th","download_url":"https://codeload.github.com/Samso9th/dromo-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samso9th%2Fdromo-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34674702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-23T04:01:46.969Z","updated_at":"2026-06-23T04:01:48.264Z","avatar_url":"https://github.com/Samso9th.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dromo API\n\nAI resume-tailoring backend. Express + Sequelize + Postgres + Redis. Full design: `../docs/api-spec.md`.\n\n## Status\n- ✅ **Foundation**: config, 14 Sequelize models + associations, initial migration, curated\n  `model_pricing` seeder, error/validation middleware, runnable Express app with health checks.\n- ✅ **Auth** (`/auth`): email+password (bcrypt), passwordless magic link (Resend, single-use/15-min),\n  JWT in httpOnly cookies with refresh-token rotation, Passport OAuth (Google/GitHub/LinkedIn,\n  conditionally registered), the 100-credit signup grant, `requireAuth` + `requirePlan` middleware.\n- ✅ **Credit engine + OpenRouter**: OpenRouter client (chat + `/models`), live pricing refresh into\n  `model_pricing` (runs on boot), the transactional charge path (`chargeAndRun`: pre-flight → run →\n  charge actual tokens → usage event + ledger + balance, atomic), credit config (markup, floors, plan\n  gating, QA/retry/concurrent limits). Endpoints: `GET /models`, `GET /billing/balance`,\n  `GET /billing/transactions`.\n- ✅ **Sessions + generation**: `/sessions` CRUD (+ archive, model/template switch), and\n  `tailor` / `cover-letter` / `chat` / `interview-brief` — each calls OpenRouter with a purpose-built\n  prompt, charges via the credit engine, persists the artifact, and enforces model+template gating,\n  retry caps, Q\u0026A caps, and the free 3-concurrent-session cap. Master-resume CRUD (`/resume/master`).\n- ✅ **Resume upload + parse**: `POST /resume/master` (multer) → text extraction (pdf-parse / mammoth)\n  → AI parse to master JSON (charged via the credit engine) → optional Cloudinary storage → persist.\n  Verified on a real 4-page PDF (name, 22 skills, 8 roles, 6 projects, 4 education, 3 certs).\n- ✅ **Frontend wired to the live API** (cookie sessions, `credentials:'include'`).\n- ✅ **Billing checkout + webhooks**: `POST /billing/checkout` (Stripe card / Dubu Pay), raw-body\n  signature-verified `POST /webhooks/stripe` + `/webhooks/dubu`, and an idempotent `grantForPayment`\n  (subscription → plan + monthly credits; top-up → credits; cancel → downgrade, keep credits). Needs\n  `STRIPE_SECRET_KEY` / `DUBU_API_*` to go live (graceful 503 otherwise).\n- ✅ **Files (Puppeteer)**: `GET /files/:kind/:sessionId?format=` — template-aware server-rendered PDF +\n  DOCX/TXT/MD for resume / cover-letter / interview-brief. Verified (valid PDF/DOCX bytes).\n- ⏳ Optional: point the frontend download buttons at `/files` (currently client-side export, which\n  also works); scheduled jobs (pricing refresh cron, subscription renewal safety net).\n\n## Setup\n```bash\nnpm install\ncp .env.example .env          # fill DATABASE_URL, REDIS_URL, secrets\ncreatedb dromo                # or point DATABASE_URL at an existing PG\nnpm run db:migrate            # create all tables\nnpm run db:seed               # load curated model_pricing\nnpm run dev                   # http://localhost:4000/api/v1/health\n```\n\n## Scripts\n- `npm run dev` — watch mode (tsx, resolves `@/` aliases)\n- `npm run build` — `tsc` + `tsc-alias` → `dist/`\n- `npm run db:migrate` / `db:migrate:undo` / `db:seed` / `db:seed:undo`\n- `npm run typecheck` / `npm run lint`\n\n## Notes\n- **Path alias** `@/*` → `src/*` (tsconfig). Dev via tsx; prod build rewritten by tsc-alias.\n- **DECIMAL columns** (`inputPrice`, `outputPrice`, `amountUsd`, `rawCostUsd`) come back as **strings**\n  from Postgres — wrap with `Number()` in services (the credit engine does this).\n- **Webhooks** (Stripe/Dubu) must be mounted with `express.raw()` *before* the JSON parser for\n  signature verification — see `src/app.ts` note.\n- Migrations/seeders are `.cjs` (run directly by sequelize-cli); app code is TS.\n\n## Layout\n```\nsrc/\n  config/     env, database, redis, logger, sequelize-cli.cjs\n  models/     14 models + index (associations)\n  migrations/ 20260620000000-init.cjs\n  seeders/    20260620000100-model-pricing.cjs\n  middleware/ error, validate\n  routes/     index (health; feature modules mount here)\n  utils/      app-error\n  types.ts    shared domain types (resume JSONB shapes, enums)\n  app.ts server.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamso9th%2Fdromo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamso9th%2Fdromo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamso9th%2Fdromo-api/lists"}