Skip to content

Feat/quest api & quest completion/claim reward working on write post page.#21

Merged
Driedoutjerky merged 11 commits into
mainfrom
feat/questAPI
Jun 7, 2026
Merged

Feat/quest api & quest completion/claim reward working on write post page.#21
Driedoutjerky merged 11 commits into
mainfrom
feat/questAPI

Conversation

@Driedoutjerky

Copy link
Copy Markdown
Owner

Summary

  • Adds mock quest API using local storage
  • Adds mock user API using local storage for Will balance
  • Adds useQuests hook to manage quest state and reward claiming
  • Adds useCurrentUser hook to load and refresh current user state
  • Connects WritePostPage with quest completion logic after post creation
  • Adds Today’s Quests section to WritePostPage
  • Adds Current Will display to WritePostPage
  • Adds quest reward claiming flow from WritePostPage

Notes

  • Used frontend mock data only.
  • Local storage is used temporarily until backend endpoints are connected.
  • Authentication is intentionally not included yet.
  • The image quest cannot be completed yet because Attach an image is still a placeholder.
  • Quest completion currently happens when a newly written post matches the quest requirements.
  • Quest reward claiming updates the mock user’s will_balance.

Testing

Tested locally with:

npm run dev

Also, in Devtool, clear out local storage as below.

localStorage.removeItem("memory_egg_posts");
localStorage.removeItem("memory_egg_quests");
localStorage.removeItem("memory_egg_user");

Expected Output

1. Current Will appears in /write

  • Go to /write.
  • In the side panel, Current Will should appear.
  • Initial value should be 0.
image

2. Today’s Quests appear in /write

  • Go to /write.
  • The side panel should show Today’s Quests.
  • Initial quest statuses should be in the state assigned.
image

3. Complete Study quest by writing a Study post

  • In /write, create a post with:
Title: Study test
Tag: Study
Content: I studied React hooks today.
Visibility: any option
  • Then, press Post. You should be redirected to /archive.
  • Go back to /write.
  • "Write a Study Memory" quest status should become completed.
  • Claim +10 button should be appeared.
image

4. Claim Study quest reward

  • Click Claim +10 on the completed Study quest.
  • Current Will in Memory Stats should increase from 0 to 10.
  • Study quest status should become claimed.
  • Claim button should disappear.
image

5. Try accomplishing the A Small Reflection quest.

Demo

@Driedoutjerky Driedoutjerky self-assigned this May 30, 2026
@Driedoutjerky Driedoutjerky added type: api REST API endpoint task priority: must labels May 30, 2026
@Driedoutjerky Driedoutjerky merged commit 247f727 into main Jun 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: must type: api REST API endpoint task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant