返回 Skill 列表
extension
分类: 开发与工程无需 API Key

context-api-contracts

前端后端API契约、路由、客户端和类型定义。处理API端点定义、请求/响应类型、路由配置和跨栈集成。在处理API端点、请求/响应类型、路由定义或前端后端集成时使用,或者当用户提到API设计、添加端点、类型不匹配、API契约、REST端点、客户端集成、“404 Not Found”错误、“Type error”在API调用中或路由配置问题时。

person作者: jakexiaohubgithub

API Contracts

Navigate frontend-backend API integration, routes, clients, and data flow.

Overview

API contracts define frontend ↔ backend communication. Critical for cross-stack changes.

Backend API Routes

  • backend/api/*.py - API v1 endpoints
  • backend/api/v2/*.py - API v2 endpoints
  • backend/api/analytics_api.py
  • backend/api/brokerage_connections.py
  • backend/api/accounts.py
  • backend/api/securities.py

Frontend API Clients

  • frontend/src/services/analyticsApi.ts
  • frontend/src/services/researchApi.ts
  • frontend/src/lib/apiClient.ts - Base API client

TypeScript Contracts

  • supabase/types/database.types.ts - Database types
  • frontend/src/types/**/*.ts - Frontend types

Backend Middleware

  • backend/middleware/*.py - Auth, CORS, etc.

Tests

  • backend/tests/integration/ - API integration tests
  • frontend/e2e/ - E2E API tests

Documentation

  • Internal: docs/backend/API_CONTRACTS.md (create if needed)

Related Areas

  • See context-clerk-integration for auth middleware
  • See context-testing-infrastructure for API test patterns