I built a habit tracker app with Xano

I built a habit tracker app with Xano

Source: Dev.to

What I Built ## Test Login ## The AI Prompt I Used ## Original prompt for my backend ## How I Refined the AI-Generated Code ## My Experience with Xano Xano AI-Powered Backend Challenge: Full-Stack Submission This is a submission for the Xano AI-Powered Backend Challenge: Full-Stack, AI-First Application Habit tracker, the app I built, helps people log their daily routines and track completion. It also allows you to invite an accountability partner to keep you accountable with fulfilling your habits. Live app (via Xano static hosting): https://default-dev-8050f4-xn9g-tt4h-4ei5.n7e.xano.io/ Full code on GitHub: https://github.com/EmmanuelTheCoder/Lite-habit-tracker-xano Email: [email protected] password:12345678 Create a habit tracking backend with accountability features: Use proper indexing and data validation. Didn't really have to do much work because my prompt was very detailed, and luckily, the Co-pilot and the Xanoscript extension knew how to execute it well. All I had to do was refine the user table, and add security.create_auth_token to my login and signup endpoints. I find Xano to be a simple way to build full-stack applications. The fact that it could host my static frontend with just a click of the button on VS Code made it even more interesting for me. I also appreciate that I could set up authentication that easily. As for challenges, I think that not being able to inspect a variable or add a breakpoint to my debugging can be time-consuming for robust applications; thankfully, my application was just something simple so I had less bugs to deal with. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse - Database tables: Users (authentication enabled) Habits (linked to users): name, description, category, frequency, target_days array, is_active, is_public Habit_Logs: habit_id, user_id, log_date (unique together), completed boolean, notes, mood Accountability_Partners: user_id, partner_id, status (pending/accepted) Encouragements: messages between partners Achievements: track user milestones - Users (authentication enabled) - Habits (linked to users): name, description, category, frequency, target_days array, is_active, is_public - Habit_Logs: habit_id, user_id, log_date (unique together), completed boolean, notes, mood - Accountability_Partners: user_id, partner_id, status (pending/accepted) - Encouragements: messages between partners - Achievements: track user milestones - Core API endpoints: Auth: signup, login Habits: CRUD operations, get user's habits Logs: POST /habits/{id}/log (mark complete/incomplete), GET /habits/{id}/logs (history) Stats: GET /habits/{id}/stats (current streak, completion rate, total completions) Dashboard: GET /dashboard (today's habits, overall stats) Partners: send/accept requests, view partner progress Encouragements: send/receive messages - Auth: signup, login - Habits: CRUD operations, get user's habits - Logs: POST /habits/{id}/log (mark complete/incomplete), GET /habits/{id}/logs (history) - Stats: GET /habits/{id}/stats (current streak, completion rate, total completions) - Dashboard: GET /dashboard (today's habits, overall stats) - Partners: send/accept requests, view partner progress - Encouragements: send/receive messages - Business logic: Calculate current streak (consecutive days completed) Calculate completion rate (percentage over time period) Check if habit is due today based on target_days Prevent duplicate logs for same date Auto-award achievements (7-day streak, 30-day streak, etc.) - Calculate current streak (consecutive days completed) - Calculate completion rate (percentage over time period) - Check if habit is due today based on target_days - Prevent duplicate logs for same date - Auto-award achievements (7-day streak, 30-day streak, etc.) - Security: All endpoints require authentication Users can only access their own data Partners can only see habits marked as public - All endpoints require authentication - Users can only access their own data - Partners can only see habits marked as public - Users (authentication enabled) - Habits (linked to users): name, description, category, frequency, target_days array, is_active, is_public - Habit_Logs: habit_id, user_id, log_date (unique together), completed boolean, notes, mood - Accountability_Partners: user_id, partner_id, status (pending/accepted) - Encouragements: messages between partners - Achievements: track user milestones - Auth: signup, login - Habits: CRUD operations, get user's habits - Logs: POST /habits/{id}/log (mark complete/incomplete), GET /habits/{id}/logs (history) - Stats: GET /habits/{id}/stats (current streak, completion rate, total completions) - Dashboard: GET /dashboard (today's habits, overall stats) - Partners: send/accept requests, view partner progress - Encouragements: send/receive messages - Calculate current streak (consecutive days completed) - Calculate completion rate (percentage over time period) - Check if habit is due today based on target_days - Prevent duplicate logs for same date - Auto-award achievements (7-day streak, 30-day streak, etc.) - All endpoints require authentication - Users can only access their own data - Partners can only see habits marked as public