This app is a starter template for client-side React and server-side Hono.
-
Remix this starter template on the top right to get started.
-
The entrypoint is
/backend/index.ts. That's the backend HTTP server, which also serves the all the frontend assets. -
The client-side entrypoint is
/frontend/index.html, which in turn imports/frontend/index.tsx, which in turn imports the React app from/frontend/components/App.tsx.
React Hono Example is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.
Let's learn Val Town by doing, right here in the editor.
β‘οΈ Get Started:
- Make sure you can see the Editor Pane (where this text is).
- Make sure you can see the Preview Pane on the right.
- (If you don't see it, click the "HTTP" tab above the editor).
- The Preview Pane shows your Live App and Progress Tracker. You'll interact with it directly!
Keep this README.md open for guidance.
Step 1: Launch Live Preview π (Already Done!)
- How: You're looking at the Preview Pane! It's live code served by
backend/index.ts. - Concept: Instant deployment, zero config.
- See: "Step 1" is checked in the Preview Pane.
Step 2: Edit & See Live Changes βοΈ
- In the Editor, open
backend/index.ts(use the File Tree on the left). - Find
const GREETING = ...near the top. - ACTION: Change the text inside the quotes.
- ACTION: Click the green Save button (top-right of editor).
- ACTION: Click the Refresh button (π) inside the Preview Pane.
- See: The "Greeting" in the Preview Pane updates, and "Step 2" gets checked!
- Concept: Edit β Save β Refresh Preview = Instant Updates.
Step 3: Save Data (Blob Storage) πΎ
- In
backend/index.ts, findconst enableBlobCounter = false;. - ACTION: Change
falsetotrue. - ACTION: Click Save.
- ACTION: Refresh the Preview Pane twice.
- See: A "Visits" counter appears and increments in the Preview Pane. Step 3 is checked.
- Editor UI Tip: Need to debug? Add
console.log("...")in your code, Save, refresh the Preview Pane, then check the Logs pane at the bottom of the editor. - Concept:
std/blob= Easy data persistence.
Step 4: Send an Email βοΈ
- In
backend/index.ts, findenableTestEmail = false;. - ACTION: Change
falsetotrue. - ACTION: Click Save.
- ACTION: Refresh the Preview Pane.
- See: "Step 4" checked in the Preview Pane. Check your Val Town account email!
- Concept:
std/email= Easy email notifications.
Step 5: Learn About Automation (Cron) β°
- ACTION: In the Preview Pane, find and click the "Learn Cron" button.
- See: Step 5 gets checked in the Preview Pane, and the official Cron guide opens in a new tab (perfect for deeper learning later).
- Concept: Use Cron Vals (created via the "+" button near your profile pic) to run code on a schedule.
Next Steps & UI Tour β¨
You've covered the core magic! Keep exploring:
- Secrets: Use Environment Variables (left sidebar) for API keys. Access with
Deno.env.get("..."). - Collaboration: Like (β€οΈ), Remix, and Comment on vals.
- βοΈ Settings: Control privacy, permissions, etc.
Modify this project, or click "+" (top-right) > Val to create something new!
(More steps can be added later!)