Ada Web Application is a framework to build a Web Application in Ada 2012. The framework provides several ready to use and extendable modules that are common to many web application. This includes the login, authentication, users, permissions, managing comments, tags, votes, documents, images. It provides a complete blog, question and answers and a wiki module.
AWA simplifies the Web Application development by taking care of user management with Google+, Facebook authentication and by providing the foundations on top of which you can construct your own application. AWA provides a powerful permission management that gives flexibility to applications to grant access and protect your user's resources.
AWA integrates the following projects:
- Ada Server Faces (https://github.com/stcarrez/ada-asf)
- Ada Servlet (https://github.com/stcarrez/ada-servlet)
- OpenAPI Ada (https://github.com/stcarrez/swagger-ada)
- ADO (https://github.com/stcarrez/ada-ado)
- Ada Util (https://github.com/stcarrez/ada-util)
- Ada Wiki (https://github.com/stcarrez/ada-wiki)
- Ada EL (https://github.com/stcarrez/ada-el)
- Ada Security (https://github.com/stcarrez/ada-security)
- Ada Keystore (https://github.com/stcarrez/ada-keystore)
- Ada LZMA (https://github.com/stcarrez/ada-lzma)
- Dynamo (https://github.com/stcarrez/dynamo)
These projects are distributed under the Apache License 2.0 or MIT license for Ada LZMA.
AWA relies on the following external projects:
- AWS (https://libre.adacore.com/libre/tools/aws/)
- XMLAda (https://libre.adacore.com/libre/tools/xmlada/)
These projects are provided as tarball in 'external' directory. They are distributed under different licenses (GNU GPL).
The AWA framework integrates a set unit tests and provides a framework to build unit tests for AWA applications. The unit tests are based on Ada Util test framework which itself is built on top of the excellent Ahven test framework (Ahven sources is integrated in Ada Util). You may get Ahven or Aunit at:
- Use AWS 24.0 from Alire
- Cleanup build environment to drop configure
- Feature #22: Add command line support to register a new user
- Feature #23: Add command line for database schema migration
- Feature #25: Update database schema for ADO 2.4
- Feature #26: Support to enable/disable user account
- Feature #27: New option for the list command to print the last audit fields
- Feature #31: Use
<header>
,<footer>
,<main>
for HTML layouts - Feature #32: Support several authentication methods for a user
- Feature #35: Blog post creation improvement
- Fix #30: Configuration to authenticate with GitHub is incomplete
- Fix #33: Application name not recognized by some AWA commands
- Fix #34: Configuration to authenticate with Gitlab is incomplete
- Fix #37: Cannot use entity-permission for the url-policy
- Fix #38: Image module does not handle SVG correctly
- Fix #45: AWA start command option --max-upload-size and --max-form-size don't accept a value
- Update Trumbowyg editor to version 2.26.0
- Use Markdown for the AWA comments and questions modules
The AWA framework uses git submodules to integrate several other projects. To get all the sources, use the following commands:
git clone --recursive https://github.com/stcarrez/ada-awa.git
cd ada-awa
The PostgreSQL, MySQL and SQLite development headers and runtime are necessary for building the Ada Database Objects driver. The configure script will use them to enable the ADO drivers. The configure script will fail if it does not find any database driver.
First to get the LZMA and CURL support, it is necessary to install the following packages before configuring AWA:
sudo apt-get install unzip liblzma-dev libcurl4-openssl-dev
MySQL Development installation:
sudo apt-get install libmysqlclient-dev
MariaDB Development installation:
sudo apt-get install mariadb-client libmariadb-dev
SQLite Development installation:
sudo apt-get install sqlite3 libsqlite3-dev
PostgreSQL Development installation:
sudo apt-get install postgresql-client libpq-dev
First to get the LZMA, XML/Ada and CURL support, it is necessary to install the following packages before configuring AWA:
pkg install gnat12 gprbuild lzma curl-7.87.0 xmlada
MariaDB Development installation:
pkg install mariadb106-client mariadb106-client-10.4.7 mariadb106-server-10.6.11
SQLite Development installation:
pkg install sqlite3
PostgreSQL Development installation:
pkg install postgresql15-client-15.1 postgresql15-server-15.1_1
It is recommended to use msys2 available at https://www.msys2.org/
and use the pacman
command to install the required packages.
pacman -S git
pacman -S make
pacman -S unzip
pacman -S base-devel --needed
pacman -S mingw-w64-x86_64-sqlite3
For Windows, the installation is a little bit more complex and manual.
You may either download the files from MySQL and SQLite download sites
or you may use the files provided by Ada Database Objects and
Ada LZMA in the win32
directory.
For Windows 32-bit, extract the files:
cd ada-ado/win32 && unzip sqlite-dll-win32-x86-3290000.zip
cd ada-lzma/win32 && unzip liblzma-win32-x86-5.2.4.zip
For Windows 64-bit, extract the files:
cd ada-ado/win32 && unzip sqlite-dll-win64-x64-3290000.zip
cd ada-lzma/win32 && unzip liblzma-win64-x64-5.2.4.zip
If your GNAT 2019 compiler is installed in C:/GNAT/2019
, you may
install the liblzma, MySQL and SQLite libraries by using msys cp with:
cp ada-lzma/win32/*.dll C:/GNAT/2021/bin
cp ada-lzma/win32/*.dll C:/GNAT/2021/lib
cp ada-lzma/win32/*.a C:/GNAT/2021/lib
cp ada-ado/win32/*.dll C:/GNAT/2021/bin
cp ada-ado/win32/*.dll C:/GNAT/2021/lib
cp ada-ado/win32/*.lib C:/GNAT/2021/lib
cp ada-ado/win32/*.a C:/GNAT/2021/lib
The Ada Web Server should be compiled with the SSL support if you want to use the OAuth 2.0 protocol and integrate with Google, GitHub and GitLab authentication systems. The AWS version shipped with GNAT 2021 will not work because it does not support SSL.
You may build AWS by using:
git clone --recursive -b 20.2 https://github.com/AdaCore/aws
cd aws
make SOCKET=openssl setup build install
The framework uses the configure
script to detect the build environment.
In most cases you will configure, build and install with the following commands:
./configure --prefix=/usr/local
make
make install
Once you have built and installed the Ada Web Application framework,
you can use the dynamo
command to create your first project by using
the create-project
command:
dynamo create-project -l apache atlas your-email@domain.com
Have a look at the Dynamo(1)
documentation for the detail of the dynamo
command options.
Then, configure and build the project by using:
cd atlas
./configure
make generate build
At this step, you will get the binary server in bin/atlas-server
and you can launch
it with:
./bin/atlas-server setup
The generated binary server provides several commands that you can use. The list of commands and their options is described in: command (1).
Follow the Tutorial section and the Ada Web Application programmer's guide to proceed to the next development steps.
A docker container is available for those who want to try AWA without installing and building all required packages (See Ada Web Application on Docker. To use the AWA docker container you can run the following commands:
sudo docker pull ciceron/ada-awa
The Ada Web Application programmer's guide describes how to setup the framework, how you can setup and design your first web application with it, and it provides detailed description of AWA components:
- Ada Web Application programmer's guide PDF
- Ada Server Faces Programmer's Guide PDF
- Ada Database Objects Programmer's Guide PDF
- Ada Security Programmer's Guide
- Ada Wiki Programmer's Guide PDF
- Ada Utility Library Programmer's Guide
- https://github.com/stcarrez/ada-awa/wiki/Documentation
You may read the following tutorials to lean more about the technical details about setting up and building an Ada Web Application:
- Step 1: Ada Web Application: Setting up the project
- Step 2: Ada Web Application: Building the UML model
- Step 3: Review Web Application: Creating a review
- Step 4: Review Web Application: Listing the reviews
- Persistence with Ada Database Objects FOSDEM 2019
- Ada for Web Development AdaCore Tech Days 2019
- Secure Web Applications with AWA FOSDEM 2019
- Protect Sensitive Data with Ada Keystore Ada devroom FOSDEM 2020