Skip to content

Latest commit

 

History

History

modals

Modals (ambiorix + htmx)

A sample project that shows how to support modal forms with ambiorix + htmx.

Persistent storage has been implemented using MongoDB.

Exhibits

  • We first explore the different types of modals.

Modal types

  • Then movie table.

Movie table

  • Add new movie.

Add new movie

  • Input validation.

Input validation 1

Input validation 2

Input validation 3

Prerequisites

  • An installation of the community edition of MongoDB

Installation

  1. Clone this repo and cd into the modals/ directory:
    git clone git@github.com:kennedymwavu/ambiorix-htmx.git
    cd ambiorix-htmx/modals
  2. Add an env file (.Renviron) at the root dir of the project with these variables:
    MONGO_DB = ambiorix-htmx
    MODALS_COLLECTION = modals
    HOST = 127.0.0.1
    PORT = 8000
    RENV_CONFIG_SANDBOX_ENABLED = FALSE
    You can change the default values if you wish.
  3. Fire up R and install the dependencies:
    renv::restore()

Start app

index.R is the entry point of the app. Run the following command to start the app.

Rscript index.R