lunch-list
is a fast and simple web lunch attendance list. This app is
fully written in Rust using the actix-web framework for server and API and
Redis as database. The front-end web app is written with WebAssembly and
yew
web app framework.
This project is in no way finished and probably never will. Still, it is a fun project in learning Rust for web applications.
There are two main ways of running lunch-list
: local or in Docker
containers. Docker containers are the easiest way, since it only requires
docker.
Running lunch-list
requires the following:
Once these are installed you must first run redis-server
. To quickly run
everything Redis can be started with:
redis-server
Next you have to build and package the front-end web app using trunk
.
cd lunch-list-frontend
trunk build
cp -r dist ..
This builds, packages and moves the files to be deployed to dist/
and moves it to root.
Then the lunch-list
API can be started from the root of the repo with:
cargo run -p lunch-list-backend
This will install all required dependencies, start the server, connect to
Redis and start listening on 127.0.0.1:8080
. You can also choose to install
the ll
executable with
cargo install --path lunch-list-backend
This will install ll
to ~/.cargo/bin/
.
All required containers can easily be run using Docker and
docker-compose
. Simply run in the root of the repo:
docker-compose up
This will pull the lunch-list
container image from docker.pkg.github.com, so
you have to be logged in to GitHub docker packages. lunch-list
will now
be available at 127.0.0.1:46018
. The Redis container has persistence
enabled with appendonly
and will store database data in redis-data/
.
Therefore, the data will persist between container runs.
It is also possible to build the Dockerfile yourself. Building the image requires BuildKit, which is available since Docker 18.09. In order to build you first have to enable BuildKit.
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
docker build . -t lunch-list
This software is distributed under Apache-2.0 license, see LICENSE ๐