🚲 Bialet
Enhance HTML with a native integration to a persistent database
var users = `SELECT id, name FROM users`.fetch
var title = "🗂️ Users list"
return <!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 single HTTP server and a built-in SQLite database, creating a unified environment for web development
Use Homebrew to install Bialet:
brew install bialet/bialet/bialet- Create an
index.wrenfile in your app directory and run it:
bialet- Visit 127.0.0.1:7001 in your browser.
To build Bialet from source, you'll need to install certain dependencies and run the build process.
sudo apt install -y libsqlite3-dev libssl-dev
# Optional, but recommended for production
sudo apt install -y libcurl4-openssl-devbrew install sqlite3 curl
# Optional, but recommended for production
brew install openssl- libcrypto-3-x64.dll
- libsqlite3-0.dll
- libssl-3-x64.dll (Optional, but recommended for production)
After installing the dependencies, compile the project and install it:
make clean && make && make installTo run Bialet in development mode, you can use the PATH_RUN environment variable to specify the path to the app directory:
make dev PATH_RUN=/path/to/dev-appBialet is released under the MIT license, allowing users to freely use, modify, and distribute the software with fewer restrictions.
I copy a lot of code from all over the web
Bialet incorporates the work of several open-source projects and contributors. We extend our gratitude to:
- The Wren programming language, for its lightweight, flexible, and high-performance capabilities.
- Matthew Brandly, for his invaluable contributions to JSON parsing and utility functions in Wren. Check out his work at Matthew Brandly's GitHub.
- @PureFox48 for the upper and lower functions.
- @superwills for providing the
getoptsource. - Codeium for the Codeium plugin, ChatGPT and a lot of coffee.
We encourage users to explore these projects and recognize the efforts of their creators.