Hello Hive Community Members ππ,
Todayβs update is all about Distriator β our cashback-powered Hive dApp! With Distriator, you spend Hive Dollars πͺ at a whitelisted business β open the app β claim instant cashback πΈ. Easy, right? Well... not always π . Let's dive into the dev updates!
π€― Problem Statement
- Feedback from @starkerz: "Claiming takes too long!"
- Current flow = app checks consumer Hive account history, business Hive account history, verifies posts, post details, and THEN rewards cashback.
- All that blockchain detective work π slows down the process... leaving users hanging like "ummm... π".
π΅οΈββοΈ Let's Break It Down
- When a user launches the app, it loads ALL businesses.
- This alone pulls 3-4 MB of data π±.
- Naturally, that slows things down β.
- So, step 1 β make business-loading much, much faster.
ποΈ Caching to the Rescue
- Tried pagination π β¦ but it turned out just as slow. β
- New idea: Cache data locally!
- Instead of downloading everything again and again, store it in the app. Refresh only when needed.
- But then came the million-dollar question π: "How do we keep cache in sync with the server?"
π Data Sync Like a Pro
Solution: We added 3 magical attributes to the database πͺ
- ποΈ
isDeleted
β easily detect deleted records. - βοΈ
modifiedAt
β track updates smoothly. - π±
createdAt
β spot new entries instantly.
π» MongoDB Query Superpowers
- New query: fetch only businesses modified after a specific date.
- This avoids breaking production logic π .
- Added an extra function for the data-sync capability.
π Screenshot of query:
π― New API Route /modified-after
- A safe new API route introduced β
/modified-after
. - Pass the
date-time-stamp
in ISO8601 format π . - Response: only the modified records after that date. Perfect for sync! β‘
π Documentation Love π
Because devs love docs πβ we updated API documentation too!
Anyone can now implement the sync system easily.
π What's Next
- Backend β done!
- Next β integrate this shiny new API into frontend / web-app π¨.
- Once live β business loading = super-fast speed boost π¨.
- Stay tuned for the React.js integration post coming soon!
Thank you for tuning in to my Hive dev log ππ.
π The Hive Hype Never Stops π
- π Keep Shopping & keep claiming with Distriator
- π Huge love to Hive fam π
- π Hive blockchain = ππ β¦ to the moon, Mars & beyond! β¨
π₯ Until the next dev log β Keep building, keep Hiving ππ
π Final Note
- I asked ChatGPT/AI to help optimize this post to make it more readable and viewer-friendly.
- Here is the link where you can find both original content & improvements made by AI
- I'm supposed to add public link here
π My Contributions to β¦οΈ Hive Ecosystem
Contribution | To | Hive | Ecosystem |
---|---|---|---|
Hive Witness Node | Hive API Node (in progress) | 3Speak Video Encoder Node Operator (highest number of nodes) | 3Speak Mobile App Developer |
3Speak Podcast App Developer | 3Speak Shorts App Developer | 3Speak Support & Maintenance Team | Distriator Developer |
CheckinWithXYZ | Hive Inbox | HiFind | Hive Donate App |
Contributed to HiveAuth Mobile App | Ecency β 3Speak Integration | Ecency β InLeo Integration | Ecency β Actifit Integration |
Hive Stats App | Vote for Witness App | HiveFlutterKit | New 3Speak App |
π Support Back
β€οΈ Appreciate my work? Consider supporting @threespeak & @sagarkothari88! β€οΈ
Vote | For | Witness |
---|---|---|
sagarkothari88 | @sagarkothari88 | |
threespeak | @threespeak |