This is simple captive portal used by me in conjunction with my Lua Captive Portal and AVR token generator for OpenWRT. It provides nice client-side rendered frontend for my WiFi captive portal. See Lua Captive Portal for more info.
In order to build the frontend, you need to have node.js and yarn. First, install NPM packages:
yarn install
Then you need to find out Captive Portal API URL. If you followed Lua Captive Portal guide it's http://192.168.1.1:6820
,
assuming yours router IP is 192.168.1.1
. Build the frontend package like this:
TOKEN_API="http://192.168.1.1:6820/captive.lua/auth.token" yarn build
Once build finished, you have the frontend ready in the public_html
directory.
To start local development server, you need to have docker and docker-compose installed.
To start the web server run:
docker-compose up -d
Then, to start live builds run:
TOKEN_API="http://192.168.1.1:6820" yarn watch