HagiCode Fullstack

Ajouter une fonctionnalité

Draft: this lesson is an outline and will be expanded.

Your first version works, so now you improve it one step at a time. In this lesson you add one feature that changes what the app stores, such as a “tag” on each bookmark or a “reply” on each guestbook message. A change to what is stored is the one that most often goes wrong, so you will take it slowly.

The rule of the whole course applies: ask for one change, check it, then save a checkpoint.

What you will do

  1. Choose one small feature from your brief, or invent one. Write it in one sentence, including what the reader will see.
  2. Before you ask for it, save a checkpoint so that you can go back.
  3. Tell the AI the feature and add: “The app already has entries saved. Do not lose them, and tell me if this change needs the stored data to be changed.”
  4. Read the AI’s summary. If it says the existing data must be changed or deleted, stop and ask it to explain what will happen to your entries first.
  5. Restart the app with the command from the previous lesson.
  6. Test the feature by using it. Then test an old entry to make sure it still shows up.
  7. If an old entry is damaged or missing, do not continue. Go back to the checkpoint and ask the AI again, this time saying exactly what went wrong.
  8. When both old and new entries work, save a checkpoint with a message that names the feature.

Safety note. If the AI suggests a command that deletes or resets the database, do not run it until you have read it and understood what it removes.

Check yourself

  • The new feature works when you use it.
  • Entries that existed before the change still appear.
  • You saved a checkpoint before and after the change.