A chat-like interface for your Node.js apps
🔍 Documentation 🧩 Examples 💻 Live demo 🚨 Bug report
Waylis is a Node.js library that allows you to add a chat-like interface for interacting with your applications. It’s a complete solution that can free you from writing a separate frontend part. Abstracting user interaction into reusable dialog blocks, Waylis allows you to fully focus on domain logic by automatically collecting, validating user input and displaying processing results.
Warning
Waylis is a new project and currently in beta phase. Updates released before version 1.0 may introduce breaking changes.
- Wide range of usage: from standalone offline tools to online services.
- Backend-first: dialog logic is defined on the server, and the UI comes for free.
- Built-in input validation: accept only data you need from users (strings, numbers, booleans, dates, files).
- Configurable: comes with flexible server configuration.
- Pluggable: supports custom databases, file storages, loggers by implementing simple interfaces.
- No heavy dependencies: all core functions and the HTTP server are written using only the standard Node.js library.
- Minimalistic web UI: with responsive layout and themes.
Install package from NPM:
npm install @waylis/core
Write some code:
import { AppServer, createCommand, createScene, createStep } from "@waylis/core";
const command = createCommand({ value: "hello", label: "Hello World" });
const step = createStep({
key: "name",
prompt: { type: "text", content: "What is your name?" },
reply: { bodyType: "text" },
});
const scene = createScene({
steps: [step],
handler: async (answers) => {
return { type: "text", content: `Hello, ${answers.name}!` };
},
});
const app = new AppServer();
app.addScene(command, scene);
app.start();
Run it:
node ./main.js
And see the result on http://localhost:7770
If you have any suggestions, or you have found some kind of bugs, feel free to create an Issue on GitHub. If you have specific suggestions for making changes to the source code, you can create a Pull Request.
Released under the MIT License.