Habits Quest 4 Life is an application built on the Internet Computer (IC) that helps users build good habits through a system of roles, quests, stamina, coins, and inventory. It combines elements of RPG gamification with daily self-improvement.
- Unique user registration with a username.
- Stores user data (coins, stamina, inventory, quests, roles).
- Automatic stamina regeneration at set intervals.
- Default roles:
- Codes
- Sports
- Arts
- Traveler
- Literature
- Each role has its own level & EXP.
- A user can only have one active role at a time and cannot switch roles while a quest is active.
- Users can accept quests if they have sufficient stamina.
- Quests include:
- Stamina cost
- Coin & EXP rewards
- Deadline (4 hours by default)
- Quest statuses:
OnProgress,Completed,Failed. - Quests automatically fail if the deadline is missed.
- Successful quests award coins & EXP to the active role.
- An admin can add Skins to the shop.
- Users can purchase skins with coins.
- Purchased skins are added to the user's inventory.
- Users can set an active skin.
- Role-based leaderboards sorted by EXP.
- A global leaderboard for coins.
- Language: Motoko
- SDK: DFINITY SDK
- State Management:
HashMap,Buffer, and stable variables.
├── src/
│ ├── main.mo # Main actor implementation (system logic)
│ ├── types.mo # Global type definitions
│ └── ...
├── README.md
git clone [https://github.com/](https://github.com/)/habits-quest-4life.git
cd habits-quest-4lifesh -ci "$(curl -fsSL [https://internetcomputer.org/install.sh](https://internetcomputer.org/install.sh))"dfx start --background
dfx deployRegister a user
dfx canister call habits_quest_4life registerUser '("Alice")'View profile
dfx canister call habits_quest_4life getProfileUserAccept a quest
dfx canister call habits_quest_4life acceptQuest '("Study for 30 mins", "Practice DApp coding", 5, 10, 20)'Complete a quest
dfx canister call habits_quest_4life completeQuest '(0)'Buy a skin
dfx canister call habits_quest_4life buySkin '(0)'- Register → Create a unique username.
- Choose a role → Activate one of your favorite roles.
- Accept a quest → Requires stamina; quests have a 4-hour deadline.
- Complete a quest → Earn coins + EXP, which levels up your role.
- Shop for skins → Use your coins to buy items from the shop.
- Manage inventory → Set your active skin.
- Follow the leaderboard → Check your ranking by role or coins.
addSkin→ Adds a new item to the shop.grantCoinByUsername→ Gives coins to a specific user.
This application is designed to turn everyday habits into an exciting adventure. With a system of roles, quests, and leaderboards, users can stay motivated to maintain consistency in their lives.
MIT License © 2025