My Web Development Overview
 
Last edited:

aeric

Expert
Licensed User
Longtime User
B4X is a great tool for developing Web Applications and Backend.
It started from my idea to create web API tool like .NET Web API and web application framework like Laravel for PHP and Django for Python.
The idea is to create a scaffolding or skeleton project and progressively extend it further by adding other libraries.
From time, I have developed a lot of libraries, tools and project templates as my own ecosystem.

Libraries

All the libraries are optional and can be added by mix and match.
They are created in the hope to empower developers experience and cut development time.

1. EndsMeet
I tried to extend the functionality of jServer with this library.
It adds global settings for API, SSL, CORS, Email, Static files and manage routing.
The server can read settings from a config.ini file without need to recompile the jar.

2. WebApiUtils
This library provides a lot of useful functions that can help you to build a REST or Web API server.
It returns the cookies, basic authentication, token, api key from the headers.
It handles the server request and response data in the form of text, multipart data, XML and JSON formats with designated order.

3. MiniORMUtils (B4X)
Web Application in real world usually involve communicating with the database.
Use this library to communicate with MySQL the same way with SQLite in your project.

4. MinimaListUtils (B4X)
REST API server is not mandotory associate with SQL or database.
This library works without any database but provide the CRUD functionalities.
You only need to understand List and Maps.

5. MiniHTML (B4X)
This library generates type safe HTML text that can be output as server response.
Use the familiar B4X syntax to edit the web page design.

6. MiniCSS (B4X)
This library complements MiniHTML library as a CSS generator.

7. MiniJS (B4X)
This library complements MiniHTML library as a JavaScript generator.

Other libraries:

1. JsonWebToken
This library provides a stateless solution as an alternative to server session which is stateful.
It helps to verify user login using access tokens.

2. Velocity
A java based template engine alternative to FreeMarker and Thymeleaf.

3. jinjava
Another java based template engine library.

4. ImageScaler
This library can be use to resize user uploaded images as thumbnail.

5. ImageConverter
This library can convert JPG to PNG images.

6. Slugify
This library can convert or replace a phrase with spaces into hypenated text. Useful for converting blog title for SEO purpose.

7. Faker
This library can be use to generate fake data to seed dummy data to the database for web demo.

8. Lettuce
A wrapper library for Redis client

9. FCMTool (private)
This library is use for sending Firebase Cloud Messaging or notification to Android and iOS apps from a server.

10. CapORM (private)
A more complete ORM library extended from MiniORMUtils that supports MS SQL Server, Firebird, PostgreSQL.

11. EncryptionUtils (private)
A library that provide commonly use encryption and hashing functions.

12. QRCode
Generate QRCode for server.
 
Last edited:

aeric

Expert
Licensed User
Longtime User

Tools

1. Libraries Downloader (libget)
A tool where you can use to download the missing libraries for B4A and B4J projects.
Libraries binary can be hosted on GitHub.

2. Resources Downloader (resget)
A tool where you can use to download the resources inside Objects directory for B4J projects.
This can make server project templates file size smaller by eliminating the resources inside www folder.

3. Manifest Writer
A tool for writing or updating manifest.txt for b4xlib distribution.
Eliminate the use of Notepad and WinRAR.

4. MiniHtml Code Generator
Convert html text into B4X to be used with MiniHtml v2 library
Could be useful to convert a big file or template downloaded from other open source projects.

5. Simple HTML Editor
A visual editor to create or design web page.
Integrated with MiniHtml v1 and still in alpha development stage.
 
Last edited:

aeric

Expert
Licensed User
Longtime User

Project Templates

1. Inti Server (7KB)
A very small server suitable for quick test. Contains 1 handler, IndexWebHandler.
Depends on jServer

2. MiniServer (78KB)
This template contains 2 handlers, HomeHandler and HelloPage
Depends on jServer

3. MinimaList Server (430KB)
A Web API Server initially created not to use a database
Depends on EndsMeet, WebApiUtils, MinimaListUtils, KeyValueStore

4. Web API Server (428KB)
A Web API Server connect to a SQLite or MySQL database
Depends on WebApiUtils (3.05), MiniORMUtils (2.60)

5. Pakai Server (47KB)
Web API Server was renamed in version 4.
Pakai Server is framework and a starter template for creating web application or REST API backends.
Depends on EndsMeet, MiniHtml, MiniCSS, MiniJS, MiniORMUtils, WebApiUtils

6. EndsMeet Server (5KB)
This is a cleaner template compared to Pakai Server with one Index.bas. Use this template for progressive development of Pakai framework.
Depends on EndsMeet and MiniHTML

7. User Login Server (425KB)
Based on Web API Server v3.5 with ready to use user registration and login functions.
Depends on ByteConverter, jNet, Encryption, MiniORMUtils, WebApiUtils

8. jRDC2 Server (13KB)
Based on jRDC2 version 2.23 with sample database.
Depends on JavaObject, jRandomAccessFile, jServer, jShell, jSQL

9. jRDC2 with Session Server (68KB)
Based on jRDC2 Server template with user login and authorization through session id.
Depends on JavaObject, jRandomAccessFile, jServer, jShell, jSQL

10. CRUD REST API Server
Co-developed with @Mashiane to be used in BaNanoServer as a single handler for all APIs.
Another repo is kept as private on my GitHub under the name of aeric-crud-api.
 
Last edited:

aeric

Expert
Licensed User
Longtime User

Connecting the dots​

We can build a server using very minimum code.
Basically a HTML Web Server can serve static and dynamic contents.

In fact, we can also build a non-UI app to serve a client using the standard io without jServer.
Check my Model Context Protocol (MCP) Server using Stdio (5KB) that allows AI agents talk to or use our B4J applications.

By using more libraries, we can build different kinds of server application to serve different clients.

When talking about web applications, rarely someone will think about using B4J as the backend solution.
In my opinion, using B4J to build web application is very underrated because we have very limited examples on this forum.
Members failed to see what is the potential and benefits of doing this.

I hope web development using B4J will continue to gain more interest. There are abundance of options that we can use.
 
Top