• Townie
    AI
  • Blog
  • Docs
  • Pricing
Log inSign up
project logo

lightweight

findings-base

Connect Notion and val.town, including user and webhook auth
Public
Like
findings-base
Home
Code
8
_townie
4
backend
7
frontend
1
shared
1
.vtignore
README.md
deno.json
H
main.tsx
Branches
2
Pull requests
Remixes
1
History
Environment variables
6
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
8/14/2025
Viewing readonly version of main branch: v145
View latest version
README.md

Findings Val

A Val Town application for managing findings, transcripts, questions, and reports with Notion integration.

Architecture

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

Project Structure

├── 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

Environment Variables

  • NOTION_API_KEY - Notion integration API key
  • NOTION_WEBHOOK_SECRET - Webhook authentication secret
  • FINDINGS_TRANSCRIPTS_DB_ID - Transcripts database ID
  • FINDINGS_QUESTIONS_DB_ID - Questions database ID
  • FINDINGS_REPORTS_DB_ID - Reports database ID

Authentication

This Val uses a dual authentication system:

User Authentication (LastLogin)

  • 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 Authentication

  • Webhook routes: /tasks/* endpoints require X-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

API Endpoints

  • 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)
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.