Skip to content

mingzhangyang/cognitive-space

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

338 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starwild

Starwild is a web application designed to help users organize and explore their thoughts, questions, and ideas. It allows you to drop unstructured thoughts, promote them into structured questions, and build context with claims, evidence, and triggers. Visualize connections between questions to uncover emerging patterns.

Built with React for the frontend and deployed as a Cloudflare Worker for the backend API.

Features

  • Thought Capture: Quickly jot down ideas without structure.
  • Question Organization: Promote thoughts into questions and add supporting elements.
  • Visualization: Explore relationships between questions graphically.
  • Wandering Planet Recovery: Rescue orphaned thoughts and link them back.
  • PWA Support: Installable as a progressive web app.

Guide

  1. Open the app and use Just write to drop a thought without worrying about structure.
  2. Create a new Question by tagging or promoting a thought when the theme becomes clear.
  3. Add supporting notes as Claims, Evidence, or Triggers to build context over time.
  4. Use Visualize to explore related questions and spot emerging clusters.
  5. Visit Wandering Planet to rescue orphaned fragments and link them to a question.

Keyboard Shortcuts

Keyboard Shortcuts

  • Cast / Send (Write page): Ctrl+Enter (Windows/Linux) or Cmd+Enter (macOS) — submit draft.
  • New draft: N
  • Save / Cast (alternate): Ctrl+Enter or Cmd+Enter
  • Cancel / Close: Esc
  • Menu navigation: / / Home / End
  • Wandering Planet quick view: A
  • Wandering sort: S

For the full list of shortcuts open the Shortcuts modal inside the app. For product details see Product Design and Visualization Proposal.

Prerequisites

  • Node.js (version 18 or higher)
  • Cloudflare Wrangler CLI (npm install -g wrangler)

Installation

  1. Clone the repository:

    git clone https://github.com/mingzhangyang/cognitive-space
    cd cognitive-space
  2. Install dependencies:

    npm install

Local Development

  1. Set the BIGMODEL_API_KEY secret using Wrangler:

    wrangler secret put BIGMODEL_API_KEY
  2. Run the Worker locally:

    npm run dev
  3. Optional: Run UI-only dev server (no Worker API):

    npm run dev:ui

Deployment

  1. Build the static assets:

    npm run build
  2. Deploy the Worker:

    npm run deploy

Configuration

  • BIGMODEL_API_KEY: Required. Your API key for the AI model.
  • BIGMODEL_MODEL: Optional. Defaults to glm-4.7-flashx. Specify a different model if needed.
  • VITE_BUILD_ID: Optional. Injected by build scripts for service worker cache versioning. Override to control the cache tag.

Scripts

  • npm run build: Builds the static assets.
  • npm run dev: Runs the Worker locally.
  • npm run dev:ui: Runs the UI dev server.
  • npm run ops:waf-rate-limit: Creates/updates Cloudflare WAF rate-limit rules for AI endpoints.
  • npm run preview: Runs the Worker locally against built assets.
  • npm run deploy: Deploys to Cloudflare.

Operations: WAF Rate Limits

To configure zone-level Cloudflare WAF rate limits for API abuse protection:

export CF_API_TOKEN="<cloudflare_api_token_with_zone_rulesets_edit>"
export CF_ZONE_ID="<cloudflare_zone_id>"
npm run ops:waf-rate-limit

The script upserts two http_ratelimit rules:

  • POST /api/analyze: 10 requests/minute/IP
  • POST /api/wandering-planet/analyze: 5 requests/minute/IP

Contributing

Contributions are welcome! Please read the contributing guidelines (if any) before submitting a pull request.

License

This project is licensed under the MIT License.

About

Starwild

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages