Logo
Overview
Solving Campus Life Problems: The BITS ID Generator

Solving Campus Life Problems: The BITS ID Generator

How forgetting my college ID card evolved into a web-based scannable barcode generator built with Next.js.

August 1, 2024  •  3 min read


We’ve all been there: You’re running late for the mess to catch breakfast before the counter closes, or heading out to a much-anticipated college fest, and right as you reach the entrance gate, you realize you’ve forgotten your physical ID card back in your hostel room.

I used to face this problem almost every single week. The fallback? Having to stand awkwardly at the counter, manually typing my ID into a slow, clunky system just to grab a meal or enter a venue. Not only was it deeply frustrating for me, but it also held up the entire line of hungry students behind me.

This drove me to create the BITS ID Generator, a tool specifically designed for college students in a rush.


From Manual Typing to Digital Scanning

Instead of writing a complex native mobile app that everyone would have to download from the App Store, I knew the solution had to be frictionless. A web app that anyone could open instantly on their phone browser was the perfect fit.

To solve the manual-typing nightmare, I built a small Next.js 14 web app that:

  1. Accepts a user’s BITS ID via a clean input form.
  2. Generates a visual, scannable barcode card dynamically within the browser.
  3. Automatically persists the ID to the browser’s localStorage so reloading the page or reopening the tab the next day keeps your ID right there.
Note

The Philosophy: A good student utility app should do exactly one thing flawlessly, with zero onboarding time. It should require zero logins, zero signups, and zero downloads.

Core Technology Stack

I decided to use the Next.js App Router framework alongside React 18 and TypeScript for absolute type safety. The UI primitives and components were styled beautifully using Tailwind CSS combined with Radix UI packages and a shadcn/ui style setup.

Here is how the main App Router layout fundamentally structured the generator:

  • app/page.tsx: The homepage Client Component containing the input form, toast notifications, and the generated card itself.
  • components/CreditCard.tsx: The core ID card UI and the brain behind the barcode rendering logic.
  • lib/utils.ts: Standard cn() handler merging class names seamlessly with clsx and tailwind-merge.

Interactive Design & The “Aha!” Feature

While the backend logic was simple, the visual presentation had to look polished and professional. The app needed to mimic the physical ID card well enough that scanning it felt natural to the security officials.

I rendered the barcodes dynamically using jsbarcode, outputting a clean, infinitely scalable SVG right onto the DOM. To give the digital card some realistic flair, I integrated react-tilt and framer-motion to provide a subtle, physical tilt animation when the user moves their device or cursor over the card.

Note

The UX Bottleneck: Phones have drastically different screen sizes. When a security guard tries to scan a barcode off a small phone screen, glare, accidental scrolling, and tiny barcode dimensions often cause the scanners to fail, bringing us back to square one.

The Fullscreen Solution

The absolute best feature of the BITS ID Generator came from solving that very bottleneck.

I added a feature where tapping the barcode or the card area instantly requests a device-wide Fullscreen View. By coupling this with the browser’s Orientation Lock API, it locks the screen horizontally, maximizes the brightness (where supported), and presents a massive, high-contrast barcode to the scanner.

components/CreditCard.tsx
// Simplification of the Fullscreen Request Logic
const handleFullscreen = async (element) => {
try {
if (element.requestFullscreen) {
await element.requestFullscreen()
}
// Attempting to lock orientation for easier horizontal scanning
if (screen.orientation && screen.orientation.lock) {
await screen.orientation.lock('landscape')
}
} catch (err) {
console.error('Fullscreen/Orientation lock failed:', err)
}
}

What started as a personal pain point—forgetting a plastic card while running to the mess—ended up turning into a quick, clever utility that significantly eased campus life for me and my peers. The BITS ID Generator proved that sometimes the most impactful software isn’t a massive AI startup; it’s a simple, elegant tool that solves a minor daily frustration perfectly.