Skip to content

API Reference

Manvendra Bhardwaj edited this page May 23, 2026 · 1 revision

API Reference

Base URL (local): http://localhost:3000/api
Base URL (production): https://ai-debugger-assistant-2.onrender.com/api

Protected routes require an Authorization: Bearer <token> header.


Auth Routes

POST /api/auth/register

Registers a new user with email and password.

Request body:

{
  "name": "Manvendra",
  "email": "user@example.com",
  "password": "yourpassword"
}

Response 201:

{
  "message": "User registered successfully"
}

POST /api/auth/login

Logs in with email and password and returns a JWT token.

Request body:

{
  "email": "user@example.com",
  "password": "yourpassword"
}

Response 200:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "64abc...",
    "name": "Manvendra",
    "email": "user@example.com"
  }
}

POST /api/auth/google

Verifies a Firebase Google ID token and returns a JWT token.

Request body:

{
  "idToken": "Firebase ID token from signInWithPopup"
}

Response 200:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "64abc...",
    "name": "Manvendra",
    "email": "user@gmail.com"
  }
}

POST /api/auth/logout

Blacklists the current token. Requires authentication.

Response 200:

{
  "message": "Logged out successfully"
}

File Routes

POST /api/files/upload

Uploads a project ZIP file with a debug prompt. The backend extracts the project and runs the AI agent loop. Returns the AI's debug report.

Requires authentication. Content type must be multipart/form-data.

Form fields:

Field Type Description
file File (.zip) The project ZIP file
prompt String Description of the bug or error

Clone this wiki locally