.. _webapp: Web Application Development =========================== The easiest way to install and utilize the AISDB web application components together is using the ``docker-compose.yml`` configuration included in this repository to run them as docker services. See the :ref:`docker` documentation for more info on how to do this. However, in some situations, such as developing or testing AISDB components, it may be convenient to run these services outside of a docker environment. This page documents how to run these services outside of docker, so that they can be tested or integrated in an existing environment. The application has three primary components: - Database server (Back end web API) - Database storage (Postgres database) - Web application interface (JS front end) And some secondary components: - Documentation webserver - AIS receiver client - AIS livestream proxy dispatcher Dependencies ------------ The following software is requisite for each AISDB service: - Database Storage - Postgresql Database Server - Postgresql Database Client Libraries - See the `Postgres Install Tutorial `__ - Database Server - Rustup, the Rust Compiler Toolchain `Install Rust `__ - OpenSSL - Web Application Front End - Rustup, the Rust Compiler Toolchain `Install Rust `__ - Binaryen, the WebAssembly Compiler Toolchain `Binaryen `__ - Wasm-pack, the Rust WebAssembly Packaging Utility `Install wasm-pack `__ - Clang, the C/C++ Compiler `Clang Download `__ - OpenSSL Development Toolkit (e.g. ``libssl-dev`` on ubuntu/debian) - Pkg-config `pkg-config `__ - NodeJS, the JavaScript Runtime Environment `Node.js download `__ - Documentation Server - Python `Download Python `__ - Rustup, the Rust Compiler Toolchain `Install Rust `__ - Sphinx Doc `Installing and Running Sphinx `__ - Maturin Build System `Maturin User Guide `__ - NodeJS, the JavaScript Runtime Environment `Node.js download `__ - AIS Receiver Client - Rustup, the Rust Compiler Toolchain `Install Rust `__ - AIS Proxy Dispatcher - Rustup, the Rust Compiler Toolchain `Install Rust `__ Database Storage ---------------- Ensure that the Postgres server is running by following the `Postgres Database Server Tutorial `__. The other web services will use this server for storage and retrieval of AIS data. Database Server --------------- Configure the database server by setting the following environment variables for the postgres database connection: .. code-block:: sh PGPASSFILE=$HOME/.pgpass PGUSER="postgres" PGHOST="[fc00::9]" PGPORT="5432" Navigate to the ``database_server`` folder in the project repository, install it with cargo, and then run it. .. code-block:: sh cd database_server cargo install --path . aisdb-db-server Web Application Front End ------------------------- A web interface client is included in the AISDB python package. .. include:: ../../examples/visualize.py :literal: