An app the AI builds for you keeps its data on your device. If you clear the browser data or change devices, the data is gone.
The easy fix: tell the AI in the prompt to add backup and restore buttons from the start. It is just Gemini on the web (free). I do not write a single line of code.
Try the finished appThe code the AI wrote (full file)


What this app can do
- Counts calories for Thai food: set a daily goal, pick a meal, tap a food to add it
- A "Backup" button downloads your data as a file to keep
- A "Restore" button loads that file back in and all the data returns
There are only 3 things to do
- Open gemini.google.com, press the + button and choose Canvas
- Copy the prompt below (it already has the backup and restore line), paste it and send it. Wait about 1 minute
- Press Preview and it is ready to use
- Keep the backup file yourself. The file stays on your device and is not uploaded to any server
The calorie numbers in the clip and in the app are sample data. AI can write wrong code. Try backup and restore with a few small entries first before you rely on it.
The prompt
Please build a daily food calorie counter app, as a single-file web page that works on iPhone. - Set a daily calorie goal (default 1,800) and show a big progress ring with how many calories I have eaten and how many are left - A list of 12 sample Thai foods with calories, such as khao man gai, pad kra pao, som tam, tom yum goong, and banana - Tap a food to add it to a meal. I can choose breakfast, lunch, dinner or snack - I can add my own food by typing a name and its calories - If I go over the goal, the ring turns orange and shows a warning message - I can delete an entry I added by mistake, and the data is saved on the device so it is still there after closing and reopening - Thai language, large text, easy to read, soft colors - A "Backup" button that downloads the food list and the goal as a file, and a "Restore" button that loads that file back into the app