Personal project | Live and open to the public
Doubles Flow
This site teaches positioning to recreational badminton doubles players. Overhead court diagrams show what each partner does on each shot, step by step. Players can try the optional practice questions whenever they want to check their understanding. I planned the lessons and built the interface and offline setup on my own.
Open Doubles FlowProblems to solve
- Recreational doubles players often memorize rotation rules without knowing when to stand front and back or side by side after each shot.
- Text alone cannot easily show where partners stand relative to each other or when they move. Players need diagrams they can follow step by step.
- Lessons should start with safety and court etiquette, then move from basic coverage to rallies with several shots.
- Players who want to check their understanding need practice questions they can try without finishing the lessons first.
- The connection can be unreliable at the court. The site needs to open offline, and updates must not interrupt a lesson.
System design
- Content: ② The lesson structure organizes ① lesson data into five levels and question chapters.
- Playback: ③ The app uses the URL to load a demo and passes it to ④ the court diagrams for step-by-step playback.
- Offline: ⑤ Static hosting serves the site. ⑥ The Service Worker pre-caches lessons so they can open offline later. A new version only takes effect after the user confirms.
- Progress: ③ The app saves answers and the current position to ⑦ local progress without sending anything to a server.
Parts
Lessons
- ① Lesson data
Each demo, question, and etiquette example uses typed data. This includes all four player positions, the shuttle path, notes for each step, and examples to compare. There are 6 etiquette examples, 22 demos, and 42 practice questions.
TypeScript
- ② Lesson structure
The demos have five levels: basic coverage; serve, return, and third shot; keeping the attack; defense and transitions; and putting it together in longer rallies. A demo can link to a similar scenario with different conditions. Questions are grouped by chapter, but players can choose any question.
TypeScript, Vitest
Interface
- ③ Lesson and practice app
The app has a lesson index, demo pages, practice questions, and a Q&A. Hash routing keeps the current demo and step in the URL. Players can share a link to that step without sharing their answers.
Vue 3, TypeScript, Vite
- ④ Court diagrams
SVG shows the court from above. Dashed lines show the shuttle path, solid lines show player movement, and faded markers show starting positions. Curved lines show high shots and straight lines show flat shots. Color and hatching mark which areas each partner should cover first. Demos can play through or step by step.
Vue single-file components, SVG
Hosting and storage
- ⑤ Static hosting
The app is built and deployed as a static site. The home page, Service Worker, and manifest are not cached. Other assets use content hashes for long-term caching.
Vercel
- ⑥ Offline use and updates
The app pre-caches all lessons so it works offline after the first visit. Players can add it to their home screen. After a new version downloads, the app asks before switching. An update can be marked as required when needed.
vite-plugin-pwa, Workbox
- ⑦ Local progress
Answers, drafts, and the current place in a lesson stay in the browser and are not uploaded. Progress records include the content version. An old tab does not overwrite progress saved by a newer one.
localStorage, versioned data format
Testing, deployment, and operations
- Vitest covers routing, reading and saving progress, drafts, lesson structure, and lesson annotations. The tests cover progress across content versions and browser tabs.
- When I changed a diagram, I opened it at phone and desktop widths to check that the shuttle paths, markers, and court lines did not cover each other.
- I tried 3D characters and animations, then went back to 2D overhead diagrams so the lessons could focus on positioning and how partners share the court.