Step 9 of 1182% complete

Customize Your App

Estimated time: 10 minutes

Customize Your App

Learning Objectives

By the end of this step, you'll:

  • Understand how to customize the message format
  • Know how to add new attributes
  • Be able to modify the UI
  • Have ideas for extending the app

Content

What Can You Customize?

Now that you understand the basics, you can customize:

  • Message format: Add more fields (author, tags, etc.)
  • Attributes: Add custom attributes for filtering
  • UI/UX: Change the design, add features
  • Functionality: Add editing, deletion markers, reactions, etc.

Ideas for Customization

  • Add user names or avatars
  • Add message categories or tags
  • Add timestamps in different formats
  • Add a character counter
  • Add message editing (via new entities)
  • Add reactions or likes
  • Add search functionality
  • Add pagination
  • Change the color scheme
  • Add dark mode
I'm at step 9: Customize Your App.

Help me:
1. Add a new field to messages (like "author" or "category")
2. Update the entity creation to include the new field
3. Update the UI to display the new field
4. Update queries if needed

Provide code examples and explain the changes.

Update the internal implementation plan with notes and show me the plan so I can track your progress.

✓ Checkpoint

Troubleshooting

Q: My new field doesn't appear. A: Make sure you've updated both the API (to store it) and the frontend (to display it). Also, check that you're reading it from the payload or attributes correctly.

Q: How do I query by my new attribute? A: Add a .where(eq('yourAttribute', value)) clause to your query. Make sure you're storing it as an attribute, not just in the payload.

Q: Can I change the message format for existing messages? A: No, existing entities can't be modified. But new messages will use the new format. You can handle both formats in your code for backward compatibility.

Q: How do I add validation? A: Add validation in the API route before creating the entity. Return an error response if validation fails.

Q: Can I add images or files? A: Yes! You can store binary data in the payload. For large files, consider storing a hash on-chain and the file on IPFS or similar.