Bialet

Contents

Bialet#

Enhance HTML with a native integration to a persistent database

import "bialet" for Request, Response

class App {
  construct new() {
    _title = "🚲 Welcome to Bialet"
  }
  user(id) { `SELECT * FROM users WHERE id = ?`.first(id) }
  name(id) { user(id)["name"] || "World" }
  html(content) {
    return <!doctype html>
    <html>
      <head>
        <title>{{ _title }}</title>
      </head>
      <body>
        <h1>{{ _title }}</h1>
        {{ content }}
      </body>
    </html>
  }
}

var idUrlParam = Request.get("id")
var app = App.new()
var html = app.html(
  <p>👋 Hello <b>{{ app.name(idUrlParam) }}</b></p>
)
Response.out(html) // Serve the 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.

Quickstart#

Clone or download the Bialet Skeleton repository and use Docker Compose to start the app.

git clone --depth 1 https://github.com/bialet/skeleton.git mywebapp
cd mywebapp
docker compose up

Visit localhost:7000 in your browser.

View repository

Download source