Stuck? You're in the right place.
This sandbox teaches AI-assisted development by building a real expense tracker. Here's the flow:
Time estimate: 2-3 hours for all challenges
Try these in order:
/hints/ folder for your challenge/prompts/ into your AI assistantConsole shows: "Access blocked by CORS policy"
You're opening index.html directly as a file instead of through a local server.
Use a local server:
python -m http.server 8000npx http-serverInsert/select returns { data: null, error: null } β no error but no data either!
Row Level Security is enabled but policies don't allow the operation.
expenses tableschema.sqlConsole shows: "supabaseConfig is not defined"
You haven't created your config.js file yet.
config.example.js in the project folderconfig.jsconfig.js in your code editorYOUR_SUPABASE_PROJECT_URL with your actual URLYOUR_SUPABASE_ANON_KEY with your actual keyNote: config.js is gitignoredβit stays on your computer only and won't be pushed to GitHub.
Dates show as 2024-01-15T08:00:00.000Z instead of "Jan 15, 2024"
The database returns dates in ISO format. You need to format them.
function formatDate(isoDate) {
const date = new Date(isoDate + 'T00:00:00');
return date.toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric'
});
}
When you submit the form, the page reloads and data may or may not save.
Default form behavior is to submit and reload. You need to prevent this.
Add event.preventDefault() as the first line in your submit handler:
form.addEventListener('submit', function(event) {
event.preventDefault();
// Handle form data with JavaScript
});
supabase is not defined or supabase.from is not a function
The Supabase library isn't loaded, or scripts are in wrong order.
Ensure scripts load in this order in your HTML:
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="config.js"></script>
<script src="app.js"></script>
And initialize with window.supabase.createClient()
You pushed to GitHub, Vercel says "deployed", but site shows old content.
When asking for help, give your AI assistant:
Check the /prompts/ folder for ready-made rescue prompts you can copy-paste!
Read CONSTITUTION.md for the full best practices guide.