Skip to content

Add API client module (axios/fetch wrapper with base URL and error handling) #4

Open

Description

@adi44

Task

Before wiring up the frontend to the backend, create a centralized API client so all fetch calls are consistent and maintainable.

Suggested: frontend/src/api/client.ts

const BASE = import.meta.env.VITE_API_URL ?? 'http://localhost:8000/api';

export async function uploadDataset(file: File) { ... }
export async function listDatasets() { ... }
export async function runAnalysis(filename: string) { ... }
export async function runAgentAnalysis(filename: string, task?: string) { ... }

Acceptance Criteria

  • Single module for all API calls
  • VITE_API_URL env var used for base URL (so it works in both local dev and deployed)
  • All functions return typed responses matching backend Pydantic schemas
  • Errors throw with a consistent { message, status } shape
  • Add frontend/.env.example with VITE_API_URL=http://localhost:8000/api

Activity

  1. added
    sprint-1Sprint 1: Backend-Frontend Integration
    on Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew featuresprint-1Sprint 1: Backend-Frontend Integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions