Skip to content

Galaxies-dev/virtual-currency-demo

Repository files navigation

Dungeon Loot Shop — Virtual Currency Demo

A small Expo / React Native app that showcases RevenueCat Virtual Currency in a fantasy RPG‑style item shop.
Players buy Gems via in‑app purchases, then spend them on weapons, armor, and potions in a dungeon shop.

What this app demonstrates

  • Virtual currency flow: Buy gems with IAP, see your balance, and spend gems on items.
  • RevenueCat integration:
    • Purchases.getOfferings() to load gem packages.
    • Purchases.purchasePackage() to buy gems.
    • Purchases.getVirtualCurrencies() to read the GEMS balance.
    • Backend proxy (Expo API route) to spend gems via the RevenueCat Transaction API.
  • App structure (Expo Router + bottom tabs):
    • Shop: Browse items, see prices in gems, purchase via a confirmation bottom sheet.
    • Buy Gems: Choose from multiple gem packs wired to RevenueCat products.
    • Inventory: View items you own, grouped by rarity.

For a more detailed breakdown of screens, data, and API usage, see SPEC.md.

Running the app

  1. Install dependencies

    npm install
  2. Configure RevenueCat

    • Create a project and virtual currency GEMS in the RevenueCat dashboard.
    • Configure the gem products (gems_50, gems_200, gems_500, gems_1500) and an Offering.
    • Add your public SDK key and any needed environment values as described in the tutorial/video.
  3. Start the dev server

    npx expo start

    Then open the app in an iOS simulator, Android emulator, or on‑device development build.

Tech stack

  • Framework: Expo + React Native with Expo Router
  • In‑app purchases / virtual currency: react-native-purchases (RevenueCat)
  • Navigation: React Navigation bottom tabs
  • State: React Context + useReducer for gem balance and inventory
  • Storage: @react-native-async-storage/async-storage for inventory persistence

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •