Experimenting with Gemini: Build a Typing Test App from Scratch (Free Ebook + Source)

By Lufti Nurfahmi

  • Playground / Experiment

Experimenting with Gemini: Build a Typing Test App from Scratch (Free Ebook + Source)

 

From Idea to App: My Playground Building a Typing Test with Gemini

As a developer, I'm always looking for smarter ways to build. Recently, I tackled a simple experiment: a typing speed test web app. But here's the twist: I built it by collaborating directly with Gemini, Google's AI model.

This isn't about AI taking over; it's about AI becoming an incredibly powerful coding partner, boosting what developers can do. Let me walk you through how I used Gemini AI to build a typing test app, step by step.

Starting Strong: Laying the Foundation

Every app begins with an idea. For me, it was a clean, Google-like typing test. I needed an input field, some text, and a minimalist look.

Gemini instantly delivered the core HTML, CSS, and initial JavaScript. This meant no tedious setup; I jumped straight into building. It was like having the basic blueprint handed to me, ready for action.

Making It Work: The Core Logic

With the structure in place, it was time to make the app functional. I needed to show text, compare user input, give instant visual feedback, and calculate speed.

Gemini handled the intricate JavaScript. It wrote the code to display each character individually, compare my typing, and show green for correct, red for wrong. It also laid the groundwork for WPM and accuracy calculations. It felt like true pair programming, with Gemini acting as an AI-powered coding assistant while I guided the overall features.

Stepping Up: Multi-Line & Animations

A single line felt too basic. I wanted multi-line tests, advancing with the Enter key, and a smooth visual entry for new text.

Gemini quickly adapted the code. It restructured the test text into multiple lines and handled the Enter key's function. The coolest part? It seamlessly added CSS animations so each new line faded in with a subtle flair. The app instantly looked more polished.

Customizing the Look: Dark/Light Mode

Good user experience means personalization. Dark mode was a must, toggled by a sleek circular button.

Gemini efficiently set up CSS variables for colors, making theme switching a breeze. It also provided the JavaScript to control the theme and even saved my preference for next time. Gemini managed all the detailed styling, letting me focus purely on the user's interaction.

Clean Icons: Swapping to SVG

I prefer minimal external dependencies. So, I decided to replace the icon library with direct SVG code.

Gemini swiftly swapped out the old icons with inline SVG. It adjusted the JavaScript to toggle their visibility directly. This small change meant a cleaner, faster app without extra library bloat. It's these kinds of optimizations that an AI coding partner like Gemini handles perfectly.

Typing Freely: The Free Play Mode

What if someone just wanted to type without a predefined test? A "Free Typing" mode was essential. This was a big change in logic, as there was no "correct" answer to compare.

This is where Gemini truly excelled. It helped me design a separate mode, distinct from the test. Instead of fixed text, the preview now mirrored exactly what I typed in real-time, all while constantly tracking my WPM. It was impressive how Gemini helped navigate this entirely new functionality in this typing test app experiment.

Seeing Every Detail: Visual Newlines

Using Free Typing mode, I noticed hitting "Enter" cleared the input but didn't visually show a line break in the preview. I wanted to see that specific key press.

Gemini perfectly nailed this subtle request. It refined the Free Typing logic to clear the input, then, importantly, render a small '↵' symbol in the preview every time "Enter" was pressed. This gave immediate, clear feedback for every keystroke, making the experience incredibly intuitive.

My Conclusion: A New Way to Build

Building this typing test app with Gemini wasn't just about getting code; it was about a collaborative coding journey with AI. Gemini proved to be:

  • A Jumpstarter: Kicking off projects instantly.
  • A Logic Partner: Structuring complex features.
  • A Detail Finisher: Polishing UI and UX.
  • A Problem Solver: Adapting and refining as we went.

This project showed me that Gemini isn’t just a coding tool; it's a powerful extension of a developer's capabilities. It frees us from repetitive tasks, helps overcome coding blocks, and lets us deliver more refined features, faster.

📘 Download Ebook + Source

If you're curious about the exact prompts I used, and want to see the full working code of this typing speed test web app, I’ve packaged everything into a downloadable resource.

📥 Click here to download the free ebook + source code

  • ✔️ PDF Ebook: “Collaborative Coding: Building a Typing Test Web App with Gemini”
  • ✔️ Source Code Chapter by Chapter
  • ✔️ Final Code with Multi-line Mode, Dark Mode & Free Play

Enjoy experimenting with Gemini, and happy building!