← Back to Portfolio

Building Gyan Manthan: Lessons from My IBM Internship

How I built an AI-powered reading companion from scratch — covering architecture decisions, API integration, authentication, and the lessons I learned along the way.

Building Gyan Manthan at IBM

How It Started

In August 2025, I joined the IBM Developer Skills Network through the IBM Career Education Program (IBMCEP) as a Web Development Intern. Unlike typical internships where you're assigned to a team working on existing products, this was different — I had end-to-end ownership of a project from day one. The brief was open-ended: build something meaningful using modern web technologies and AI. That open canvas both excited and terrified me.

After brainstorming for a few days, I landed on an idea that combined two things I'm passionate about — technology and reading. What if there was an AI-powered companion that could create personalized reading plans based on your interests, track your progress, and adapt recommendations over time? That idea became Gyan Manthan — which translates roughly to "churning of knowledge" in Hindi.

Choosing the Tech Stack

Given my experience with the MERN stack, the frontend and backend choices were straightforward:

  • React 19 — for the frontend, taking advantage of the latest features.
  • Tailwind CSS v4 — for rapid, responsive styling without writing custom CSS for every component.
  • Framer Motion — for smooth, delightful animations that make the app feel alive.
  • Node.js + Express.js — for the backend API server.
  • MongoDB — for storing user profiles, reading plans, and progress data.
  • Firebase Authentication — for secure, hassle-free user auth.
  • OpenRouter API — for AI-powered reading plan generation.

The most unconventional choice was OpenRouter for the AI layer. Instead of locking into a single LLM provider, OpenRouter gave me access to multiple models through a single API. This allowed me to implement a model fallback chain — if one model was slow or unavailable, the system automatically tried the next one. This design decision proved crucial for reliability.

Architecture: Keeping It Clean

I structured the project with clear separation of concerns. The frontend was a React SPA with route-based code splitting. The backend followed a layered architecture:

  • Routes layer — defines API endpoints.
  • Controllers layer — handles request/response logic.
  • Services layer — contains business logic and AI integration.
  • Models layer — Mongoose schemas for MongoDB.
  • Middleware layer — authentication verification, rate limiting, error handling.

This separation made the codebase maintainable and testable. When I needed to swap the AI model or adjust rate limiting rules, I could do it in one file without touching anything else.

The AI Integration Challenge

The most technically interesting part of the project was integrating AI for reading plan generation. The user provides their interests, available reading time, and preferred genres. This information gets sent to the backend, which constructs a carefully engineered prompt and sends it to the OpenRouter API.

Prompt engineering turned out to be much harder than I expected. My first attempts produced vague, generic recommendations. Through iteration, I learned to:

  • Provide specific output format instructions (JSON structure).
  • Include constraints ("suggest exactly 5 books," "include a mix of fiction and non-fiction").
  • Add context about the user's reading level and time availability.
  • Use system prompts to define the AI's persona as a "knowledgeable librarian."

The fallback chain was another engineering challenge. I implemented it as a sequential retry mechanism — the system tries Model A first, and if it fails (timeout, error, or empty response), it automatically moves to Model B, then Model C. Each attempt has its own timeout to prevent the user from waiting too long.

Authentication: Firebase Meets MongoDB

One of the trickier technical decisions was authentication. I used Firebase Auth for the actual authentication flow (Google sign-in, email/password) because it handles token management, session persistence, and security best practices out of the box. But user profile data — reading preferences, progress, saved plans — needed to live in MongoDB alongside the rest of the application data.

The solution was a sync mechanism: when a user signs up through Firebase, a corresponding MongoDB document is created with the Firebase UID as the primary key. On every authenticated request, the Express middleware verifies the Firebase token and attaches the user's MongoDB profile to the request object. This hybrid approach gave me the security of Firebase with the flexibility of MongoDB.

Rate Limiting: Protecting the API

Since the app makes calls to an external AI API (which costs money per request), I needed robust rate limiting. I used Express Rate Limit with a custom key generator based on the authenticated user's ID rather than IP address. This prevents abuse while ensuring legitimate users don't get blocked when sharing a network (like a college Wi-Fi).

I set limits at both the route level (e.g., 10 AI generations per hour per user) and the global level (overall request throttling) to balance usability with cost control.

The Progress Dashboard

The progress-tracking dashboard was where Tailwind CSS and Framer Motion really shined. I built animated progress bars that smoothly fill as users mark chapters as completed, streak counters that celebrate consistency, and a visual reading timeline that shows their journey over weeks and months.

Small details mattered here. A confetti animation when completing a book. A gentle bounce effect on streak numbers. A smooth page transition when navigating between sections. These micro-interactions don't add "features" in the traditional sense, but they make the app feel polished and enjoyable to use — which directly impacts whether users keep coming back.

What I Learned

Building Gyan Manthan taught me lessons that no tutorial or course could:

  • Ownership changes everything. When the entire project is your responsibility — architecture, code quality, deployment, bug fixes — you think differently. You write better code because you know you'll be the one debugging it at 2 AM.
  • Shipping beats perfection. My initial plan had 15 features. I shipped with 7 core features that worked flawlessly. The remaining features would have delayed the launch by weeks without meaningfully improving the user experience.
  • AI integration is about engineering, not magic. The AI model is just one piece. The real work is in prompt engineering, error handling, fallback mechanisms, response parsing, and creating a smooth UX around inherently unpredictable AI outputs.
  • Security is non-negotiable. Rate limiting, input validation, CORS configuration, environment variables for secrets — these aren't optional extras. They're foundational requirements.

Final Thoughts

My IBM internship was a turning point in my development career. It transformed me from someone who could build projects into someone who could architect, build, and ship production-quality applications. Gyan Manthan isn't just a line on my resume — it's proof that I can take an idea from zero to deployment, handling every challenge along the way.

If you're a student looking for internship opportunities, my advice is simple: don't wait for the "perfect" opportunity. Apply broadly, learn voraciously, and when you get your shot, pour everything you have into it. The skills you build under real-world pressure are worth more than any certification.