Public
Like
findings-base
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v147View latest version
A Val Town application for managing findings, transcripts, questions, and reports with Notion integration.
This Val follows a strict layered architecture:
- Services (
/backend/services/
): Pure API calls to external systems - Controllers (
/backend/controllers/
): Business logic and orchestration - Routes (
/backend/routes/
): HTTP request/response handling
├── main.tsx # Main Hono app entry point
├── backend/
│ ├── routes/ # HTTP route handlers
│ │ ├── api/ # JSON API endpoints
│ │ ├── tasks/ # Webhook handlers
│ │ └── views/ # Server-side rendered views
│ ├── services/ # External API integrations
│ ├── controllers/ # Business logic coordination
│ ├── crons/ # Scheduled task handlers
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Common utility functions
├── frontend/ # Client-side files
└── shared/ # Files used by both backend and frontend
NOTION_API_KEY
- Notion integration API keyNOTION_WEBHOOK_SECRET
- Webhook authentication secretFINDINGS_TRANSCRIPTS_DB_ID
- Transcripts database IDFINDINGS_QUESTIONS_DB_ID
- Questions database IDFINDINGS_REPORTS_DB_ID
- Reports database ID
This Val uses a dual authentication system:
- Public routes:
/api/health
and other whitelisted endpoints - Protected routes: Dashboard and other authenticated areas
- Login: Automatic redirect to Google OAuth via LastLogin
- Logout: Available at
/auth/logout
(handled by LastLogin)
- Webhook routes:
/tasks/*
endpoints requireX-API-KEY
header - Authentication: Uses
NOTION_WEBHOOK_SECRET
environment variable - Security: Constant-time comparison to prevent timing attacks
- Separation: Webhook auth is completely separate from user auth
GET /
- Dashboard (requires user authentication)GET /api/health
- Health check endpoint (public)GET /auth/logout
- Logout (handled by LastLogin)GET /tasks/debug-webhook
- Webhook configuration debug (requires webhook auth)POST /tasks/test
- Webhook authentication test (requires webhook auth)POST /tasks/notion-webhook
- Main Notion webhook endpoint (requires webhook auth)