Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

.env.local
env.local
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The engine is built on a "Decoupled Orchestration" model:
| :--- | :--- | :--- |
| **Job Application** | Cover Letters & Resume Summaries | Self-critique of tone and skill alignment. |
| **Marketplace** | Product titles, descriptions & SEO tags | Automatic extraction of selling points and SEO optimization. |
| **Comparison** | Job Description vs. Resume analysis | Semantic gap analysis with ✅/❌ match reporting. |
| **Job Comparison** | Job Description vs. Resume analysis | Semantic gap analysis with ✅/❌ match reporting. |

---

Expand Down
4 changes: 4 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
USE_AI=true
GEMINI_API_KEY=your_api_key_here
GROQ_API_KEY=your_groq_key_here
OPENAI_API_KEY=your_openai_key_here
2 changes: 0 additions & 2 deletions env.local

This file was deleted.

133 changes: 83 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"test:watch": "jest --watch"
},
"dependencies": {
"next": "16.1.4",
"@google/generative-ai": "^0.24.1",
"lucide-react": "^0.575.0",
"next": "^16.1.6",
"node-fetch": "^3.3.2",
"react": "19.2.3",
"react-dom": "19.2.3"
Expand Down
24 changes: 10 additions & 14 deletions src/app/api/generate/route.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import { NextRequest, NextResponse } from "next/server"
import { runEngine } from "@/engine/core/engine"
import { EngineRequest } from "@/engine/core/request"
import { OpenAIRunner } from "../../../engine/runner/openAIRunner";
import { FakeRunner } from "@/engine/runner/fakeRunner"
import { MODE_REGISTRY } from "@/engine/core/registry"
import { getRunner } from "@/engine/runner/factory";


export async function POST(req: NextRequest) {
try {


const body: EngineRequest = await req.json();
const modeLogic = MODE_REGISTRY[body.mode];

if (!modeLogic) {
return NextResponse.json({ error: "Invalid mode" }, { status: 400 });
}

const mode = MODE_REGISTRY[body.mode];
if (!mode) {
return NextResponse.json({ error: "Invalid mode" }, { status: 400 });
}

const runner =
process.env.USE_OPENAI === "true"
? new OpenAIRunner({apiKey: process.env.OPENAI_API_KEY})
: new FakeRunner();
const runner = getRunner(body.provider);

const result = await runEngine(mode, body, runner);
const result = await runEngine(modeLogic, body, runner);

return NextResponse.json(result);
} catch (err) {
console.error("API Error:", err);

return NextResponse.json(
{ error: err instanceof Error ? err.message : "Internal Server Error" },
{ status: 500 }
Expand Down
Loading