This project guides you through Val Town basics using the editor and a live tracker.
β‘οΈ Get Set Up (2 Steps):
- Open Code: In the File Tree (left), click
backend/index.ts. - Open Tracker: Click the "Open HTTP endpoint" button (top-right). This opens your Live Progress Tracker in a new browser tab. Keep this tab open!
Ready? Switch back to backend/index.ts in this window and follow instructions in the code comments, starting near the top. Refresh the Tracker tab often!
(Quick UI Tour: Notice the File Tree, Save button, Logs pane.)
π Quick Jumps (Optional):
Want to learn about a specific feature? Find the corresponding comment block in backend/index.ts:
- Editing & Live Preview: Find
// STEP 2 - Saving Data (Blob Storage): Find
// STEP 3 - Sending Email: Find
// STEP 4 - Scheduled Tasks (Cron): Find
// STEP 5(Action is in the Tracker Tab)
(Follow the steps below if starting from the beginning)
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!)