Skip to content

bytes06runner/web_3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Stellar Wars

Stellar Wars Banner React TypeScript Stellar

A Web3 DeFi Gaming Experience on the Stellar Blockchain

Live DemoDocumentation


🎮 About The Project

Stellar Wars is a next-generation Web3 gaming platform that combines DeFi yield mechanics with strategic PvP combat on the Stellar blockchain. Players stake XLM tokens, build armies, and raid other players to earn rewards—all while their staked assets generate passive yield.

🏷️ Tagline

"Stake. Battle. Earn."


✨ Features

💰 Yield Vault (Passive Income)

  • Connect Freighter wallet to deposit XLM
  • Automatic 5% APY on staked balance
  • Real-time balance updates
  • Withdraw anytime (no lock-up period)

⚔️ Barracks (Army Building)

  • Train three unit types: Archers, Infantry, Giants
  • Each unit has different costs, capacity, and DPS
  • Strategic army composition affects raid success
  • Command Tokens system for training

🏟️ Global Battle Arena (PvP Combat)

  • View all registered players with Power & Defense stats
  • Initiate raids costing 100 XLM per attack
  • Cinematic battle video during combat
  • Winners receive XLM rewards from the prize pool

🎨 Heroic Skins NFT Shop

  • Mint premium character skins as NFTs
  • Rarities: Common, Rare, Epic, Legendary, Mythic
  • Current collection: GAKU, GOT, VALK, EXTRA
  • NFTs stored on Stellar via Freighter wallet

🛡️ Defense Upgrades

  • Upgrade Shield Defense (+10 HP per upgrade)
  • Higher defense = harder to raid
  • Strategic balance: offense vs defense

🛠️ Technology Stack

Frontend

Technology Version Purpose
React 19.2 UI Framework
TypeScript 5.9 Type-safe development
Vite 7.x Build tool
TailwindCSS 3.4 Styling
Framer Motion - Animations
Lucide React - Icons

Backend

Technology Purpose
Node.js + Express REST API server
MongoDB Atlas Cloud database
Mongoose ODM for MongoDB
bcryptjs Password hashing
JWT Authentication
Netlify Functions Serverless API

Blockchain

Technology Purpose
Stellar Network Fast, low-fee blockchain
Stellar SDK 14.4 Blockchain interaction
Freighter Wallet Browser wallet extension
XLM (Lumens) Native currency

🔗 Blockchain Details

Network

Network: Stellar Mainnet / Testnet
Transaction Fee: ~$0.00001 per transaction
Confirmation Time: 3-5 seconds

Smart Contract / Wallet Addresses

Purpose Address
Game Vault GBYXWKRQVBMVQZ7ZLYQKNWFVJVQW6XJHQMVQZ7ZLYQKNWFVJVQW6XJH
Treasury GCK5IIOTUSM64HZPN7M6ARVM7QIMMYJYA6S5WZN2CB3VVCSKLW7R7JR4
NFT Issuer STELLAR_WARS_NFT_ISSUER

Transaction Types

  • Stake Raid: 100 XLM per raid
  • NFT Minting: Variable (100-150 XLM)
  • Shield Upgrade: 10 XLM per upgrade

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Freighter Wallet browser extension
  • MongoDB Atlas account (for backend)

Installation

  1. Clone the repository

    git clone https://github.com/bytes06runner/web_3.git
    cd web_3
  2. Install backend dependencies

    npm install
  3. Install frontend dependencies

    cd frontend
    npm install
  4. Environment Setup

    Create .env file in root:

    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
    PORT=3000
  5. Run the development servers

    Backend (from root):

    node server.js

    Frontend (from /frontend):

    npm run dev
  6. Open in browser

    http://localhost:5173
    

📁 Project Structure

web_3/
├── server.js                    # Express API server (MongoDB)
├── .env                         # Environment variables
├── package.json                 # Backend dependencies
├── STELLAR_WARS_PITCH.txt       # Full project documentation
│
└── frontend/
    ├── index.html               # Entry HTML
    ├── vite.config.ts           # Vite build config
    ├── tailwind.config.js       # TailwindCSS theme
    ├── netlify.toml             # Netlify deployment config
    │
    ├── netlify/functions/       # Serverless API functions
    │   ├── db.js                # MongoDB connection
    │   ├── auth-login.js        # Login endpoint
    │   ├── auth-register.js     # Registration endpoint
    │   ├── users-all.js         # Get all users
    │   └── users-by-wallet.js   # Get user by wallet
    │
    ├── public/assets/           # Static assets
    │   ├── char_*.png           # Character images
    │   ├── parchment_scroll.png
    │   └── ...
    │
    └── src/
        ├── App.tsx              # Main application
        ├── index.css            # Global styles
        │
        ├── components/
        │   ├── Header.tsx       # Navigation header
        │   ├── Dashboard.tsx    # Stats HUD
        │   ├── Barracks.tsx     # Army training
        │   ├── BattleArena.tsx  # PvP matchmaking
        │   ├── BattleInterface.tsx # Combat modal
        │   ├── NftShop.tsx      # NFT marketplace
        │   └── ...
        │
        ├── pages/
        │   ├── Login.tsx        # Authentication
        │   └── Register.tsx     # Account creation
        │
        └── services/
            ├── authService.ts   # Auth logic
            ├── mockContract.ts  # Game state
            ├── stellarService.ts # Stellar SDK
            └── walletService.ts # Freighter wallet

🌐 Deployment

Live URLs

Environment URL
Production https://stellar-wars.netlify.app
Function Logs https://app.netlify.com/projects/stellar-wars/logs/functions

Deploy to Netlify

  1. Push to GitHub
  2. Connect repo to Netlify
  3. Set environment variables:
    • MONGODB_URI
    • JWT_SECRET
  4. Deploy triggers automatically on push

Manual Deploy

cd frontend
npm run build
npx netlify deploy --prod --dir=dist

🎯 Roadmap

  • Core gameplay loop
  • Freighter wallet integration
  • PvP Battle Arena
  • Cinematic battle videos
  • NFT Shop with minting
  • MongoDB user persistence
  • Netlify Functions deployment
  • Soroban smart contracts (on-chain logic)
  • Guild system (team battles)
  • Tournament system with prize pools
  • Mobile app (React Native)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License.


👨‍💻 Team

Role Name GitHub
Developer Srijeet Banerjee @bytes06runner

🔗 Links


Built with ❤️ on Stellar Blockchain

⭐ Star this repo if you found it helpful!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors