Early prototype of a lateral-thinking-puzzle community app.
- Stack: Express.js • Handlebars • MongoDB • Passport.js
- Focus: Core puzzle submission, solution tracking, and session-based auth
- Status: The current production version (Next.js, Auth.js, MongoDB) is live at slowsoup.app
If you’d like to browse the code without cloning locally, you can open this repo in GitHub Codespaces
- Click Code ▸ Codespaces ▸ Create codespace on main
(or the “Open in Codespaces” button if you see one) - Wait for Codespaces to finish setting up — you’ll be automatically redirected to the demo website once it’s ready.
Lateral Thinking Puzzles is now becoming one of the most popular party games in China, but it is lack of modernized support. The game itself requires:
- a pre-written plain-text puzzle consisted of
- a mystery
- a corresponding truth
- player(s) that:
- ask yes/no question based on the mystery
- guess the solution based on known information
- a judge that
- answer question by: yes/no/irrelevent
- compare the solution to the truth... end the game if the truth has been found
Slow Soup aim to provide a online platform for
- puzzle writers to share their works to the world
- player(s) to solve the shared puzzles by interacting with the AI judge supported by LLM
The application will store User, Puzzle, PlayRecord, Liked, Saved, Favorites
All relations will be done via referencing. Liked, Saved, and Favorites will share the same schema called bookmark.
UserPuzzle- have reference(s) to User
User&Puzzle: One to Many- a
Puzzlehas oneUseras the author - a
Usermay have 0 to manyPuzzleas one's work
- a
PlayRecord- have reference to
UserandPuzzle PlayRecord& (Puzzle+User): One to one- Record will be updated if
Userplays the samePuzzleagain (instead of adding a newPlayRecord)
- have reference to
- bookmark (
Liked/Saved/Favorites)- have reference to
UserandPuzzle - bookmark & (
Puzzle+User): One to One - bookmark will be updated if modified by
User(instead of adding a new bookmark)
- have reference to
An Example User:
{
username: "soupmaker",
email: "[email protected]",
hash: // a password hash,
}An Example Puzzle with references to User (puzzle example retrieved from https://en.wikipedia.org/wiki/Situation_puzzle#Example):
{
title: "Example Puzzle From Wikepedia",
mystery: 'A man walks into a bar, and asks the bartender for a drink of water. The bartender pulls out a gun, points it at the man, and cocks it. The man pauses, before saying "Thank you" and leaving. What happened?',
truth: "The man had the hiccups, and his reason for requesting a drink of water was not to quench his thirst but to cure his hiccups. The bartender realized this and chose instead to cure the hiccups by frightening the man with the gun. Once the man realized that his hiccups were gone, he no longer needed a drink of water, gratefully thanked the bartender, and left.",
author: // reference to User
createdAt: // timestamp
}An Example PlayRecord with references to User and Puzzle
{
puzzle: // reference to Puzzle,
player: // reference to User,
attemptsUsed: 32,
secondsUsed: 602,
createdAt: // timestamp,
}An Example (Favorites / Liked / Saved) with references to User and Puzzle
{
puzzle: // reference to Puzzle,
player: // reference to User,
createdAt: // timestamp,
}/ - page for showing all shared puzzles
/create - page for creating and sharing a new puzzle
/puzzle/:title - page for playing specific puzzle
/login - page for login
/signup - page for login
user/:username - page for my profile
user/:username/favorites - page for viewing puzzles marked as favorites
user/:username/liked - page for viewing puzzles liked
user/:username/saved - page for viewing puzzles saved
- as non-registered user, I can register a new account with the site
- as a user, I can log in to the site
- as a user, I can create a new puzzle
- as a user, I can view all of the puzzles
- as a user, I can play any puzzle with the judge
- as a user, I can like a puzzle
- as a user, I can mark a puzzle as Favorites
- as a user, I can save a puzzle for later
- (2 points) Test, compare, and decide the best LLM as the judge
- prioritize the cost - free for decent amount of requests
- capable of performing the required functionalities
- https://github.com/cheahjs/free-llm-api-resources
- (4 points) Implement "the judge" using the API key of the selected LLM
- enforce it's functionalities by prompt engineering
- answer and only answer by yes/no/irrelevent
- decide if the guessed solution is close enough to the truth
- (optional) give content warning without giving away the answer
- https://www.geeksforgeeks.org/create-working-chatbot-in-html-css-javascript/
- enforce it's functionalities by prompt engineering
- (4 points) Use passport.js to implement authentication
- (4 points) Perform email verification code
- Incorperate into
- the sign up process
- reset my password
- https://www.geeksforgeeks.org/email-verification/
- Incorperate into
- (4 points) Perform plagerism check using the Grammarly API key
- Prevent user from plagerising puzzles
- avoid copyrights issues
- https://developer.grammarly.com/plagiarism-detection-api.html
10 points total out of 8 required points (addtional points will not count for extra credit)
ps: I want to start working on the frontend with react during the summer, so I used the backend & frontend folder structure. But frontend may be empty till the course ends...









