Nayan UI
Game engine and components for React and React Native, with playable games and developer guides.

Highlights
Packages
| Package |
Version |
Description |
| nayan-ui |
 |
Game engine for React Native and web |
| @nayan-ui/website |
Private |
Nayan UI website and documentation |
| nayan-games |
Local archive |
Nayan Games |
The engine source and SDK documentation live in packages/nayan-ui.
The website installs nayan-games from a checked-in tarball and uses the engine from this workspace.
Engine development
Install just the engine dependencies from a clean checkout:
bun install --frozen-lockfile --filter nayan-ui
Run the engine workflow from Actions → Run workflow.
Select the branch and choose an operation.
validate builds iOS, Android and WebAssembly, runs the tests, and performs an npm dry run.
publish builds, tests, and publishes the version in packages/nayan-ui/package.json
through npm Trusted Publishing.
Both commands run the platform builds in parallel and reuse cached binaries when the Rust inputs match.
Download the tested nayan-ui artifact from a successful run. See the
engine README for local builds.
First npm release
Publish the tested tarball once from an npm account with two-factor authentication.
Download and unzip the workflow’s nayan-ui artifact, then run the following from that directory.
npm login --registry=https://registry.npmjs.org
npm publish ./nayan-ui-1.0.0-beta.1.tgz --access public --tag beta --ignore-scripts
In the new package’s npm settings, add a GitHub Actions trusted publisher with owner ursnj,
repository nayan-ui, and workflow npm-publish.yml. Leave the environment blank and enable
npm publish. Use a new package version for the first GitHub Actions release.
npm Trusted Publishing settings
Website
packages/website (@nayan-ui/website) is the Next.js app behind www.nayanui.com. It hosts the component docs, games, developer tool guides and the video editor. It ships as the Docker image ursnj/nayanui (port 7100). Site components, demos, and tooling use the workspace engine.
With the website dependencies installed and the Rust/WASM prerequisites from the engine README available, run:
bun run website:dev
The website dev and production commands build the browser engine when needed. Next.js compiles the website’s Tailwind utilities. Run bun run engine:build:web after changing the engine source.
Updating the games archive
Obtain a built nayan-games package archive that declares nayan-ui as its engine peer dependency, then run these commands from the repository root.
cp /path/to/nayan-games-version.tgz packages/website/scripts/nayan-games.tgz
bun update --cwd=packages/website --ignore-scripts nayan-games
Commit the archive and the updated bun.lock together. The website publishing workflow installs that exact archive with Bun’s frozen lockfile. The games license is included in the archive.
Starter template
The Nayan UI starter is a standalone Bun project for web, iOS, and Android. It uses [email protected] from npm.
The starter CLI instructions cover creating a new project from npm and running it on web, iOS, or Android.
Quick Start
git clone --depth 1 https://github.com/ursnj/nayan-ui.git
cd nayan-ui/templates/nayan-ui
bun install --frozen-lockfile
bun run web
Repository Structure
packages/
nayan-ui/ nayan-ui — Game engine and components
website/ @nayan-ui/website — nayanui.com (Next.js)
templates/
nayan-ui/ Standalone starter for Expo and Vite
.github/ engine CI and website image publishing
Development
This monorepo uses the Bun channel in .bun-version. The full checks need the checked-in games archive and the generated engine package. For engine-only work, use the filtered install above.
bun install --frozen-lockfile
bun run engine:build
| Command |
Description |
bun run engine:build |
Build the engine package |
bun run engine:typecheck |
Type-check the engine |
bun run engine:test |
Run the engine unit tests |
bun run website:dev |
Run the website in development |
bun run website:build |
Production build of the website |
bun run website:start |
Serve the production build on port 7100 |
bun run format |
Format the codebase with Bun |
bun run format:check |
Check formatting without writing files |
bun run lint |
Run Bun lint across the monorepo |
bun run typecheck |
Check the engine and website |
bun run test |
Run the engine and website Bun tests |
bun run clean |
Remove node_modules and build outputs |
On an open pull request, a collaborator with write access can post test as a standalone comment. GitHub Actions verifies the current PR commit with the same library builds and checks used for npm releases and posts the results with a link to the logs. Use merge to also merge the verified commit after @ursnj approves it and GitHub’s merge requirements are met.
Publishing
- Engine package — manually run Build and publish nayan-ui. Choose validate for a dry run and a verified tarball, or publish to release to npm. Leave Publish as beta unchecked for
latest, or check it for beta. The package version comes from packages/nayan-ui/package.json.
- Website — run the Publish website docker images workflow to build and push
ursnj/nayanui:latest. Requires the DOCKER_HUB_TOKEN repository secret.
Documentation
For detailed documentation, component APIs, examples, and guides, visit www.nayanui.com
Contributing
We welcome contributions! See the contribution guide to learn how to contribute to the repository and development workflow.
License
MIT
Developed with ❤️ by Niranjan Reddy Devasani
评论