A sleek web app for Singapore MCTs to search Microsoft Learn courses, open Singapore-tracked course pages, and generate achievement codes end-to-end via Playwright.
A web app for Singapore-based Microsoft Certified Trainers (MCTs) to look up Microsoft Learn courses from the official Title Plan, open the correctly-tracked Singapore course page, and generate achievement codes end-to-end via Playwright browser automation.
Code generation requires running the Python backend locally — GitHub Pages can only serve the static search UI.
- Search the 132-course April 2026 Title Plan by course number or title
- Open Singapore course page with correct partner tracking:
?WT.mc_id=ilt_partner_webpage_wwl&ocid=5238477 - Generate achievement codes locally — Playwright drives Chromium through the full Microsoft Learn request flow
- Auto-save generated codes to CSV with timestamps for record-keeping
- Debug support — screenshots + HTML dumps on failure for easy troubleshooting
| Layer | Technology |
|---|---|
| Frontend | Plain HTML / CSS / JS (no build step) |
| Backend | Flask (static serving + JSON API) |
| Automation | Playwright (Python) + Chromium |
| Data Source | Microsoft MCT Courseware Title Plan (Excel) |
| Deployment | GitHub Pages (static) / Local (full mode) |
┌─────────────────────────────────────────────────┐
│ Browser (UI) │
│ index.html · styles.css · app.js │
├─────────────────────────────────────────────────┤
│ Flask Server (server.py) │
│ GET / ── Static file serving │
│ POST /api/login ── Auth flow │
│ POST /api/generate ── Code generation │
├──────────────┬──────────────────┬────────────────┤
│ login.py │ generate.py │ paths.py │
│ Headed │ Headless │ Shared │
│ Chromium │ Chromium │ paths + │
│ sign-in │ code request │ SG suffix │
├──────────────┴──────────────────┴────────────────┤
│ Data Layer │
│ courses.json · storage_state.json · codes.csv │
└─────────────────────────────────────────────────┘
microsoftredeemcode/
├── .github/workflows/pages.yml # deploys webapp/ to GitHub Pages
├── titleplan_april10_2026.xlsx # source of truth
├── webapp/
│ ├── index.html · styles.css · app.js # static UI
│ ├── courses.json # extracted from xlsx
│ ├── extract_courses.py # xlsx → json
│ ├── server.py # Flask app: static + /api/*
│ └── backend/
│ ├── login.py # Playwright sign-in flow
│ ├── generate.py # Playwright code-generation flow
│ └── paths.py # shared paths + Singapore URL suffix
└── README.md
Just open https://alfredang.github.io/microsoftredeemcode/ — no install required.
git clone https://github.com/alfredang/microsoftredeemcode.git
cd microsoftredeemcode/webapp
# Install Python deps
python -m pip install flask playwright openpyxl
python -m playwright install chromium
# Start the app
python server.pyOpen http://localhost:8000.
Click Sign in to Microsoft in the auth bar at the top of the page. A Chromium window opens — sign in with your MCT account, then either click the injected Finish & save session banner or close the window. Playwright writes your session to webapp/data/storage_state.json and reuses it silently for subsequent generations.
⚠️ storage_state.jsoncontains live Microsoft auth cookies. It is in.gitignore— never commit it.
- Search for a course.
- On the matching card, set Number of students.
- Click Generate achievement code.
The code + URL render inline on the card and are appended to data/codes.csv:
timestamp,courseNumber,code,url,students
2026-04-15T02:34:12+00:00,AI-102T00,8X582M,https://learn.microsoft.com/...,25If a step fails, a screenshot + full page HTML dump land in data/debug/ and the UI shows a step-labeled error.
When a new titleplan_*.xlsx drops:
- Replace the xlsx at the repo root.
- Update the path in
webapp/extract_courses.pyif the filename changed. - Regenerate the JSON:
python webapp/extract_courses.py. - Commit
courses.jsonalongside the xlsx.
storage_state.json(MS auth cookies) andcodes.csv(generated codes) are gitignored- The Flask server binds to
127.0.0.1only — not exposed to the network - Never commit the
data/folder contents
Developed by Tertiary Infotech Academy Pte. Ltd.
Internal partner tooling. Not affiliated with or endorsed by Microsoft.
If this tool is helpful, give it a ⭐!
