π Live Application: https://orecalc.tech
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.
- 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
- 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
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.
- 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
- 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)
- 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
-
Clone the repository:
git clone https://github.com/abhis-s/oreCalc.git cd oreCalc -
Install dependencies:
This is a pnpm workspace β one command installs both frontend and backend dependencies:
pnpm install
-
Set up environment variables:
Copy the example env file and configure it:
cp server/.env.example server/.env
Edit
server/.envand set:CLASH_OF_CLANS_API_TOKENβ Your API token from the Clash of Clans Developer PortalFIRESTORE_SA_KEYβ (Optional) Google Cloud Firestore service account key for cloud syncCOC_API_BASE_URLβ (Optional) Override the API base URL. Defaults to the RoyaleAPI proxy which removes the need for a static IP
-
Start the backend API server (in a separate terminal):
cd server node main.jsThe server starts on
http://0.0.0.0:3000. You can access it from other devices on the same network using your local IP. -
Start the frontend dev server:
pnpm dev
Opens at
http://0.0.0.0:8080with hot-reload. Also accessible from other devices on the network.
This project is designed for deployment on Google Cloud Run with CI/CD via Cloud Build.
- Google Cloud Project with billing enabled
gcloudCLI 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)
-
Build frontend:
pnpm run build
-
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.
-
Deploy frontend:
cd .. gcloud run deploy orecalc-webapp \ --source . \ --region europe-west1 \ --allow-unauthenticated \ --platform managed \ --port 80
-
Custom domains (recommended) β Map
orecalc.techandapi.orecalc.techvia Cloud Run's custom domain settings. -
CI/CD (recommended) β Connect your GitHub repository to Cloud Build using
cloudbuild.frontend.yamlandserver/cloudbuild.backend.yaml.
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
Contributions are welcome! Feel free to:
- π Open an issue for bugs or feature requests
- π Help translate on Crowdin to add new languages
- β Buy me a coffee to support development
This project is licensed under the MIT License β see the LICENSE file for details.

