42-cluster-stats

42 Cluster Stats 📊

🌐 Chrome Web Store

42 Cluster Stats Demo

A browser extension for the 42 intra that displays live cluster occupancy statistics in the sidebar on the clusters page.

It currently provides a clean stats card with real-time occupancy data, crowd level indicators, per-zone breakdown, and automatic refresh.


✨ Features


🖼️ Overview

42 Cluster Stats enhances the 42 intra clusters page with a floating stats card in the sidebar.

The extension is designed to make it easier to:


📦 Installation

Chrome / Chromium-based browsers

  1. Clone or download this repository

  2. Install dependencies:

    npm install
    
  3. Build the extension:

    npm run build
    
  4. Open:

    chrome://extensions
    
  5. Enable Developer mode

  6. Click Load unpacked

  7. Select the build/ folder

  8. Open the 42 intra clusters page and use the extension

Firefox

  1. Follow steps 1-3 above

  2. Open:

    about:debugging#/runtime/this-firefox
    
  3. Click Load Temporary Add-on

  4. Select build/manifest.json


🚀 Development

Install dependencies:

npm install

Run a production build:

npm run build

Run in watch mode:

npm run watch

Local workflow

  1. Edit the source files
  2. Run npm run build or npm run watch
  3. Reload the extension in your browser
  4. Test the updated version on the 42 intra clusters page

🏗️ Build Output

The final extension package is generated in:

build/

This folder contains the full unpacked extension package, including:

Use the build/ folder for:


🧩 Project Structure

42-cluster-stats/
├── build/              # Final built extension package
├── icons/              # Extension icons
├── src/
│   └── content/
│       ├── index.js        # Entry point, bootstrap, refresh logic
│       ├── constants.js    # DOM IDs, API URLs, timing config
│       ├── api.js          # Cluster data fetching
│       ├── utils.js        # Pure utilities (escape, sleep, format)
│       ├── stats.js        # Stats computation (parse, build, labels)
│       ├── page.js         # Page detection, vacant count extraction
│       └── ui/
│           ├── sidebar-root.js  # Root element creation
│           ├── render.js        # Loading, error, stats rendering
│           └── styles.css       # All CSS styles
├── manifest.json       # Source manifest
├── build.js            # Build script
├── package.json
└── README.md

The exact internal source structure may evolve as the extension grows.


🔐 Permissions

The extension uses minimal permissions:


🛠️ Technical Notes


📌 Notes


🤝 Contributing

Suggestions, improvements, and feedback are welcome.

If you want to improve the extension: