xtablo-source/apps/api
2025-11-13 09:24:23 +01:00
..
docs Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
examples Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
src Big reliability improvement 2025-11-13 09:24:23 +01:00
.gitignore Big reliability improvement 2025-11-13 09:24:23 +01:00
biome.json Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
cloudbuild.yaml Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
Dockerfile Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
package.json Big reliability improvement 2025-11-13 09:24:23 +01:00
README.md Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
tsconfig.json Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
turbo.json Create two packages: api and shared-types 2025-11-10 08:52:47 +01:00
vitest.config.ts Big reliability improvement 2025-11-13 09:24:23 +01:00
VITEST_MIGRATION.md Big reliability improvement 2025-11-13 09:24:23 +01:00

Xtablo API

This is the backend API for Xtablo, built with Hono and TypeScript.

Development

This package is part of the Xtablo monorepo managed with Turborepo and pnpm workspaces.

Prerequisites

  • Node.js >= 20.0.0
  • pnpm 10.x

Available Commands

From the root of the monorepo:

# Start development server
pnpm run dev:api

# Build the API
turbo run build --filter=@xtablo/api

# Run tests
pnpm run test:api

# Type checking
turbo run typecheck --filter=@xtablo/api

# Linting
turbo run lint --filter=@xtablo/api
turbo run lint:fix --filter=@xtablo/api

# Format code
turbo run format --filter=@xtablo/api

From within the apps/api directory:

# Start development server
pnpm dev

# Build
pnpm build

# Start production server
pnpm start

# Run tests
pnpm test
pnpm test:watch

# Linting and formatting
pnpm lint
pnpm lint:fix
pnpm format

Project Structure

apps/api/
├── src/
│   ├── __tests__/     # Test files
│   ├── helpers/       # Helper functions
│   ├── middlewares/   # Hono middlewares
│   ├── routers/       # API route handlers
│   ├── types/         # TypeScript type definitions
│   ├── config.ts      # Configuration
│   ├── index.ts       # Entry point
│   └── secrets.ts     # Secret management
├── dist/              # Compiled output
├── docs/              # API documentation
├── examples/          # Usage examples
├── Dockerfile         # Docker configuration
├── cloudbuild.yaml    # Google Cloud Build config
├── package.json
├── tsconfig.json
└── turbo.json         # Turborepo config

Environment Variables

See .env.example for required environment variables.

Deployment

The API is deployed to Google Cloud Run. See cloudbuild.yaml for deployment configuration.