Sunset Labs
  • šŸ”„ Welcome to Stark Brawl Docs!
  • Getting Started
    • Quickstart
    • How Web3 & Starknet Work in Stark Brawl
  • Basics
    • 1. Basics (Learn the Basics of Stark Brawl)
    • šŸ“‚ Monorepo Structure for Stark Brawl
    • šŸŽ® NFTs & Digital Ownership in Stark Brawl
    • šŸ’° Economy & Monetization in Stark Brawl
Powered by GitBook
On this page
  1. Basics

šŸ“‚ Monorepo Structure for Stark Brawl

šŸš€ Key Features

āœ… Modular Structure → Frontend, Backend, Smart Contracts & Docs stay separate but integrated. āœ… Monorepo Efficiency → Uses Turborepo / Nx to handle dependencies across projects. āœ… Shared Code → UI Components (packages/ui/), Utilities (packages/utils/), and SDK (packages/sdk/). āœ… Web3 Ready → Cairo Smart Contracts (apps/contracts/), with an SDK to interact from frontend/backend. āœ… CI/CD Ready → GitHub Actions (.github/workflows/) for automated testing, linting, and deployment. āœ… Documentation Hub → Supports GitBook or Docusaurus (apps/docs/).

Feel free to test it out and copy the Markdown below by hovering over the code block in the upper right, and pasting into a new line underneath.

stark-brawl-monorepo/
│── apps/                    # Main applications
│   ā”œā”€ā”€ web/                 # React Frontend (Game UI)
│   ā”œā”€ā”€ backend/             # Node.js Backend (Matchmaking, WebSockets)
│   ā”œā”€ā”€ contracts/           # Starknet Smart Contracts (Cairo)
│   ā”œā”€ā”€ docs/                # Documentation (GitBook/Docusaurus)
│
│── packages/                 # Shared Packages for Reusability
│   ā”œā”€ā”€ ui/                   # Shared UI Components (React)
│   ā”œā”€ā”€ utils/                # Common utilities (helpers, hooks)
│   ā”œā”€ā”€ sdk/                  # Starknet SDK (interacting with contracts)
│
│── configs/                  # Configuration files
│   ā”œā”€ā”€ eslint/               # Linting rules
│   ā”œā”€ā”€ prettier/             # Code formatting rules
│   ā”œā”€ā”€ tsconfig/             # TypeScript settings
│
│── scripts/                  # Automation & DevOps Scripts
│   ā”œā”€ā”€ deploy.sh             # Deployment script
│   ā”œā”€ā”€ setup.sh              # Environment setup
│
│── .github/                   # GitHub Actions (CI/CD)
│   ā”œā”€ā”€ workflows/            # CI/CD pipelines
│
│── .gitignore                 # Ignore unnecessary files
│── package.json               # Root package.json (managing workspaces)
│── turbo.json                 # TurboRepo (for managing monorepo builds)
│── README.md                  # Project Overview

šŸ› ļø How to Set Up & Run

1ļøāƒ£ Clone Repo & Install Dependencies

bashCopyEditgit clone https://github.com/SunsetLabs/StarkBrawl-Monorepo.git
cd stark-brawl-monorepo
pnpm install  # or yarn install

2ļøāƒ£ Run Apps in Parallel (TurboRepo)

bashCopyEditpnpm dev  # Runs frontend, backend & contracts together

3ļøāƒ£ Deploy Smart Contracts (Starknet)

bashCopyEditcd apps/contracts
starknet deploy --contract stark_brawl.cairo --network testnet

4ļøāƒ£ Start Backend (Matchmaking, API)

bashCopyEditcd apps/backend
pnpm start
Previous1. Basics (Learn the Basics of Stark Brawl)NextšŸŽ® NFTs & Digital Ownership in Stark Brawl

Last updated 3 months ago