How mikevetkin/doors-of-durin works
This is a small React application built around the Doors of Durin puzzle: visitors enter a code and name, submit them, and the app determines whether they are welcomed as a friend or remain a stranger. A reducer owns form, traveller, and light state; presentation modules turn that state into page view states. The UI also presents Tengwar and Ithildin effects. The README describes only a Vite template, so product capabilities are inferred from the source tree and excerpts; unsampled links are omitted where evidence is unavailable.
Main entry points: DoorsOfDurinReducer.ts Puzzle reducer · App.tsx App · useDoorsOfDurin.ts Puzzle hook · index.tsx Door form page
Components 23
Application flow
- React entry
src/main.tsx - App
src/App.tsx - Puzzle hook
src/context/moria/feature/doors-of-durin/ui/hook/useDoorsOfDurin.ts
Door domain
- Puzzle reducer
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Puzzle state
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinState.ts - Puzzle events
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinEvent.ts - Code validation
src/context/moria/feature/doors-of-durin/domain/entity/code/Code.ts - Name validation
src/context/moria/feature/doors-of-durin/domain/entity/name/Name.ts - Traveller types
src/context/moria/feature/doors-of-durin/domain/entity/traveller - Form model
src/context/moria/feature/doors-of-durin/domain/entity/form - Light types
src/context/moria/feature/doors-of-durin/domain/entity/light
Pages and presentation
- App presentation
src/AppPresentation.ts - Door presentation
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/DoorsOfDurinPresentation.ts - Door view state
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/DoorsOfDurinViewState.ts - Door form page
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/index.tsx - Welcome presentation
src/context/moria/feature/doors-of-durin/ui/pages/WelcomeToMoria/WelcomeToMoriaPresentation.ts - Welcome view state
src/context/moria/feature/doors-of-durin/ui/pages/WelcomeToMoria/WelcomeToMoriaViewState.ts - Welcome page
src/context/moria/feature/doors-of-durin/ui/pages/WelcomeToMoria/index.tsx
Shared visual features
- Light interpretation
src/shared/Ithildin/domain/lib/handleLight.ts - Ithildin display
src/shared/Ithildin/ui/components/Ithildin/index.tsx - Tengwar display
src/shared/tengwar/ui/components/Tengwar/index.tsx - Form controls
src/components/ui/button.tsx
Other components
- Visitor
Connections 23
- Visitor → React entry: opens app
- React entry → App: renders
src/main.tsx - App → Puzzle hook: uses state
src/App.tsx - App → Door form page: renders
src/App.tsx - App → Welcome page: renders
src/App.tsx - Puzzle hook → Puzzle reducer: dispatches
src/context/moria/feature/doors-of-durin/ui/hook/useDoorsOfDurin.ts - Puzzle hook → Puzzle state: initializes
src/context/moria/feature/doors-of-durin/ui/hook/useDoorsOfDurin.ts - Puzzle hook → App presentation: presents state
src/context/moria/feature/doors-of-durin/ui/hook/useDoorsOfDurin.ts - Puzzle reducer → Puzzle events: handles
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Puzzle state → Form model: contains
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinState.ts - Puzzle reducer → Code validation: validates
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Puzzle reducer → Name validation: validates
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Puzzle reducer → Traveller types: creates traveller
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Puzzle reducer → Light interpretation: checks light
src/context/moria/feature/doors-of-durin/domain/functional-core/DoorsOfDurinReducer.ts - Light interpretation → Light types: matches types
src/shared/Ithildin/domain/lib/handleLight.ts - App presentation → Door presentation: selects view
src/AppPresentation.ts - App presentation → Welcome presentation: selects view
src/AppPresentation.ts - Door presentation → Door view state: builds view state
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/DoorsOfDurinPresentation.ts - Door form page → Form controls: renders controls
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/index.tsx - Door form page → Ithildin display: renders text
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/index.tsx - Door form page → Tengwar display: renders script
src/context/moria/feature/doors-of-durin/ui/pages/DoorsOfDurin/index.tsx - Welcome presentation → Welcome view state: builds view state
src/context/moria/feature/doors-of-durin/ui/pages/WelcomeToMoria/WelcomeToMoriaPresentation.ts - Welcome page → Welcome view state: displays
src/context/moria/feature/doors-of-durin/ui/pages/WelcomeToMoria/index.tsx