Skip to main content

FindU API Architecture

This document describes the current API landscape and provides guidance for future API development.

Current Architecture

FindU currently uses a hybrid approach:

Supabase Direct Access

Both web and iOS apps communicate directly with Supabase for most operations

Matching Algorithm API

Python FastAPI service for ML-powered recommendations

How It Works Today

Future API Vision

As FindU scales, we may benefit from dedicated API layers:

Potential Benefits

Purpose: Dedicated endpoints for school dashboard featuresBenefits:
  • Simplified permissions model
  • Aggregated analytics
  • Batch operations
  • Webhook management
Example Endpoints:
  • GET /partner/analytics
  • POST /partner/messages/bulk
  • GET /partner/students/campaigns

API Design Principles

When building new APIs, follow these principles:

1. RESTful Design

2. Consistent Patterns

Request/Response Format

Error Handling

3. Authentication

All APIs should use Supabase JWT tokens:

4. Versioning Strategy

Implementation Guidance

When to Create an API

Consider creating a dedicated API when:
  1. Performance: Direct Supabase queries become inefficient
  2. Complexity: Business logic is too complex for RLS policies
  3. Integration: External partners need access
  4. Mobile: Need optimized payloads for mobile apps

Technology Choices

Node.js/TypeScript

For web-focused APIs matching our frontend stack

Python FastAPI

For ML/data-heavy operations like matching

Edge Functions

For lightweight, globally distributed endpoints

GraphQL

For complex data relationships and flexible queries

Example API Structure

Documentation Standards

When creating new APIs:
  1. OpenAPI Specification: Define endpoints in OpenAPI 3.0
  2. Examples: Provide request/response examples
  3. SDKs: Generate or create language-specific SDKs
  4. Versioning: Document all versions and changes
  5. Rate Limits: Clearly state limits and quotas

Security Considerations

  • Authentication: Always require valid JWT tokens
  • Authorization: Implement proper permission checks
  • Rate Limiting: Protect against abuse
  • Input Validation: Validate all inputs
  • CORS: Configure appropriately for web clients
  • Monitoring: Log all API access for auditing

Next Steps

Currently, only the Matching Algorithm has a dedicated API: For other features, refer to: