
Full Stack Challenge: LoreForge – Forge an Alternate History of Sengoku Japan
LoreForge lets players co-create alternate histories of Sengoku Japan, then turns those community-written stories into playable quizzes with Amazon Bedrock. A Lore Compass guides players toward regions that still need new stories.
Live App: https://main.d1t2bn8cyrxz41.amplifyapp.com/ GitHub: https://github.com/okajun35/LoreForge Challenge Word:Compass
From “Compass” to LoreForge
The Full Stack Challenge starts with a random word from the PartyRock word generator and asks us to turn that prompt into a full-stack application within 48 hours.
My word was
Compass .My first idea for LoreForge was much broader: a collaborative fantasy worldbuilding platform where players could create maps, factions, lore, and branching legends, then play quizzes and quests generated from the world they had created together.
The core of the original pitch was:
LoreForge - Build the world. Play the myth. A collaborative worldbuilding platform where players co-create living fantasy universes, then challenge each other with trivia and quests born from their own creations.The Lore Compass tracks which parts of the shared universe have already been explored and which remain unwritten, then points players toward the next place that needs a story.
I wanted to keep the idea that a compass could guide players toward unwritten parts of a shared world.
But building a World Atlas Editor, faction system, voting, branching lore, and real-time collaboration in 48 hours would have spread the project too thin.
So I narrowed the idea from a general fantasy universe to something much more concrete:
Collaborative alternate history set in Sengoku Japan.
What Is LoreForge?
LoreForge is a collaborative alternate-history app where players create another version of Sengoku-era Japan and then play quizzes generated from that fictional history.
A player selects a region of Japan and writes a short piece of alternate history, for example:
In 1573, Takeda Shingen survives his illness and continues his campaign west.
Or:
After unifying Kyushu, the Shimazu clan begins an invasion of western Honshu.
LoreForge does not try to correct these stories using real history.
The lore written by the player is the source of truth for that fictional timeline.
Amazon Bedrock then generates a quiz from the submitted lore, allowing another player to challenge the history created by the community.
The core loop is intentionally simple:
Map
↓
Choose a Region
↓
Forge Lore
↓
Shared Persistence
↓
Amazon Bedrock Quiz
↓
Another Player Challenges It
The Lore Compass

The challenge word
Compass became a real product mechanic: the Lore Compass.Sengoku Japan is divided into eight gameplay regions:
- Kyushu
- Chugoku
- Shikoku
- Kinai
- Tokai & Koshin
- Kanto
- Hokuriku
- Tohoku
The Lore Compass compares the number of lore entries in each region and points players toward one of the least-developed regions.
For example:
Kyushu needs its next story.
This turns the compass from a decorative theme into a way to guide collaborative worldbuilding.
Instead of pointing north, it points toward the part of the world that still needs a story.



From the Original Idea to a 48-Hour MVP
The original LoreForge concept included:
- World Atlas Editor
- Faction Rivalry Engine
- Lore Compass
- Lore Gauntlet
- Branching legends
- Real-time collaboration
But the goal of this challenge was not to finish a feature checklist. It was to move through the full product journey pitch, prototype, MVP, UX, and launch within a very small timebox.
So I deliberately removed:
- Free-form world map editing
- Faction creation and membership
- Voting on canonical lore
- Authentication
- Real-time synchronization
- Multiple worlds
- Rankings
- Persistent player scores
And I kept:
- A fixed interactive map of Japan
- Eight selectable regions
- Community lore posting
- Shared persistence
- Lore Compass
- Bedrock-generated quizzes
- Region Lore Gauntlet
- A public AWS deployment
Instead of building a map editor, I used a CC0 SVG map of Japan and grouped modern prefectures into eight gameplay regions.
That let me spend time on the product's main loop:
Choose a place → write history → turn it into something another player can play.
The Full Stack Journey
Pitch
Starting from
Compass , I explored the idea of a collaborative world where the application guides users toward areas that have not been written yet.Prototype
I replaced the free-form fantasy map with a fixed map of Japan.
Using Sengoku Japan gave every player a shared context and made it much easier to understand what kind of story to write.
MVP
The first end-to-end flow I focused on was:
Japan Map
↓
Select Region
↓
Author Name + Lore
↓
Shared Database
↓
Generate Quiz with Bedrock
↓
Answer from Another BrowserThere is no authentication in the MVP. The author field is simply a display name.
UX
The interface is primarily English, with a visual direction inspired by Sengoku-era maps, dark ink, parchment, and gold accents.
Lore itself can be written in different languages. Bedrock is instructed to generate the quiz in the same language as the submitted lore.
Launch
The frontend is deployed with AWS Amplify Hosting.
Architecture
Because this is an AWS challenge, I kept the application on AWS except for Supabase, which is used only for shared persistence.
Browser
│
▼
AWS Amplify Hosting
│
▼
Amazon API Gateway
│
▼
AWS Lambda
├────────────── Amazn Brock
│
├────────────── AWS Secrets Manager
│
▼
Supabase
(shared persistence only)AWS Amplify Hosting
The frontend is built with Vite, React, and TypeScript and deployed through AWS Amplify Hosting.
Amazon API Gateway
API Gateway exposes the public HTTP endpoints used by the browser.
The main endpoints include:
GET /regions/stats
GET /regions/{regionId}/lore
POST /regions/{regionId}/lore
GET /lore/{loreId}/quiz
POST /lore/{loreId}/quiz
GET /regions/{regionId}/gauntlet
POST /gauntlet/questions/{quizId}/answerAWS Lambda
AWS Lambda handles input validation, lore publishing, quiz generation, region statistics, and the Gauntlet APIs.
The backend is written in TypeScript and runs on Node.js.
Amazon Bedrock
Amazon Bedrock turns submitted lore into a multiple-choice quiz.
One important prompt constraint is that the model must not use real Sengoku history as the answer key.
The model is instructed to:
- Treat the submitted lore as the only source of truth
- Never “correct” alternate history
- Avoid inventing facts that are not present in the lore
- Generate a question with one clear correct answer
- Generate the quiz in the same language as the lore
AWS Secrets Manager
The Supabase URL and Service Role Key are never exposed to the frontend.
Lambda retrieves them from AWS Secrets Manager, so AWS credentials, Supabase service-role credentials, and Bedrock configuration do not need to be shipped to the browser.
AWS SAM
I used AWS SAM to define the HTTP API, Lambda function, IAM permissions, and deployment configuration as infrastructure as code.
Why I Used Supabase
The only non-AWS runtime service in the architecture is Supabase, and I use it only for persistent shared data.
The 48-hour time limit strongly influenced this choice.
The persistent data needed by the app is relatively small:
- Lore
- Generated quizzes
- Supporting facts for cross-lore questions
I wanted to spend the challenge time on the actual gameplay loop rather than rebuilding persistence plumbing.
The rest of the application remains on AWS:
- Hosting → AWS Amplify
- Public API → Amazon API Gateway
- Backend → AWS Lambda
- Generative AI → Amazon Bedrock
- Secret management → AWS Secrets Manager
- Infrastructure as Code → AWS SAM
Keeping AI Outside the Lore Transaction
One technical decision I cared about was separating publishing lore from generating its quiz.
A simpler implementation might look like this:
Submit Lore
↓
Generate Quiz with Bedrock
↓
Save everything only if all steps succeedBut this means a temporary Bedrock error could cause the player's written lore to be lost.
Instead, LoreForge uses this flow:
Save Lore first
↓
Generate Quiz separatelyAI is useful, but an AI failure should not roll back the user's primary action.
Lore Gauntlet
LoreForge also includes a Region Gauntlet, which turns the saved quiz pool for a region into a short sequence of questions.
The Gauntlet does not call Bedrock when a player starts or answers it.
Generated quizzes are reused:
New Lore
↓
Quiz Generated Once
↓
Saved Quiz Pool
↓
Region Gauntlet
↓
Played Many TimesThis makes AI cost scale more closely with new community content, rather than with the number of game sessions.
The code also supports Cross Lore Quizzes generated from multiple same-region, same-language chronicles.
Instead of sending the entire lore collection to the model every time, the implementation extracts and reuses short facts.
Organizing the Code Around User Goals
I organized the code around three user goals:
explore-world
forge-lore
challenge-lore-
explore-world: map, region browsing, Lore Compass
-
forge-lore: lore input, publishing, quiz generation
-
challenge-lore: quiz and Gauntlet play
On the backend, domain rules are separated from the concrete Supabase and Bedrock integrations.
Even with the short development window, I used tests for the rules most likely to break the core experience:
- Lore input validation
- Region ID validation
- Lore Compass minimum-count selection
- Validation of generated quiz structure
- Reuse of an existing quiz instead of generating duplicates
The goal was not to build a large architecture for a small hackathon app, but to keep the boundaries that were likely to change clear.
Challenges and Trade-offs
1. The Original Idea Was Too Large
A full World Atlas Editor and Faction Rivalry Engine would not fit the timebox.
Decision:
Use a fixed map of Sengoku Japan and protect the core interaction instead.
2. AI Failure Should Not Break Publishing
Decision:
Persist lore before quiz generation.
3. AI Cost Should Not Scale with Plays
Decision:
Generate quizzes once, save them, and reuse them in the Gauntlet.
4. External Database Credentials Should Not Reach the Browser
Decision:
Keep the Supabase Service Role Key in AWS Secrets Manager and access it only from Lambda.
What I Learned
My biggest lesson was that protecting the original feature list is not the same as protecting the core product idea.
The first version of LoreForge had map editing, factions, voting, branching stories, and real-time collaboration.
The version I shipped protects one loop instead:
Map → Lore → Shared Data → Bedrock Quiz → Another Player
Once that loop worked end to end, the purpose of the product was already visible.
I also learned that adding generative AI does not mean calling a model on every interaction.
By separating generation from play and reusing generated results, the application can improve both UX and cost behavior.
Finally, this challenge reinforced my view that “full stack” is not about using as many services as possible.
It is about finishing the complete path from:
user action → API → persistence → AI processing → UI → public launch
as one working product experience.
Try LoreForge
LoreForge contains fictional, user-created alternate histories. Content may differ from real historical events.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article