Skip to content
Dimitri Robiere PerrietD. R. PerrietCaen, FR — --:--:--EN · FR

MyCampusQuest, a Next.js treasure hunt PWA

○ Archived
Client
MyDigitalSchool
Role
Full-stack developer
Duration
7 weeks
Year
2024
Stack
Next.js · PWA · Clerk · MongoDB · Tailwind CSS · localForage · Vercel
MyCampusQuest, a Next.js treasure hunt PWA — illustration
Fig. 01 — MyCampusQuest, a Next.js treasure hunt PWA, illustration
(00) — In short

MyCampusQuest is a Next.js Progressive Web App treasure hunt: students scan QR codes around campus to complete quests, with location checks and offline support.

(01)

Context

MyCampusQuest is a treasure hunt PWA that turns exploring a campus into a game: quests are tied to places, and students complete them by scanning the QR code posted on site. The project was built during a course module on Progressive Web Apps.

The app therefore had to behave like an installed mobile app while remaining a Next.js site deployed on Vercel.

(02)

Challenge

A treasure hunt means moving around, often through corridors or buildings with poor reception. Completing a quest could not depend on the connection.

Cheating also had to be prevented: a quest only counts if you are actually near the spot, and the same quest cannot be counted twice.

(03)

Approach

I set the app up as a PWA and wired QR code scanning to the phone’s rear camera. On each scan, the user’s position is compared with the quest’s using geolib, within a one-kilometre radius, then progress is saved to MongoDB. Authentication is handled by Clerk.

Offline, completions are cached with localForage and synced as soon as the connection returns; the location check is skipped in that case. I also added push notifications (including on Safari), a dark mode and a contact form.

(04) — Results

Key figures
7
weeks of development
43
commits
1 km
quest completion radius
yes
offline support
← Previous project26 · 1’Vendu, an anti-waste produce platform in Next.jsNext project28Video game character chatbot with the OpenAI API