This is a submission for the
Test Login
Email: [email protected]
password:12345678
The AI Prompt I Used
Original prompt for my backend
Create a habit tracking backend with accountability features:
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
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
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.)
Security:
- All endpoints require authentication
- Users can only access their own data
- Partners can only see habits marked as public
Use proper indexing and data validation.
How I Refined the AI-Generated Code
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.
My Experience with Xano
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.
SOCIAL SHARE CARD GENERATOR