FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
wolf
wolfiClickWolf
Starter template with client-side React & Hono server
Public
Like
iClickWolf
Home
Code
7
.vscode
1
backend
3
frontend
3
.cursorrules
.vtignore
README.md
deno.json
Branches
1
Pull requests
Remixes
History
Environment variables
3
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
5/7/2025
Viewing readonly version of main branch: v172
View latest version
README.md

iClickWolf - Val Town Edition

This app is a port of the iClickWolf Next.js application to Val Town, using SQLite for database storage.

Project Structure

  • Backend: /backend/index.ts - The main HTTP server that serves the frontend and API endpoints

    • /backend/database/ - Contains SQLite database setup and queries
    • /backend/routes/ - API routes for checkout, webhook, and items
  • Frontend: /frontend/index.html - The main HTML entry point

    • /frontend/index.tsx - The React entry point
    • /frontend/components/ - React components for the application

Features

  • iClicker preordering system
  • Stripe integration for payments
  • Email notifications for order confirmations
  • SQLite database for storing items and preorders

Environment Variables

The following environment variables are required:

  • STRIPE_SECRET - Stripe API secret key
  • STRIPE_PUBLIC - Stripe publishable key (for frontend)
  • STRIPE_WEBHOOK_SECRET - Secret for verifying Stripe webhook events
  • VAL_EMAIL_KEY - API key for the email sending service

Error Handling

The application includes robust error handling:

  • If Stripe is not configured (missing API keys), appropriate error messages are shown
  • If the database fails to load items, default values are used as a fallback
  • All API errors are properly logged and user-friendly messages are displayed
  • Form validation prevents submission of invalid data

Database

The application uses Val Town's SQLite database with the following tables:

  • iclickwolf_items_v1 - Stores product information
  • iclickwolf_preorders_v1 - Stores customer preorder information

API Endpoints

  • POST /api/checkout - Creates a Stripe checkout session and preorder
  • POST /api/webhook - Handles Stripe webhook events
  • GET /api/items - Returns the first item (iClicker)
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.