Skip to content

jas12481/tinyassets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ RWA Tycoon - Gamified Real-World Asset Learning for Kids: https://tinyassets.vercel.app/

Learn about real-world assets through fun, interactive gameplay!
Property, Solar Farms, and Gold โ€” discover how they work without any real money or risk.


โœจ What is RWA Tycoon?

RWA Tycoon is an educational game that teaches kids about real-world assets (RWAs) through an engaging, Duolingo/Pokรฉmon-style experience. Kids learn by playing: making investment decisions, experiencing market events, earning XP and badges, and watching their portfolio growโ€”all in a safe, educational environment.

๐ŸŽฏ Key Features

  • ๐Ÿ  Three Asset Types: Property, Solar Farms, and Gold
  • ๐ŸŽฒ Daily Gameplay Loop: Morning indicators โ†’ Midday decisions โ†’ Evening results โ†’ Night missions
  • ๐Ÿ† Gamification: XP system, levels, tokens, badges, and daily missions
  • ๐ŸŽ‰ Win Conditions: Reach Level 5, earn 100 tokens, or achieve 100% ownership
  • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Parent Dashboard: Parents can view their child's progress using a unique parent code
  • ๐Ÿ“š Educational Events: Real-world scenarios (heatwaves, economic changes, crises) affect assets differently

๐ŸŽฎ How It Works

Daily Cycle

  1. ๐ŸŒ… Morning Phase - View market indicators for the day
  2. ๐ŸŒž Midday Phase - Make investment decisions (buy, sell, or hold shares)
  3. ๐ŸŒ† Evening Phase - See results: production earnings and events
  4. ๐ŸŒ™ Night Phase - Complete missions, claim rewards, and view progress

Learning Mechanics

  • Tokens: Earned through asset production and lost/gained during events
  • XP & Levels: Gain experience points by playing daily and completing missions
  • Badges: Unlock achievements as you reach milestones
  • Share-Based Ownership: Buy 1-4 shares per asset (up to 100% ownership)
  • Event System: Real-world events affect different assets in meaningful ways

๐Ÿ› ๏ธ Tech Stack

  • Frontend Framework: Next.js 14 (App Router + Pages Router)
  • UI Library: React 18
  • Styling: Tailwind CSS 3.4
  • Database: Supabase (PostgreSQL)
  • Backend: Next.js API Routes
  • State Management: React Hooks (useState, useEffect)
  • Client Storage: localStorage for user session

๐Ÿ“ Project Structure

tinyassets/
โ”œโ”€โ”€ app/                      # Next.js App Router
โ”‚   โ”œโ”€โ”€ kid/                  # Kid's game interface
โ”‚   โ”‚   โ”œโ”€โ”€ game/             # Main game page (phases, gameplay)
โ”‚   โ”‚   โ”œโ”€โ”€ asset-choice/     # Asset selection screen
โ”‚   โ”‚   โ””โ”€โ”€ asset-detail/     # Individual asset details
โ”‚   โ””โ”€โ”€ layout.js             # Root layout
โ”‚
โ”œโ”€โ”€ pages/                    # Next.js Pages Router
โ”‚   โ”œโ”€โ”€ api/                  # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ game/             # Game logic APIs (buy/sell, execute day, etc.)
โ”‚   โ”‚   โ”œโ”€โ”€ kid/              # Kid-specific APIs (setup, parent code)
โ”‚   โ”‚   โ”œโ”€โ”€ parent/           # Parent dashboard APIs
โ”‚   โ”‚   โ””โ”€โ”€ ai/               # AI assistant integration
โ”‚   โ””โ”€โ”€ parent.js             # Parent dashboard page
โ”‚
โ”œโ”€โ”€ lib/                      # Shared utilities
โ”‚   โ”œโ”€โ”€ gameAPI.js            # Client-side API helpers
โ”‚   โ”œโ”€โ”€ db-helpers.js         # Database operations
โ”‚   โ”œโ”€โ”€ gameEngine.js         # Game logic
โ”‚   โ”œโ”€โ”€ gameRules.js          # Rules and calculations
โ”‚   โ”œโ”€โ”€ badges.js             # Badge system
โ”‚   โ”œโ”€โ”€ missions.js           # Mission system
โ”‚   โ””โ”€โ”€ mockAssets.js         # Asset definitions
โ”‚
โ”œโ”€โ”€ components/               # React components
โ”‚   โ””โ”€โ”€ TutorialFlow.js       # First-time tutorial
โ”‚
โ””โ”€โ”€ backend/                  # Backend services & schema
    โ”œโ”€โ”€ schema.sql            # Database schema
    โ”œโ”€โ”€ rules-engine.js       # Core game rules
    โ””โ”€โ”€ src/                  # Backend service structure

