StrawberryTech is a collection of small web games built with React, TypeScript and Vite. Each game adapts content based on the player's age, which is stored locally so progress persists between sessions.
:)
Discover how AI predicts the next word by choosing the best completion.
Swap adjectives to explore how word choice affects tone. Matches award points and may show leadership tips that vary by age group. Scores and badges are saved for later.
A short quiz where you spot the single AI hallucination hidden among two truthful statements.
Master the art of breaking complex tasks into sequences of simple, effective prompts. Learn how each prompt can build on the previous response for better AI results.
Drag cards to assemble a prompt. Each round now fetches fresh card text from the OpenAI API and shows a short sample response after you build the recipe.
- Players can optionally enter their age and name to personalize the games.
- Games read the stored age to tweak difficulty and show tailored tips.
- AI-generated hints and chat responses adapt tone for each age group.
- On easy difficulty, older players automatically receive extra time for tasks (5s at 40+, 10s at 50+, 15s at 60+).
- Points and badges now sync to a small server so progress follows you across devices.
- High contrast theme preference persists via
ThemeToggle. - A unified leaderboard with tabs displays top points for every game.
- A dedicated Badges page lets you track all achievements.
- A hidden
/statspage displays server-recorded metrics, while page views are automatically tracked by Vercel Analytics. - A prompt library lets everyone browse shared prompts by category and submit their own ideas.
- A community feedback page highlights positive comments from players.
- Install dependencies and start the dev server:
cd learning-games npm install npm run dev - In a separate terminal start the API server to persist user info,
community posts and shared high points:
cd server npm install npm start - Copy
.env.exampleto.envinsidelearning-gamesand fill in your keys.VITE_API_BASEdefaults tohttp://localhost:3001and the Vite dev server proxies/apirequests there automatically. ProvideVITE_OPENAI_API_KEY=<your key>for the Robot chat and recipe features. - Copy
.env.exampleto.envinnextjs-appand setNEXT_PUBLIC_API_BASE,NEXT_PUBLIC_OPENAI_API_KEY,OPENAI_API_KEYand your Firebase keys. The public Firebase values are prefixed withNEXT_PUBLIC_so they can be loaded by the browser:
NEXT_PUBLIC_FIREBASE_API_KEY=your-firebase-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-firebase-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-firebase-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your-measurement-idLeaving these blank causes 500 errors from the API routes. See
server/.env.example for reference.
5. Open the printed URL in your browser.
Node 18+ is recommended. Major dependencies include React 19, React Router 7, Vite 6 and TypeScript. Toast notifications are provided by react-hot-toast and unit tests use vitest.
npm run lintchecks code style with ESLint.npm run testruns the Vitest unit tests.npm run buildcreates a production build indist/.
Before executing the test suite make sure dependencies are installed:
cd learning-games
npm install
npm testWithout installing the packages first the vitest command used by
npm test will not be available and the tests will fail.
Page views are now logged automatically by Vercel Analytics.
The server still stores its own metrics in Firebase Firestore; open the hidden
/stats page while the server is running to see counts of page views, unique visitors
and average session length.
RobotChat and the Prompt Recipe Builder use the OpenAI API. Create a .env file inside learning-games containing:
VITE_OPENAI_API_KEY=your-keyThe community feedback page uses the same API for sentiment filtering. Set
OPENAI_API_KEY in the server environment so posts can be screened before
publishing.
To point either frontend at a custom server URL set NEXT_PUBLIC_API_BASE
in nextjs-app/.env or VITE_API_BASE in learning-games/.env. These must
be the backend URL when the frontend and API run on different hosts. If these
variables are omitted each app makes relative requests to /api/..., which only
works when the API is served from the same host or proxied.
Sample .env.example files in each app illustrate this configuration.
These now contain placeholder values so you can copy them directly and replace
each key with your own credentials.
For Firebase Analytics in the Next.js app, also include the following variables:
NEXT_PUBLIC_FIREBASE_API_KEY=your-firebase-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-firebase-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-firebase-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your-measurement-idThe API server now persists data in Firebase. Provide service account credentials
by setting FIREBASE_SERVICE_ACCOUNT to a JSON string or path, or use
GOOGLE_APPLICATION_CREDENTIALS to point to a credentials file.
Without this key, the RobotChat and recipe features will not work.
This project is released under the MIT License. Contributions are welcome under the same terms.