Wensi is a lightweight starting point for Chinese writing. Enter a topic, keywords, and a few writing requirements to get an editable draft, an outline, and a character count. The current release is v0.1.0 Alpha/MVP: it defaults to a browser-local demo generator and does not require an account, backend, or network request.
Wensi is a writing starting point, not a replacement for the author or a finished-paper service. Use it to sketch a structure, try an expression, and get a draft you can revise. Add your own experiences, facts, and thinking so the final piece is genuinely yours.
- Generate a Chinese essay draft from a topic.
- Choose primary, middle-school, or high-school level, plus narrative, argumentative, expository, or prose genre.
- Adjust the target length (currently 300–1200 characters), keywords, tone, real-life material, and expression style.
- Switch among the editable draft, structure outline, and concrete revision suggestions.
- Copy the result, download it as TXT or Markdown, clear it, or generate another version while keeping the current settings.
- Keep up to six recent drafts in the current browser's
localStorage; there is no account or cross-device sync. - Responsive UI for desktop, tablet, and mobile screens.
- React 19 and TypeScript
- Next.js API / App Router compatibility
- vinext and Vite
- A build target for Cloudflare Workers
- Browser
localStoragefor local history only
Node.js 22.13 or newer is required.
npm install
npm run devOpen the local URL printed by the development server. Useful checks are:
npm run lint
npm run typecheck
npm test
npm run build
npm run startThe local demo mode needs no environment variables. You can copy .env.example for local configuration; do not commit the real .env file. The optional online mode is implemented server-side and requires the provider settings below.
| Variable | Example | Purpose |
|---|---|---|
WENSI_PROVIDER |
demo |
demo uses the local generator; openai-compatible enables the server-side model provider. |
WENSI_API_BASE_URL |
https://model.example/v1 |
Base URL for an OpenAI-compatible model service. |
WENSI_API_KEY |
replace-me |
Model-service secret; keep it on the server and never expose it to the browser. |
WENSI_MODEL |
your-model-name |
Model identifier used by the provider. |
WENSI_REQUEST_TIMEOUT_MS |
30000 |
Server request timeout in milliseconds. |
v0.1.0 defaults to the local demo; set WENSI_PROVIDER=openai-compatible and provide the required server-side settings to use a model service. Never put a real key in the repository, client code, or a variable prefixed with NEXT_PUBLIC_.
The online provider is available through the server-side /api/generate route. The flow is:
- The server reads
WENSI_PROVIDER,WENSI_API_BASE_URL,WENSI_API_KEY,WENSI_MODEL, andWENSI_REQUEST_TIMEOUT_MS. - The client submits the topic, keywords, and writing options to
/api/generate. - The server calls the configured model service and returns the result to the client.
This checkout still uses the local demo engine by default. When online mode is enabled, the server calls the configured provider's OpenAI-compatible /chat/completions endpoint. The topic, keywords, writing options, and any real experiences you enter are sent to the model service you configure. Review that service's privacy policy, logging, and retention rules first.
The route validates the request, applies a timeout, maps common provider failures (including rate limits and invalid keys), and cleans the model output before returning it.
Verify the local build first:
npm run buildvinext/Vite produces output aimed at Cloudflare Workers. Before deploying to your Cloudflare account, prepare Wrangler configuration for your account, domain, and bindings, then run the appropriate Wrangler deployment command, for example:
npx wrangler deployThe repository does not include account-specific secrets, domains, or production bindings. Confirm that Worker environment variables and model credentials exist only in server-side configuration.
- The default
demomode generates in the browser and does not upload writing content to a Wensi service. - Recent drafts are stored only in the current browser's
localStorage; clearing site data or changing devices removes access to that history. - Wensi does not collect writing content by default. In online mode, the topic, keywords, and real experiences leave the browser through
/api/generateand are sent to your configured model service; you are responsible for checking that provider's handling rules. - Do not put API keys, passwords, or other secrets in writing fields or debug logs.
- This is an Alpha/MVP. The local generator combines templates deterministically, so results can be repetitive and do not replace fact checking, editing, or professional judgment.
- The product currently targets Chinese writing; level, genre, and tone choices are limited to the existing interface.
- Local history is browser-specific; there is no login, cloud sync, or recovery service.
- Online generation requires
WENSI_PROVIDER=openai-compatible, a reachable OpenAI-compatible endpoint, a model name, and a valid server-side key; it is not enabled by default. - Production Cloudflare deployment requires your own account configuration, domain, and bindings; the repository does not provide those external resources.
- Improve provider observability and deployment guidance without exposing user content or secrets.
- Expand input/output validation and user-facing recovery for provider failures.
- Document reproducible Cloudflare Workers deployment and configuration examples.
- Continue improving local templates, accessibility, and multilingual documentation.
Issues and pull requests are welcome. Please read CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md before getting started.
Released under the MIT License.
