This project will guide you through the basics right here in the Val Town editor.
β‘οΈ Get Set Up (2 Steps):
- Open Your Code: In the File Tree on the left, click on
backend/index.ts. This is where you'll make changes. - Open Your Tracker: Near the top-right of the editor, click the "Open HTTP endpoint" button. This opens your Live Progress Tracker in a new browser tab. Keep this tab open - you'll refresh it to see your progress!
Ready? Switch back to the backend/index.ts file in this editor window and follow the instructions written in the code comments, starting near the top. Good luck!
(Quick UI Tour: As you work, notice the File Tree (left), Save button (top-right), and Logs pane (bottom). You'll use these!)
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!)