Skip to content

cheongalc/LunaWrite

Repository files navigation

LunaWrite

LunaWrite is Team stealzamoon's entry to CMU TartanHacks 2025.

It is a language-learning platform that trains creative and critical thinking through collaborative storytelling. Users co-write stories with an LLM, taking turns sentence by sentence in their target language while receiving lightweight feedback and vocabulary support.

Live Demo

GitHub Pages deployment

The Problem

It is easy and tempting to outsource intelligence to GenAI. We are concerned that users may become reliant on the technology for creative and critical thinking, resulting in the degradation of their writing abilities.

Some choose to reject the technology due to its risks. We take a different approach. Rather than shun GenAI, we believe that it can be wielded as an educational tool to enhance, rather than deteriorate, the user's writing facility.

The Solution

An AI-powered writing and language-learning platform that lets users choose their own literary adventure.

Instead of asking the model to do all the writing, LunaWrite makes the learner participate. The AI advances the story, but the user must actively produce language, incorporate vocabulary, and respond to feedback in context. That turns GenAI from a shortcut into a practice partner.

What LunaWrite Does

  • Lets learners choose a learning language, native language, and proficiency level.
  • Starts a story with an LLM and continues it collaboratively, one sentence at a time.
  • Encourages active recall by giving learners target vocabulary to work into their writing.
  • Checks user-written sentences for language issues before continuing the story.
  • Lets users click words in the story or sidebar to get definitions and context-aware explanations.
  • Tracks vocabulary familiarity over time and surfaces it in a vocabulary explorer.
  • Stores stories and progress locally in the browser, making the app lightweight and easy to deploy.

Why This Works As A Learning Tool

LunaWrite is grounded in the idea that meaningful learning requires output, not just passive intake. Reading explanations alone is not enough; learners improve when they have to retrieve, apply, and revise knowledge in context. Collaborative storytelling creates that output loop while keeping the experience playful and motivating.

Tech Stack

  • React + Vite
  • Tailwind CSS
  • OpenRouter for low-cost LLM access
  • Browser localStorage for local persistence
  • GitHub Pages for static hosting

Running Locally

Prerequisites

  • Node.js 20+
  • pnpm
  • An OpenRouter API key

Setup

pnpm install
pnpm dev

Then open the local Vite URL, open settings inside the app, and provide:

  1. An OpenRouter API key
  2. A learning language
  3. A native language
  4. A proficiency level

Available Scripts

  • pnpm dev starts the local development server.
  • pnpm build creates a production build in dist/.
  • pnpm preview serves the production build locally.
  • pnpm lint runs ESLint.
  • pnpm test runs the Jest test command and passes cleanly when no tests are present.

Deployment

This repo is configured to deploy to GitHub Pages via .github/workflows/deploy.yml.

On each push to main, GitHub Actions:

  1. Installs dependencies with pnpm
  2. Lints the app
  3. Builds the static site with Vite
  4. Publishes dist/ to GitHub Pages

The production build uses relative asset paths so it works correctly on GitHub Pages project URLs such as /lunawrite/.

Notes

  • LunaWrite is a browser-first prototype with no backend.
  • Stories, vocabulary progress, and settings are stored locally in the user's browser.
  • The OpenRouter API key is also stored locally in the browser for this prototype, so it is best used with a personal key that has appropriate spending limits.

Feasibility & Potential

  1. Highly scalable.
  2. Lightweight and low cost: OpenRouter is inexpensive, and the app only sends short text requests.
  3. Grounded in research on learning theory: learners need to produce output, not just ingest content.

Future Work

  1. Enhanced spaced repetition algorithm.
  2. Sharing of stories.
  3. User progress map.

References

About

LunaWrite is a language learning platform that trains creative and critical thinking through collaborative storytelling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors