Sheeraz KhanLead Game Developer
Initializing Experience 100%
Settings
Theme
Motion
cricketx.net on desktop and on a phone

XRev StudioLead Developer

CricketX Website and Tools

The web platform around the CricketX VR game: subscriptions and smart bats, academy accounts with roles, and the tools the team runs on.

ReactFirebaseStripe
Role
Lead Developer
Built with
React, Firebase, Cloud Functions, Stripe
Products
Website, Insights, Companion, Highlights Bot

One platform around a VR game

CricketX is a VR cricket game for Meta Quest, and around it sits a small web platform on one shared Firebase project. cricketx.net is the shop and account hub, where players subscribe to CricketX Pro or buy a smart bat, and where academies buy team seats and run their roster. The Companion is a browser remote for a live headset session. CricketX Insights is the internal stats dashboard, and a Discord bot brings community highlight clips onto the site.

All of these apps read and write the same data the Unity game writes, through one set of Cloud Functions and one set of security rules. The rules live in the website repository, and emulator tests in CI must pass before they can deploy. Every web app also has a version gate and a maintenance switch.

Subscriptions from checkout to cancellation

The browser only picks a plan and a billing cycle. The server resolves the price, the trial and any campaign, then opens a Stripe Checkout. One webhook handles 14 Stripe event types, from checkout and invoices to trials and scheduled changes. Upgrades apply at once with proration, and players see the credit and the charge before they confirm. Downgrades wait for the end of the period through Stripe Subscription Schedules.

A receipt goes out for every paid invoice, and the free bat that comes with a yearly plan ships only after a real payment, never on a free trial invoice. Trial reminders come from Stripe, with a daily job as a backup. Staff can change prices, trials and campaigns from an internal page without a new build: existing subscribers keep their price, and every change is recorded.

Academy accounts with five roles

An academy owner creates an organization, buys seats and adds members. There are five roles, Owner, Admin, Coach, Analyst and Member, with ten capabilities, and a person can only manage roles below their own, so only the Owner can make an Admin. Seats are separate from roles, and each seat purchase is its own Stripe subscription that can be cancelled or resumed on its own.

A coach can run a drill as one of their members. The game signs in with a short-lived token for that member, so the results land in the member's own account without loosening any security rule. More than twenty branded emails, from receipts to team invites and role changes, are built in one file.

The tools the team runs on

CricketX Insights loads from three summary documents instead of about 1,500 database reads. Database triggers keep those three documents up to date, and the dashboard caches them for five minutes. In the Companion, career stats load from two reads instead of more than fifty.

The Community Highlights Bot watches the highlights channel on Discord. It checks each clip (video or image, 60 seconds and 50 MB at most, not a repeat), sends it to the website with a shared secret, and mirrors any edit or delete. The VR game can post clips into the same path through a rate-limited function, and staff control who can use each bot command from inside Discord.

What I built

As Lead Developer at XRev Studio I wrote most of cricketx.net and its backend. That covers the Cloud Functions, the subscription lifecycle, academy licensing, the bat checkout, the account pages, the security rules and every transactional email. I wrote all of the Discord bot and most of CricketX Insights. I also led the Firebase refactor across every app, with shared data paths, a logger, version gates and one developer guide copied into each repository.

The Companion is a team product, and my part is its data layer, error boundaries, logger and version gate. The build check that prerenders every public page and replays its tests against the live site was written by a teammate.

The products

cricketx.net on desktop and on a phone

cricketx.net

CricketX Website

The shop and account hub for the CricketX VR game. Players subscribe and buy smart bats, and academies buy seats and manage their teams.

  • Stripe subscriptions: 14 webhook events, prorated upgrades, downgrades at period end
  • Academy accounts with five roles and seats sold separately
  • More than twenty branded emails built in one file
  • Prices and trials change from an internal page, with no rebuild

5 academy roles, from owner to member, with seats sold separately

14 Stripe events handled by one webhook, from checkout to cancellation

3 database reads per dashboard load, down from about 1,500

Internal tool

CricketX Insights

The internal player-stats dashboard for XRev Studio staff. It only reads data and never writes to player accounts.

  • Loads from three summary documents instead of about 1,500 reads
  • Global counters, leaderboards and a profile for every player
  • Charts load only when needed, with a five-minute cache
  • The same version gate and maintenance screen as the other apps

Team product

CricketX Companion

A browser remote a coach opens beside a live headset session. Changes to the ball, pitch and fielding apply in the headset at once, and analytics flow back.

  • A team product; my part is its Firebase data layer
  • Career stats load from two reads instead of more than fifty
  • Error boundaries around the riskiest tabs, a production logger and a version gate
  • Architecture docs and a Firebase guide for the team

Discord

Community Highlights Bot

A Discord bot that moves highlight clips from the community server onto cricketx.net. I wrote all of it.

  • Checks every clip: video or image, 60 seconds and 50 MB at most, no repeats
  • Mirrors edits and deletes onto the website
  • The VR game posts clips through the same path, rate-limited per player
  • Staff manage who can use each command from inside Discord

End of the case studyThanks for reading.

Working on something like this?

I'd love to hear about it. If there is a game or a project where this kind of work would help, send me a message.