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

lightweight

scaffold

Unlisted
Like
scaffold
Home
Code
6
backend
4
frontend
3
shared
2
deno.json
guidelines.md
main.ts
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
/
shared
/
README.md
Code
/
shared
/
README.md
Search
10/27/2025
Viewing readonly version of main branch: v24
View latest version
README.md

Shared

This directory contains code shared between frontend (browser) and backend (Deno).

Files

  • types.ts - TypeScript interfaces and types

    • Controller response format
    • Notion data structures
    • API request/response types
  • utils.ts - Utility functions

    • Must work in both browser AND Deno
    • ❌ NEVER use Deno APIs (won't work in browser)
    • ✅ Only use standard JavaScript/TypeScript

Guidelines

Adding Types

  • Define interfaces for data shared between layers
  • Use clear, descriptive names (PascalCase)
  • Document complex types with comments

Adding Utils

  • Test that functions work in both environments
  • Avoid platform-specific APIs (Deno, Node, browser-only)
  • Use pure functions when possible

Example

// ✅ Good - works everywhere export function formatDate(date: string): string { return new Date(date).toLocaleDateString(); } // ❌ Bad - Deno-specific export function readConfig() { return Deno.env.get('CONFIG'); // Won't work in browser! }
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.