The unofficial attendance tracker for KL University students.
Real-time data from the ERP · Zero manual input · Installable PWA
KL Sync is a student-built Progressive Web App that gives KL University (KLEF) students a clean, fast alternative to the official ERP portal for tracking attendance. It scrapes live data from newerp.kluniversity.in using your own ERP credentials — nothing is stored server-side.
Built for the Bachupally campus but works across all KLU campuses that use the same ERP.
Disclaimer: This is an unofficial, community project and is not affiliated with KL University. Your credentials are never stored — they are used only to authenticate your session directly with the KLU ERP.
- Fetches real-time attendance from the KLU ERP for any academic year and semester
- Weighted percentage calculation across all four components: Lecture · Tutorial · Practical · Skilling (LTPS)
- Color-coded eligibility status:
- 🟢 ≥ 85% — Eligible
- 🟡 75 – 84% — Condonation zone
- 🔴 < 75% — Detained
- Per-course simulator: see how many more classes you need to attend to cross 75% or 85%
- Adjustable sliders let you model "what if I attend/miss X classes" before the next session
- One-click Magic Wand button auto-fills the ERP login CAPTCHA using OCR.space (dual-engine, parallel)
- Manual entry always available as a fallback — OCR is never forced on you
- Can't log in? Upload a screenshot of your KLU attendance table and KL Sync will extract the data using OCR and render the same dashboard
- Press
⌘K/Ctrl+Kanywhere to jump between semesters, search courses, and trigger actions
- Works offline after first load via Service Worker
- Add to Home Screen on iOS and Android for a native app feel
standalonedisplay mode withblack-translucentstatus bar on iOS
- Animated with Framer Motion (v12)
- Dot-matrix background with radial gradient overlay
- Dark mode by default, system theme respect via
next-themes Fira Sans+Fira Codetypography
| Layer | Technology |
|---|---|
| Framework | Next.js 16 — App Router, React Compiler |
| UI | React 19, Framer Motion, Lucide React |
| Styling | Tailwind CSS v4, tailwind-merge, clsx |
| Scraping | Cheerio — server-side HTML parsing against KLU ERP |
| OCR | OCR.space API (captcha), Tesseract.js (client screenshot) |
| Command Palette | cmdk |
| Auth / Session | Cookie jar + CSRF token, httpOnly device cookie, base64-encoded session token |
| Caching | Next.js unstable_cache (1-hour revalidation per session) |
| Runtime | Vercel Edge Runtime — zero cold starts |
| Testing | Vitest, @testing-library/react, jsdom |
| Language | TypeScript 5 throughout |
Browser (PWA)
│
├── /login → Login page (CAPTCHA fetch, auto-solve opt-in, ERP auth)
└── / → Dashboard (attendance, calculator, command palette)
│
▼
Next.js Edge API Routes
│
├── GET /api/erp/captcha → Fetch live CAPTCHA image from KLU ERP
├── POST /api/erp/captcha → Auto-solve CAPTCHA via OCR.space
├── POST /api/login → Authenticate with KLU ERP, return session token
├── POST /api/erp/data → Fetch profile / timetable / attendance (1hr cache)
└── POST /api/parse-ocr → Parse uploaded attendance screenshot via OCR
│
▼
newerp.kluniversity.in
(cheerio scraper, cookie jar, sticky SERVERID handling)
Session flow: The scraper maintains a faithful cookie jar across the load-balancer's sticky SERVERID redirects, accumulates PHPSESSID + _csrf on the final hop, and serialises the whole session as a base64 token that rides in the x-session-id header — no database, no server-side storage.
- Node.js ≥ 20
- npm / pnpm / yarn
git clone https://github.com/tejaswin-amara/kl-sync.git
cd kl-syncnpm installcp .env.example .env.localOpen .env.local and set your OCR key (see Environment Variables below).
npm run devVisit http://localhost:3000 and log in with your KLU ERP credentials.
| Variable | Required | Description |
|---|---|---|
OCR_SPACE_API_KEY |
Optional | API key from ocr.space/ocrapi for CAPTCHA auto-solve. Falls back to the free helloworld key if unset (rate-limited). |
That's it. No database. No auth service. No other secrets.
npm test # Vitest (unit + component tests)
npm run test:jest # Jest runnerThe test suite covers the ERP scraper, OCR pipeline, session encode/decode, login API route, and the OCR parse route.
The recommended deployment target is Vercel — all API routes run on the Edge Runtime and deploy automatically.
- Fork or import this repo into Vercel
- Add
OCR_SPACE_API_KEYin Settings → Environment Variables - Deploy — done
Pull requests are welcome! For significant changes, open an issue first.
- Fork the repo
- Create your branch:
git checkout -b feat/your-feature - Commit:
git commit -m 'feat: add your feature' - Push:
git push origin feat/your-feature - Open a Pull Request
MIT © Tejaswin Amara