📚 Disclaimer: This is a weekend project with the purpose of learning Pedestal and, associated with it, interceptors.
Assuming Datbin is running somewhere (for our purposes, let's say it is localhost
), the home page serves an upload form, from which you can upload your file. If the upload is successful, you'll be redirected to a page confirming your success and be given a link, with which you can share your file.
upload form
success page
Since Datbin is, in our scenario, running in a local network, you can only really share it if you know the private IP address of the machine Datbin is running on and if the device you are trying to access the shared file with is also in the same local network. One way of accessing the data from external networks is to use a VPN like Tailscale and have both machines be connected to it.
Datbin is written in Clojure with the web library Pedestal. The pages, for which little effort was spent to make stylish, are rendered server-side with Hiccup and Garden. Datalevin is used as the records-storing database, keeping track of the uploads.
Start the server and go to localhost:3888
.
lein run
lein uberjar
java \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
-jar target/server.jar
docker build -t datbin .
docker run -p 3888:3888 -v $PWD/data:/server/data:rw -v $PWD/logs:/server/logs:rw datbin
docker-compose up
© 2023 Somē Cho