Bialet

Bialet#

Enhance HTML with a native integration to a persistent database

import "bialet" for Response

var users = `SELECT id, name FROM users`.fetch
var TITLE = "🗂️ Users list"

Response.out(
  <!doctype html>
  <html>
    <head><title>{{ TITLE }}</title></head>
    <body style="font: 1.5em/2.5 system-ui; text-align:center">
      <h1>{{ TITLE }}</h1>
      {{ users.count > 0 ?
        <ul style="list-style-type:none">
          {{ users.map{|user| <li>
            <a href="/hello?id={{ user["id"] }}">
              👋 {{ user["name"] }}
            </a>
          </li> } }}
        </ul> :
        /* Users table is empty */
        <p>No users, go to <a href="/hello">hello</a>.</p>
      }}
    </body>
  </html>
)

Bialet is a full-stack web framework that integrates the object-oriented Wren language with a HTTP server and a built-in SQLite database in a single app, creating a unified environment for web development.

Installation#

Use Homebrew to install Bialet:

brew install bialet/bialet/bialet

Quickstart#

Create an index.wren file in your app directory and run it:

bialet

Visit 127.0.0.1:7001 in your browser.

View repository

Download source