Inspiration

I'm a Flutter and Firebase developer based in Uttar Pradesh, and every year I watch people around me prepare for government recruitment exams like UP Home Guard, UP Police, CRPF, and others. The written exam gets most of the attention, but for many candidates the Physical Efficiency Test is what actually decides whether they get selected.

When I started looking for an app built specifically for PET preparation, I couldn't find one. Generic fitness apps like Strava, Nike Run Club, and Garmin are great at tracking runs, but they don't understand what "qualifying" means for different government recruitment exams. They also aren't designed around the edge cases that matter when your goal isn't general fitness—it's passing a strict physical test with a hard distance and time requirement.

That felt like a real problem worth solving.

What it does

PET Coach is an AI-powered physical test coach built for candidates preparing for Indian government recruitment Physical Efficiency Tests.

The user selects their target exam, and the app loads the official PET standard for that recruitment. During training it tracks distance, pace, elapsed time, and movement in real time using GPS together with the phone's accelerometer. At the end of each session it calculates—deterministically—whether the candidate would qualify based on the selected exam's official requirements.

Beyond tracking, PET Coach provides AI-generated coaching feedback, personalized 7-day training plans, recovery monitoring, qualification readiness, progress analytics, voice coaching during runs, offline synchronization, and leaderboards.

It currently supports:

UP Home Guard UP Police SSC GD Delhi Police CRPF CISF BSF Army Agniveer

How we built it

PET Coach was designed and built with OpenAI Codex, using GPT-5.6 Terra throughout development. I built the project in one continuous Codex session, which meant the model retained context from the initial architecture decisions all the way through the final bug fixes and refinements. The application itself is built with Flutter using GetX, backed by Firebase Authentication, Cloud Firestore, and Cloud Functions.

The AI layer is provider-agnostic. Gemini 3.1 Flash-Lite is the default coaching model in the current build because it offers fast responses for mobile users, while GPT-5.6 Luna is available as an optional provider through the same interface. Swapping providers doesn't require rewriting the application because both implementations sit behind a shared abstraction. The hardest part of the project turned out not to be AI—it was reliably telling whether someone was actually running.

My first implementation relied entirely on GPS speed. On paper it looked fine, but the first real-world test immediately exposed the problem. I sat completely still with the tracker running, and after a few moments the app confidently decided I was running. GPS drift, especially at low speeds or indoors, can easily look like movement if you rely on it alone.

After researching how modern running applications approach low-speed tracking, I redesigned the entire detection pipeline around the phone's accelerometer. Step cadence became the primary signal, while GPS became a secondary validation layer that rejects false running transitions caused by noisy sensor readings. That architecture proved far more reliable during field testing.

Challenges we ran into

Most of the important fixes only appeared after I started testing outdoors on a real phone. Getting the app to compile was the easy part; getting it to behave reliably in real-world conditions was much harder.

The GPS drift issue was only discovered because I deliberately left the tracker running while sitting completely still. Later, outdoor testing exposed another bug where movement transitions were being confirmed after a single detection instead of the intended two-step debounce. I only found that by comparing diagnostic logs against what I had actually done during the run.

Another important design decision was separating deterministic logic from AI.

The qualification result—the one that determines whether a candidate passed the PET standard—is calculated server-side using straightforward arithmetic against the official exam requirements. GPT-5.6 and Gemini generate coaching feedback, recovery suggestions, and training plans, but they never decide whether someone passed or failed.

If the qualification result is ever wrong, it should be because my logic is wrong—not because a language model hallucinated a pass.

Accomplishments that we're proud of

The feature I'm most proud of is the walk/run detection system.

It didn't end up working because the algorithm looked good on paper—it works because it went through multiple rounds of real-device testing, debugging, and refinement until the diagnostic logs matched what was actually happening during a run.

I'm also proud that the qualification system remains completely deterministic, while still taking advantage of AI where it actually adds value. Coaching, planning, and recovery benefit from large language models, but qualification and leaderboard integrity never depend on one.

Finally, building the AI layer behind a provider abstraction means the application can switch between Gemini and GPT-5.6 without changing the rest of the codebase.

What we learned

The biggest lesson from this project was that real-world testing uncovers problems that code review alone never will.

Both the GPS drift issue and the debounce bug only appeared after repeated outdoor testing with actual devices and diagnostic logs.

I also learned that deciding where not to use AI can be just as important as deciding where to use it. Large language models are excellent for personalized coaching and explanations, but some decisions—like determining whether someone qualified for an official physical test—are better handled with deterministic logic.

What's next for PET Coach

There's still plenty I'd like to do before calling PET Coach production-ready.

The roadmap includes smartwatch and heart-rate integration, an iOS release, a dashboard for trainers managing multiple candidates, improved onboarding, analytics, crash reporting, Firebase App Check, encrypted local storage, and additional production hardening.

The long-term goal is to make PET Coach the training companion that government recruitment candidates can rely on from their very first practice run until the day they clear their physical test.

Built With

Share this project:

Updates