๐ŸŽฏ Core Gameplay Features

Asset System

  • Property ๐Ÿ : Earns daily tokens through rental income
  • Solar Farms โ˜€๏ธ: High production, affected by environmental events
  • Gold ๐Ÿช™: Protects during crisis events (no daily income, but valuable during downturns)

Progression System

  • XP Rewards: Earn XP by completing daily cycles, missions, and events
  • Level Up: Unlock new features and missions as you level up
  • Token Management: Balance spending on assets vs. saving for goals

Mission System

  • Daily Missions: New challenges each day (Level 2+)
  • Achievement Missions: Long-term goals (own all assets, reach milestones)
  • Mission Rewards: Earn XP for completing missions

Win Conditions

Players can win by achieving any of:

  1. Level 5 - Reach level 5 through XP progression
  2. 100 Tokens - Accumulate 100 tokens
  3. 100% Ownership - Own 4 shares of each asset (12 total shares)

๐ŸŽจ User Experience

Kid's Interface

  • Bright, Kid-Friendly Design: Colorful gradients, playful animations
  • Phase-Based Backgrounds: Each time of day has its own theme color
  • Intuitive Navigation: Clear buttons and visual feedback
  • Parent Code Display: Always visible on login screen for easy sharing

Parent Dashboard

  • Progress Overview: See child's level, XP, tokens, and portfolio
  • Learning Summary: View badges earned, events experienced, missions completed
  • Secure Access: Login with parent code to view child's progress

๐Ÿ” Security & Privacy

  • โœ… No Real Money: Completely educational, no financial transactions
  • โœ… No Wallets: No blockchain or crypto wallet required
  • โœ… Parent Code System: Secure access for parents to view progress
  • โœ… Local Storage: User sessions stored client-side
  • โœ… Read-Only Parent View: Parents can view but not modify game state

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account (for database)

Installation

# Clone the repository
git clone <repo-url>
cd tinyassets

# Install dependencies
npm install

# Set up environment variables
# Create .env.local with:
# NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
# SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# Run database migrations (see backend/schema.sql)

# Start development server
npm run dev

Visit http://localhost:3000 to start playing!


๐Ÿ“Š Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Kid Interface (Next.js App Router)         โ”‚
โ”‚  - Morning/Midday/Evening/Night phases      โ”‚
โ”‚  - Asset management UI                      โ”‚
โ”‚  - Mission & badge displays                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Game API (Next.js API Routes)              โ”‚
โ”‚  - /api/game/buy-asset                      โ”‚
โ”‚  - /api/game/sell-asset                     โ”‚
โ”‚  - /api/game/execute-day                    โ”‚
โ”‚  - /api/game/missions                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Rules Engine (lib/)                        โ”‚
โ”‚  - Game logic & calculations                โ”‚
โ”‚  - Event processing                         โ”‚
โ”‚  - XP & badge unlocks                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Supabase (PostgreSQL)                      โ”‚
โ”‚  - game_state                               โ”‚
โ”‚  - user_assets                              โ”‚
โ”‚  - missions, badges, events                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Parent Dashboard (Read-Only View)          โ”‚
โ”‚  - Progress tracking                        โ”‚
โ”‚  - Learning analytics                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽ“ Educational Goals

RWA Tycoon teaches kids about:

  • Real-World Assets: What they are and how they work
  • Investment Concepts: Shares, ownership, diversification
  • Market Events: How external factors affect asset performance
  • Decision Making: Weighing options and seeing consequences
  • Long-Term Planning: Saving vs. spending, goal setting
  • Risk Management: Different assets behave differently in crises

๐ŸŒŸ Future Enhancements

Potential features for future versions:

  • Additional asset types (stocks, bonds, commodities)
  • Multiplayer/leaderboard features
  • More complex event scenarios
  • Educational content library
  • Advanced analytics for parents
  • Mobile app version

๐Ÿ“ License

This project is built for educational purposes.


Built with โค๏ธ to make learning about real-world assets fun and engaging for kids!


๐Ÿ™ Acknowledgments

Special thanks to the educational gaming community for inspiration on gamification and learning design.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •