Spring petclinic ported to redbean/fullmoon
I became really interested in the redbean project and associated lua web farmework fullmoon. As a Java developer, the "PetClinic" app is the web based hello world of Java since the EJB days. So I decided to port the Spring petclinic version to redbean/fullmoon.
https://github.com/spring-projects/spring-petclinic
Redbean is an amazingly fast/tiny single file webserver and is part of Justine Tunney's cosmopolitan libc/actually portable executable ecosystem.
Fullmoon is a lua framework built specifically for redbean by Paul Kulchenko.
https://github.com/pkulchenko/fullmoon
-
Note that fullmoon is included in this repo. It is a branch version that has a fix to allow easy db connections across forked processes (since redbean is a forking web server).
-
https://github.com/pkulchenko/fullmoon/tree/forkable-storage
Paul is also the author of ZeroBrane which is a wonderful Lua IDE that I used while porting this project.
If interested in benchmarks please click Benchmarks
- Clone repo
- Examine the makefile - it has multiple targets to make your life easier
- I assume your system has zip/unzip installed and available at the command line
- The makefile will download a redbean executable from redbean.dev and then zip the contents of /srv into it
make start
Port defaults to 8000 and is sepecified at the bottom of petclinic.lua file
make start-daemon
In this mode a redbean.pid file will be created and all logs will go to redbean.log
To stop the daemon use
make stop-daemon
- You may need to manually remove redbean.pid if the process crashes or you otherwise stop the redbean process without called stop-daemon
The make file is a lightly modified version copied from https://github.com/ProducerMatt/redbean-template
- On linux you should be able to run
sh reload.sh
to hot reload as you develop - You need inotify-tools installed
- As you develop tail -f redbean.log to look for issues
reload.sh credit to -> https://www.baeldung.com/linux/monitor-changes-directory-tree
MIT license (see LICENSE file)
Please see the fullmoon/redbean/spring petclinic sites for respective licenses