Skip to content

DanielYRoh/Rise

Repository files navigation

RISE — From Ashes to Ascension

A post-apocalyptic MUD (Multi-User Dungeon) game built on the Sui blockchain. Experience a rags-to-riches survival story in a barren wasteland, with zkLogin authentication for seamless Web3 access.

Features

🎮 Interactive Text-Based Gameplay

  • Command-line driven MUD interface
  • Explore a post-apocalyptic wasteland
  • Collect items, navigate rooms, and uncover the story
  • Commands: look, go <direction>, take <item>, examine <item>, help
  • Shortcuts: Press E for inventory, M for map

🔐 zkLogin Authentication

  • Sign in with social accounts (Google, Facebook, Twitch)
  • No wallet installation or seed phrases required
  • Automatic blockchain address generation from your identity
  • Secure, user-friendly Web3 onboarding

⛓️ Sui Blockchain Integration

  • Built on Sui using @mysten/dapp-kit
  • Smart contract interactions for game state
  • Character data stored on-chain

Quick Start

Prerequisites

  • Node.js 18+ and npm
  • OAuth client IDs from at least one provider (Google, Facebook, or Twitch)

Installation

  1. Clone and install dependencies:

    npm install
  2. Configure zkLogin (see ZKLOGIN_SETUP.md for detailed instructions):

    cp .env.example .env
    # Edit .env and add your OAuth client IDs
  3. Run the development server:

    npm run dev
  4. Open your browser: Navigate to http://localhost:5173

Project Structure

src/
├── components/
│   ├── GameTerminal.tsx      # MUD-style terminal interface
│   ├── ZkLoginScreen.tsx     # zkLogin authentication UI
│   ├── WalletConnect.tsx     # Traditional wallet connection
│   └── CharacterPanel.tsx    # Character stats display
├── hooks/
│   ├── useZkLogin.ts         # zkLogin state management
│   ├── useGameActions.ts     # Blockchain game actions
│   └── useCharacterQuery.ts  # Character data queries
├── App.tsx                   # Main app with auth flow
└── main.tsx                  # App entry point with providers

Game Controls

Terminal Commands

  • help — Show available commands
  • look — Examine current location
  • go <direction> or move <direction> — Travel (e.g., go north)
  • take <item> — Pick up an item
  • examine <item> — Inspect an item
  • inventory or E — View your inventory
  • map or M — Display the map

Keyboard Shortcuts

  • E — Open inventory (when input is empty)
  • M — Show map (when input is empty)

zkLogin Setup

For detailed zkLogin configuration instructions, see ZKLOGIN_SETUP.md.

Quick summary:

  1. Register OAuth apps with Google/Facebook/Twitch
  2. Get client IDs and add to .env
  3. Configure redirect URIs in provider consoles
  4. Start the dev server

Technology Stack

  • Frontend: React 19 + TypeScript + Vite
  • Blockchain: Sui (via @mysten/dapp-kit and @mysten/sui)
  • State Management: TanStack Query
  • Authentication: zkLogin (OAuth-based Web3 auth)
  • Styling: Custom CSS with post-apocalyptic theme

Development

Build for Production

npm run build

Lint Code

npm run lint

Preview Production Build

npm run preview

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is enabled on this template. See this documentation for more information.

Note: This will impact Vite dev & build performances.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •