• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
lightweight

lightweight

scaffold

Unlisted
Like
scaffold
Home
Code
10
backend
4
frontend
4
shared
3
.vtignore
AGENTS.md
CLAUDE.md
README.md
deno.json
guidelines.md
main.http.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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
/
backend
/
README.md
Code
/
backend
/
README.md
Search
10/27/2025
Viewing readonly version of main branch: v60
View latest version
README.md

Backend

This directory contains the backend logic for the Notion webhook integration application.

Structure

  • controllers/ - Business logic and orchestration

    • Contains functions that validate data, orchestrate service calls, and return standardized responses
    • All controllers return {success, data, error, details?} format
    • Controllers are HTTP-agnostic (don't create HTTP responses)
  • routes/ - HTTP request/response handling

    • api/ - RESTful API endpoints for data operations
    • tasks/ - Notion webhook handlers
    • views/ - User-facing HTML/React views
    • authCheck.ts - Authentication middleware
  • services/ - External API integrations

    • Handle calls to external APIs (Notion, Firecrawler, blob storage, etc.)
    • Return structured results with {success, data, error} format
    • Manage API authentication and error handling

Architecture Flow

Request → Route → Controller → Service → External API

Never skip layers!

  • Routes call controllers (not services directly)
  • Controllers call services (not external APIs directly)
  • Services handle external API calls

Adding New Features

  1. Create route in appropriate directory (api/, tasks/, or views/)
  2. Create controller function with business logic
  3. Create/use service functions for external API calls
  4. Mount route in main.http.tsx

See CLAUDE.md for detailed guidelines.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.