Documentation
Documentation
Introduction

Getting Started

Getting StartedInstallationQuick StartProject Structure

Architecture

Architecture OverviewTech StacktRPC MiddlewareDesign Principles

Patterns

Code Patterns & ConventionsFeature ModulesError HandlingType Safety

Database

DatabaseSchema DefinitionDatabase OperationsMigrationsCaching

API

tRPCProceduresRouterstRPC Proxy Setup
APIsOpenAPIREST Endpoints

Auth & Access

AuthenticationConfigurationOAuth ProvidersRolesSession Management
AuthorizationUser RolesPermissions

Routing & i18n

RoutingDeclarative RoutingNavigation
InternationalizationTranslationsLocale Routing

Components & UI

ComponentsButtonsFormsNavigationDialogs
StylesTailwind CSSThemingTypography

Storage

StorageConfigurationUsageBuckets

Configuration

ConfigurationEnvironment VariablesFeature Flags

Templates

Template GuidesCreate New FeatureCreate New PageCreate Database TableCreate tRPC RouterAdd Translations

Development

DevelopmentCommandsAI AgentsBest Practices

REST Endpoints

Using REST API endpoints

Overview

REST endpoints are automatically generated from tRPC procedures with OpenAPI metadata enabled. This allows external clients to consume your API using standard HTTP requests.

Accessing Endpoints

All OpenAPI-enabled procedures are available at /api/<path> where <path> is defined in the procedure's metadata.

Base URL

https://your-app.com/api

Example Endpoints

EndpointMethodDescription
/api/api-keysGETList API keys
/api/api-keysPOSTCreate API key
/api/healthGETHealth check

Authentication

Protected endpoints require authentication via Bearer token in the Authorization header.

Getting a Token

Users can generate API keys through the dashboard at /dashboard/api-keys.

Using Bearer Token

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://your-app.com/api/api-keys

Public Endpoints

Some endpoints may be public (no authentication required):

curl https://your-app.com/api/health

Request Examples

GET Request

# List resources
curl -X GET \
  -H "Authorization: Bearer YOUR_API_KEY" \
  https://your-app.com/api/api-keys

POST Request

# Create resource
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My API Key"}' \
  https://your-app.com/api/api-keys

Query Parameters

For GET requests with search params:

curl -X GET \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://your-app.com/api/search?q=hello&page=1"

Response Format

All endpoints return JSON in the ActionResponse format:

Success Response

{
  "success": true,
  "message": "Saved successfully",
  "payload": {
    "id": "123",
    "name": "My Resource"
  }
}

Error Response

{
  "success": false,
  "message": "Invalid input"
}

HTTP Status Codes

StatusDescriptionWhen Used
200OKSuccessful request
201CreatedResource created
400Bad RequestInvalid input
401UnauthorizedMissing/invalid token
403ForbiddenInsufficient permissions
404Not FoundResource not found
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error

Rate Limiting

All endpoints are rate-limited based on their configuration. When rate limit is exceeded:

{
  "success": false,
  "message": "Too many requests. Try again in 60 seconds."
}

Rate limits are configured per procedure in the tRPC metadata. See Procedures for details.

JavaScript/TypeScript Client

Using fetch

const response = await fetch("https://your-app.com/api/api-keys", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
  },
});

const data = await response.json();

if (data.success) {
  console.log(data.payload);
} else {
  console.error(data.message);
}

Creating a Resource

const response = await fetch("https://your-app.com/api/api-keys", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "My API Key",
  }),
});

const data = await response.json();

Python Client

import requests

# GET request
response = requests.get(
    "https://your-app.com/api/api-keys",
    headers={"Authorization": f"Bearer {api_key}"}
)

data = response.json()

if data["success"]:
    print(data["payload"])
else:
    print(data["message"])

# POST request
response = requests.post(
    "https://your-app.com/api/api-keys",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    },
    json={"name": "My API Key"}
)

OpenAPI Documentation

The full OpenAPI specification is available at:

GET /api/openapi.json

This can be imported into tools like Postman, Insomnia, or Swagger UI.

Next Steps

OpenAPI Configuration

tRPC Procedures

API Keys Feature

On this page

Overview
Accessing Endpoints
Base URL
Example Endpoints
Authentication
Getting a Token
Using Bearer Token
Public Endpoints
Request Examples
GET Request
POST Request
Query Parameters
Response Format
Success Response
Error Response
HTTP Status Codes
Rate Limiting
JavaScript/TypeScript Client
Using fetch
Creating a Resource
Python Client
OpenAPI Documentation
Next Steps