Skip to content

lineCode/waylis-core

 
 

Repository files navigation


logo

Waylis

A chat-like interface for your Node.js apps

🔍 Documentation   🧩 Examples   💻 Live demo   🚨 Bug report


promo

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.

Features

  • 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.

Quick start

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

Contribution

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.

Licence

Released under the MIT License.

About

A chat-like interface for your Node.js apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%