diff --git a/.gitignore b/.gitignore
index 8a6192a26..d79f97935 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,50 +1,4 @@
-node_modules/
-dist/
-!extension/dist/
-*.tsbuildinfo
-hosted-contract.json
-plugin-command-manifest.json
-.webcmd/
-.superpowers/
-.worktrees/
-.agents/*
-!.agents/plugins/
-.agents/plugins/*
-!.agents/plugins/marketplace.json
-.mcp.json
-*.log
-.DS_Store
+backend/node_modules/
+backend/uploads/
-# Local-only research, examples, and agent planning artifacts
-autoresearch/
-cases/
-designs/
-docs/superpowers/
-instagram-test/
-llms.txt
-sitemaps/
-
-# Extensions & Secrets
-*.pem
-*.crx
-*.zip
-.envrc
-.windsurf
-.claude
-.cortex
-
-# Database files
-*.db
-autoresearch-results.tsv
-
-# webcmd benchmarks (dataset comparison harness)
-benchmarks/results/
-benchmarks/.venv/
-benchmarks/node_modules/
-benchmarks/**/__pycache__/
-benchmarks/.pytest_cache/
-benchmarks/pytest-cache-files-*
-benchmarks/datasets/*.json
-!benchmarks/datasets/Stealth_Webcmd.json
-benchmarks/.playwright-cli/
-benchmarks/.playwright/
+backend/.env
diff --git a/README.md b/README.md
index e7f2c266c..d032c062d 100644
--- a/README.md
+++ b/README.md
@@ -1,160 +1,194 @@
-
+# Application Rescue Agent ๐
+A hackathon MVP that helps students find relevant opportunities (internships,
+scholarships, fellowships, competitions, grants, university programs) and
+**rescues** their applications before deadlines, confusing forms, or missing
+documents cost them the opportunity.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Learning stays quiet and selective: the live browser is always truth, Webcmd
-never explores just to learn, and a memory failure never blocks the task. First
-access may use a Webcmd Cloud seed; subsequent learning stays local.
-
-For local, multi-step browser exploration, agents can send one sandboxed
-Playwright-style program to an explicit browser session:
+### 3. (Optional) Build for production
```bash
-webcmd --profile work session create "Work Project" -f json
-# id: work-project-k7
-webcmd --profile work --session work-project-k7 browser tabs
-webcmd --profile work --session work-project-k7 browser run --file explore.js
-printf 'return await page.title();' \
- | webcmd --profile work --session work-project-k7 browser run --stdin
-webcmd --profile work session close work-project-k7
+cd frontend && npm run build # outputs to frontend/dist
+cd backend && npm start
```
-
-Profiles are cookie jars; Sessions are independent browser windows within a
-profile, so Session IDs are immutable, Profile-scoped, and safe to reuse for
-that Session's lifetime. Parallel agents should create separate Sessions.
-Raw browser commands require an explicit readable Session ID.
-
-## Benchmarks
-
-On [BU Bench V1](https://github.com/browser-use/benchmark#bu-bench-v1), a
-100-task browser automation benchmark, Webcmd recorded the highest accuracy and
-lowest estimated controller cost per completed task, and fewest agent turns per
-completed task in this comparison.
-
-
-
-All tools used the same Pi controller, controller model, Codex `gpt-5.4` judge,
-and CloakBrowser engine. This is a stronger judge than the original BU Bench
-setup, whose [current runner uses Gemini 2.5 Flash](https://github.com/browser-use/benchmark/blob/main/run_eval.py#L37-L38).
-Accuracy is passed tasks out of 100. Cost and agent turns are averaged over
-completed tasks; cost excludes judge usage. See the
-[benchmark report](./benchmarks/README.md) for category results, methodology,
-architectural analysis, and reproduction steps.
-
-## Learn More
-
-Webcmd Cloud can run supported commands and browser sessions on hosted infrastructure. It is in active development and is not yet stable.
-
-- [Prompt Cookbook](https://webcmd.dev/docs/agent-prompts)
-- [How Webcmd Works](https://webcmd.dev/docs/concepts)
-- [Local or Cloud](https://webcmd.dev/docs/local-or-cloud)
-- [Command Surface](https://webcmd.dev/docs/cli-reference)
-
-## Contributing
-
-See [CONTRIBUTING.md](./CONTRIBUTING.md).
-
-## License
-
-Released under the terms in [`LICENSE`](./LICENSE).
+Serve `frontend/dist` with any static host, or add `express.static` to
+`server.js` if you want the backend to serve the built frontend directly.
+
+---
+
+## Environment variables (`backend/.env`)
+
+| Variable | Default | Notes |
+|------------------|-------------------------------------------------------|-------|
+| `MONGO_URI` | `mongodb://127.0.0.1:27017/application_rescue_agent` | Local or Atlas connection string |
+| `PORT` | `5000` | Backend port |
+| `WEBCMD_MODE` | `DEMO` | `DEMO` or `REAL` |
+| `WEBCMD_CLI_PATH`| `webcmd` | Only used when `WEBCMD_MODE=REAL` |
+
+---
+
+## Backend API reference
+
+| Method | Route | Description |
+|--------|-------------------------------------|--------------|
+| GET | `/api/health` | Health check + current Webcmd mode |
+| GET | `/api/profile` | Get the student profile |
+| POST | `/api/profile` | Create/update the student profile |
+| GET | `/api/opportunities` | All opportunities with Match % |
+| GET | `/api/opportunities/recommended` | Top opportunities sorted by Match % (`?limit=`) |
+| GET | `/api/opportunities/:id` | Single opportunity detail |
+| GET | `/api/documents` | Document vault status |
+| POST | `/api/documents/upload` | `{ type, fileName }` โ marks a document uploaded |
+| GET | `/api/applications` | All applications for the student |
+| POST | `/api/applications` | `{ opportunityId }` โ start/resume a Rescue application |
+| GET | `/api/applications/:id` | Single application detail |
+| POST | `/api/applications/:id/analyze` | **Runs the Rescue Agent** โ opens the form, auto-fills, detects missing items |
+| POST | `/api/applications/:id/submit` | Explicit, user-triggered submission (blocked until "Ready for Review") |
+
+---
+
+## How matching works
+
+`services/matchEngine.js` computes an explainable **0โ100 Match %** per
+opportunity, no ML required for the MVP:
+
+- Skills overlap โ 40 pts
+- Interests overlap โ 20 pts
+- CGPA eligibility โ 20 pts
+- Preferred opportunity type โ 15 pts
+- Has experience listed โ 5 pts
+
+## How the Rescue Agent works (`webcmdService.js`)
+
+This is the **only** file that knows about Webcmd, so the rest of the app
+never changes when you swap modes:
+
+- **DEMO mode** (default): a deterministic, scripted analysis against a
+ fixed demo application form (Name, Email, University, Degree, Branch,
+ Skills, Resume, Transcript, SOP). It reads the student's Profile and
+ Document Vault, fills every field it safely can, and reports the rest as
+ missing. This is 100% reliable for a live hackathon demo โ no network
+ calls, no flakiness.
+- **REAL mode**: shells out to an installed **Webcmd CLI** binary
+ (`webcmd analyze --url {title}
+ {description &&{description}
} + {action &&Application not found.
; + + const opp = app.opportunity; + const hasRun = app.formFields && app.formFields.length > 0; + const missingDocFields = (app.formFields || []).filter((f) => f.isDocument && !f.filled); + const readyToSubmit = app.status === "Ready for Review"; + const submitted = app.status === "Submitted"; + + return ( ++ Application Rescue +
+{opp?.organization}
+{field.label}
+ {field.filled ? ( ++ {field.filled ? field.value : "Missing"} +
+ + {!field.filled && field.isDocument && ( + + )} ++ Some fields still need attention - update your profile, then re-run the Rescue Agent. +
+ )} ++ {submitted + ? "Application submitted" + : readyToSubmit + ? "Ready for your review" + : "Waiting on missing items"} +
++ {submitted + ? `Submitted on ${new Date(app.submittedAt).toLocaleString()}.` + : readyToSubmit + ? "Everything is filled in. Review the fields above, then submit when you're ready." + : "Resolve the missing items above and re-run the Rescue Agent to unlock submission."} +
+ {submitError &&{submitError}
} +{app.opportunity?.title}
+{app.opportunity?.organization}
+Welcome back,
++ {profile.degree} in {profile.branch} ยท {profile.university} +
+{app.opportunity?.title}
+{app.opportunity?.organization}
+{value}
+{label}
+{hint}
++ {discoveryMessage} +
+ )} + + {/* Opportunity Type Filters */} ++ Keep these up to date so the Rescue Agent can auto-fill + applications instantly. +
++ {doc.type} +
+ ++ {DESCRIPTIONS[doc.type]} +
+ + {doc.status === "uploaded" ? ( +
+
+ Supported formats: PDF, DOC, DOCX ยท Maximum size: 10 MB +
+ +Opportunity not found.
; + } + + return ( ++ {opportunity.organization} +
++ {opportunity.description} +
+ ++ {opportunity.eligibility || "Check official opportunity page"} +
+ + {opportunity.minCgpa > 0 && ( ++ Minimum CGPA required: {opportunity.minCgpa} +
+ )} ++ Ready to apply? +
+ ++ The Rescue Agent will open the form, auto-fill what it can from + your profile, and flag anything missing before you submit. +
+
+
+ {value} +
+