This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Val Town project. It's a full-stack application with a React frontend and a Hono-based API backend, designed to run on Val Town's Deno serverless platform.
├── backend/
│ ├── controllers/ # Business logic controllers
│ ├── routes/ # Route definitions and HTTP handling
│ │ ├── api/ # API endpoints
│ │ ├── tasks/ # Task-related routes; commonly, Notion webhooks
│ │ ├── views/ # User-facing views
│ │ └── authCheck.ts # Authentication middleware
│ └── services/ # External service integrations
├── frontend/ # React frontend assets
│ ├── index.html # HTML template for glimpse views
│ ├── index.tsx # React entry point
│ ├── components/ # React components
│ │ ├── App.tsx # Main display component
│ │ ├── NotionBlock.tsx # Notion block renderer
│ │ └── NotionProperty.tsx # Property display component
│ └── README.md
├── shared/ # Shared utilities and types
│ ├── types.ts # TypeScript interfaces for Notion data
│ ├── utils.ts # Shared utility functions
│ └── README.md
└── main.http.tsx # Application entry point with static file serving
The application follows a clean MVC architecture with proper separation of concerns:
All controller functions return a consistent structure:
{
success: boolean,
data: any | null,
error: string | null,
details?: string // Additional error context
}
Routes then format these into appropriate HTTP responses.
main.http.tsx is the main HTTP entry point that exports app.fetch for Val Town/apiindex.html: Minimal HTML shell that loads the React appindex.tsx: React app entry pointcomponents/App.tsx: Main app component with state management for email processingAll React components use /** @jsxImportSource https://esm.sh/react@18.2.0 */ and pin React dependencies to version 18.2.0.
Since this is a Val Town project, there are no local build commands. The application runs directly on Val Town when deployed.
Required environment variables are set in Val Town.
TODO: add note about how to access env vars
Uses Val Town's standard utilities for serving project files:
Frontend files are served through Hono:
/frontend/* routes serve frontend assets with proper content types/ route serves the main index.htmlAll React files must:
/** @jsxImportSource https://esm.sh/react@18.2.0 */ at the top?deps=react@18.2.0The API routes use try-catch blocks and return appropriate HTTP status codes (400 for validation errors, 500 for server errors). Consider adding a Hono error handler to unwrap and re-throw errors for better stack traces.
deno.json: Deno configuration with Val Town types, compiler options, and experimental features
AGENTS.md: Comprehensive Val Town development guidelines (keep this file as reference for Val Town best practices)