Skip to content

[P2-Architecture] Create FastAPI REST API endpoints #63

Description

@Ztrimus

Problem (relates to #5)

Only Streamlit UI and CLI are available. No programmatic API for:

  • Integration with other tools/scripts
  • Mobile app backends
  • Browser extensions
  • Automation workflows

Solution

Create a FastAPI application with these endpoints:

POST /api/v1/extract-job      → Extract JD from URL
POST /api/v1/parse-resume     → Parse user resume (PDF/JSON)
POST /api/v1/tailor-resume    → Generate tailored resume
POST /api/v1/cover-letter     → Generate cover letter
POST /api/v1/score            → Compute similarity metrics
POST /api/v1/pipeline         → Run full pipeline (SSE streaming)
GET  /api/v1/health           → Health check

Streaming with SSE

from fastapi import FastAPI
from fastapi.responses import StreamingResponse

@app.post("/api/v1/pipeline")
async def run_pipeline(request: PipelineRequest):
    async def event_stream():
        async for event in pipeline.run_streaming(request):
            yield f"data: {event.model_dump_json()}\n\n"
    return StreamingResponse(event_stream(), media_type="text/event-stream")

Related

Files

  • zlm/api.py (new - FastAPI app)
  • zlm/api_schemas.py (new - request/response models)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumMedium priority - quality & polisharchitectureArchitecture changeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions