Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

257 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OreCalc β€” Clash of Clans Equipment Planner

πŸš€ Live Application: https://orecalc.tech

OreCalc Desktop

OreCalc Mobile

Stop guessing, start upgrading. OreCalc is a comprehensive equipment planner and ore forecasting tool for Clash of Clans. Calculate exactly what you need, track every ore source, plan your upgrades on a visual calendar, and watch your progress in real time.


✨ Features

🏠 Home Dashboard

  • Required Ores β€” See exactly how many Shiny, Glowy, and Starry ores you need to reach your target levels
  • Time Remaining β€” Real-time estimates of when you'll have enough ores to complete each upgrade, based on your configured income
  • Income Summary Table β€” A dynamic table showing ore income per source at your chosen timeframe (daily / weekly / monthly / bimonthly), with totals
  • Resource Overview β€” At-a-glance display of your league, CWL participations, Clan War count, Raid Medals, Event Medals, Gems, and total real-money cost

πŸ”§ Equipment Tab

  • All 6 heroes β€” Barbarian King, Archer Queen, Grand Warden, Royal Champion, Minion Prince, and Dragon Duke with all Common and Epic equipment
  • Per-equipment controls β€” Enable or disable individual equipment to include or exclude it from ore calculations
  • Per-hero toggle β€” Enable or disable entire heroes at once
  • Stored ores β€” Input your currently stored Shiny, Glowy, and Starry ores so the calculator accounts for what you already have
  • Custom max levels β€” Set your own target max levels for Common (up to 18) and Epic (up to 27) equipment
  • Hide maxed equipment β€” Automatically hide equipment that has already reached the target level
  • Hide locked equipment β€” Hide equipment you haven't unlocked yet
  • Level input mode β€” Toggle a mode where you can quickly set levels via text input instead of the default selector

πŸ’° Income Tab (10 Sources)

Each income source has its own dedicated card with inputs and a detailed breakdown of ore output per timeframe (daily / weekly / monthly / bimonthly).

  • Star Bonus β€” Select your league from every tier (Skeleton through Legend). Configure multiplier events (2x / 4x) with custom event frequency and duration. Plan for TH upgrades that change your league floor mid-timeline
  • Clan Wars β€” Set wars per month, win/draw/loss rates, and ores earned per attack. Inputs feature TH-based recommended values pulled from in-game data
  • Clan War Leagues (CWL) β€” Set hits per season with win/draw/loss rates and per-attack ore income
  • Raid Medal Trader β€” Configure how many packs of each ore type you buy weekly with your earned Raid Medals
  • Gem Trader β€” Configure weekly gem pack purchases for each ore type
  • Event Pass β€” Toggle between free and paid pass. Set claimable medals and bonus track medals. Optionally include equipment rewards in the calculation
  • Event Trader β€” Configure medal-based ore purchases. Dynamic recommendations show how many packs you can afford based on your remaining Event Medals after other purchases
  • Shop Offers β€” Select your TH-level offer set. Toggle individual offers on/off. Tracks the real-money cost in your chosen currency
  • Supercell Events β€” Toggle World Championship events. Dynamic schedule with auto-generated income chips based on the current season
  • Prospector β€” Configure ore conversion (e.g. Shiny β†’ Glowy). Gold Pass vs. Silver Pass rates. A dynamic recommendation tip analyzes your bottleneck ore and suggests the optimal conversion to reach your next upgrade faster, with over-conversion warnings

Every number input features a contextual popover with min/max ranges, TH-based recommended values, and click-to-fill buttons for quick setup.

πŸ“… Planner Tab

  • Calendar β€” Monthly and weekly views with swipe/drag navigation. Configurable first day of week (auto / Monday / Sunday)
  • Income chips β€” Each income source generates draggable chips placed on calendar days. Chips show ore amounts and source icons. Supports daily, weekly, monthly, and bimonthly schedules
  • Auto-place β€” One-click automatic distribution of all income chips across the visible month or entire year
  • Custom chips β€” Create your own chips via a full modal with 11 chip types (Star Bonus, Shop Offers, Gem Trader, Raid Medal Trader, Event Trader, Event Pass, Clan War, CWL, Supercell Events, Prospector, and a freeform "Extras" type). Custom chips support one-time or recurring schedules (weekly / monthly)
  • Chip management β€” Drag and drop chips between calendar days. Delete chips. Delete all chips for a month or globally
  • Priority list β€” Sortable upgrade queue that determines the order in which ores are allocated. Shows target level and estimated completion date for each item
  • Priority list editor β€” Full modal to add, remove, and reorder equipment in the priority queue. Includes smart ordering suggestions based on ore efficiency
  • Efficiency interleaving β€” The priority list suggests completing cheaper Common upgrades during Starry ore bottlenecks to keep your Shiny and Glowy ores productive
  • Ore tooltips β€” Hover over any priority item to see the exact ore cost breakdown and which ore type is the bottleneck
  • Hide/show suggestions β€” Dismiss or restore priority list suggestions as needed

πŸ‘€ Multi-Player & Sync

  • Clash of Clans API β€” Enter your player tag to fetch your profile, Town Hall level, heroes, and equipment levels directly from the game. Clan badge displayed in the UI
  • Multi-account support β€” Save multiple player tags and switch between them via a dropdown. Each account maintains its own heroes, income settings, planner, and currency preferences
  • Real-time cloud sync β€” Data is automatically synced to Firestore on every change. Load your data on any device by entering your User ID
  • QR code sharing β€” Generate a QR code for your User ID. Scan it on another device to instantly import your data
  • Data download β€” Export all your data as a downloadable file
  • User ID import β€” Import another player's data by pasting their User ID
  • Tag verification β€” Verify tag ownership via Clash of Clans API token for protected profiles
  • Data erasure β€” Reset all data or request global data erasure (GDPR-compliant deletion)

🎨 Customization & Settings

  • Accent color themes β€” Choose from Blue, Gold, Purple, Green, Red, or Random. The entire UI adapts to your choice
  • Dark / Light mode β€” Toggle between dark and light themes
  • 9 currencies β€” EUR, USD, GBP, AUD, CAD, CHF, INR, JPY, NZD. All real-money cost calculations (Shop Offers, Event Pass, Prospector) update to your chosen currency
  • Global pricing β€” Customize prices per currency if your region's pricing differs from defaults
  • Localization β€” English and German with automatic browser locale detection. All labels, dates, and number formatting adapt to your language
  • Calendar settings β€” First day of week, chip icon visibility, auto-place scope (month / year)
  • Responsive design β€” Fully optimized for desktop, tablet, and mobile
  • Progressive Web App β€” Install to your home screen, works fully offline after the first load
  • Completely ad-free β€” No ads, no tracking, no paywalls. Open source and free forever
  • Changelog β€” In-app changelog modal shows what's new after each update

πŸš€ Getting Started

Prerequisites

  • Node.js (LTS version recommended)
  • pnpm (Performant NPM package manager)
  • Git

Local Development Setup

  1. Clone the repository:

    git clone https://github.com/abhis-s/oreCalc.git
    cd oreCalc
  2. Install dependencies:

    This is a pnpm workspace β€” one command installs both frontend and backend dependencies:

    pnpm install
  3. Set up environment variables:

    Copy the example env file and configure it:

    cp server/.env.example server/.env

    Edit server/.env and set:

    • CLASH_OF_CLANS_API_TOKEN β€” Your API token from the Clash of Clans Developer Portal
    • FIRESTORE_SA_KEY β€” (Optional) Google Cloud Firestore service account key for cloud sync
    • COC_API_BASE_URL β€” (Optional) Override the API base URL. Defaults to the RoyaleAPI proxy which removes the need for a static IP
  4. Start the backend API server (in a separate terminal):

    cd server
    node main.js

    The server starts on http://0.0.0.0:3000. You can access it from other devices on the same network using your local IP.

  5. Start the frontend dev server:

    pnpm dev

    Opens at http://0.0.0.0:8080 with hot-reload. Also accessible from other devices on the network.


☁️ Deployment

Google Cloud Run

This project is designed for deployment on Google Cloud Run with CI/CD via Cloud Build.

Requirements

  • Google Cloud Project with billing enabled
  • gcloud CLI installed and authenticated
  • Enabled APIs: Cloud Run, Cloud Build, Artifact Registry, Serverless VPC Access, Cloud NAT, Secret Manager
  • Clash of Clans API token stored in Secret Manager (e.g., named clash-of-clans-api-token)

Deploy Steps

  1. Build frontend:

    pnpm run build
  2. Deploy backend:

    cd server
    gcloud run deploy orecalc-api \
      --source . \
      --region europe-west1 \
      --allow-unauthenticated \
      --platform managed \
      --port 8080 \
      --update-secrets CLASH_OF_CLANS_API_TOKEN=clash-of-clans-api-token:latest

    Note: If using the official Clash API directly (not the RoyaleAPI proxy), you need a static outbound IP via Serverless VPC Access + Cloud NAT.

  3. Deploy frontend:

    cd ..
    gcloud run deploy orecalc-webapp \
      --source . \
      --region europe-west1 \
      --allow-unauthenticated \
      --platform managed \
      --port 80
  4. Custom domains (recommended) β€” Map orecalc.tech and api.orecalc.tech via Cloud Run's custom domain settings.

  5. CI/CD (recommended) β€” Connect your GitHub repository to Cloud Build using cloudbuild.frontend.yaml and server/cloudbuild.backend.yaml.


πŸ—οΈ Architecture

oreCalc/
β”œβ”€β”€ assets/              # Hero images, ore icons, resource images
β”œβ”€β”€ css/                 # SCSS design system (palette, components, pages)
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ app.js           # Entry point and initialization
β”‚   β”œβ”€β”€ components/      # UI components (equipment, income, planner, settings)
β”‚   β”œβ”€β”€ core/            # State management, calculator, renderer
β”‚   β”œβ”€β”€ data/            # Hero data, income source registry, pricing
β”‚   β”œβ”€β”€ dom/             # DOM element selectors
β”‚   β”œβ”€β”€ i18n/            # Translation files (en.json, de.json)
β”‚   β”œβ”€β”€ incomeCalculations/  # Income calculation logic per source
β”‚   β”œβ”€β”€ services/        # API services, cloud sync, changelog
β”‚   β”œβ”€β”€ ui/              # Toast, modals, saving indicator
β”‚   └── utils/           # Chip factory, validators, date utils, SVG manager
β”œβ”€β”€ partials/            # HTML templates (tabs, modals, navigation)
β”œβ”€β”€ server/              # Express.js API (player data, verification, sync)
└── pnpm-workspace.yaml  # Workspace configuration

🀝 Contributing

Contributions are welcome! Feel free to:

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

Stop guessing, start upgrading! OreCalc helps you manage your equipment and ores with ease. Forecast your income, schedule your next big upgrade on the calendar, and optimize your path to victory. Whether you're a casual player or a maxxer, we've got your back.

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Contributors

Languages