FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
dinavinter
dinavinterregistry-vals
Remix of dinavinter/registry
Public
Like
registry-vals
Home
Code
6
README.md
config.json
H
file
C
sync
H
zon
H
zons
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
/
Code
/
Search
https://dinavinter--43f22260439911f09b6d76b3cceeab13.web.val.run
README.md

Zon File Management System

A comprehensive file management system for Val Town that handles different file types including HTTP, cron, email, JSON, and more with collaborative editing capabilities.

Features

  • Multi-file type support: HTTP, cron, email, JSON, TypeScript, and more
  • Collaborative editing: Real-time collaboration using YJS with ts-editor component
  • TypeScript editor: Full-featured TypeScript editor with syntax highlighting
  • File type detection: Automatic file type detection and appropriate handling
  • Val Town integration: Direct integration with Val Town API for file management
  • Configurable URLs: All service URLs are configurable via config.json

Project Structure

├── config.json          # Configuration file with URLs and file type definitions
├── zons                 # Main gallery view showing all zons (HTTP)
├── zon                  # Individual zon view with file listings (HTTP)  
├── file                 # File editor interface with TypeScript support (HTTP)
├── sync                 # Background sync service for YJS collaboration (Cron)
└── README.md           # This file

Configuration

The system uses /config.json for configuration:

{ "urls": { "zons": "https://zons.val.run", // Main gallery URL "zon": "https://zon.val.run", // Individual zon view URL "files": "https://svc.val.run" // File editor URL }, "editor": { "yjs": { "room": "@vals", // YJS collaboration room "url": "wss://hp.cfapps.us10-001.hana.ondemand.com" // YJS WebSocket URL } }, "fileTypes": { // File type definitions with icons, colors, templates, etc. } }

File Types Supported

  • HTTP (http) - Web endpoints and APIs
  • Cron (cron) - Scheduled tasks
  • Email (email) - Email handlers
  • JSON (json) - Configuration and data files
  • TypeScript (ts) - General TypeScript files
  • JavaScript (js) - JavaScript files
  • Markdown (md) - Documentation files

Routing

Main Gallery (/zons)

  • GET / - Main gallery showing all zons
  • Displays all available zons with metadata

Zon File Browser (/zon)

  • GET / - Redirects to main gallery
  • GET /{zon-name} - View files in specific zon
  • GET /{zon-name}/files - API endpoint returning JSON list of files
  • Groups files by type and shows file metadata

File Editor (/file)

  • GET / - Redirects to main gallery (configurable)
  • GET /{zon-name}/{file-name} - Edit specific file with ts-editor
  • GET /{zon-name}/{file-name}/raw - Get raw file content as JSON
  • POST /{zon-name}/{file-name} - Save file changes

Background Sync (/sync)

  • Cron job that syncs Val Town files to YJS documents
  • Enables real-time collaborative editing
  • Runs periodically to keep YJS documents up to date

Usage Flow

  1. Browse zons: Visit main gallery to see all available zons
  2. Select zon: Click on a zon to view its files grouped by type
  3. Edit file: Click on a file to open it in the collaborative editor
  4. Save changes: Use the Save button to persist changes back to Val Town
  5. Run HTTP files: Use the Run button to test HTTP endpoints

API Integration

The system integrates with:

  • Val Town API: For reading/writing files and managing zons
  • YJS: For real-time collaborative editing
  • ts-editor: For TypeScript/JavaScript editing with syntax highlighting

Development

  • All URLs are configurable via config.json
  • File types can be extended by adding to the fileTypes configuration
  • Authorization is currently disabled for development (returns true)
  • Error handling includes proper error propagation and user feedback
HTTP
  • file
    dinavinter--43f22260439911f09b6d76b3cceeab13.web.val.run
  • zon
    dinavinter--2f0b5fbafe864187a1f0750f8e887925.web.val.run
  • zons
    dinavinter--67194526770244db9dfa53e98395b07c.web.val.run
Cron
  • sync
Code
README.mdconfig.json
H
file
C
sync
H
zon
H
zons
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.