A single-page "Matrix" hacker-green themed portfolio built with Kobweb (Compose HTML + Silk). Statically exported and deployed to GitHub Pages.
The repo has two modules:
site/— the Kobweb frontend (Compose HTML/Silk). Exported to static HTML/JS/CSS viakobwebExportand served from GitHub Pages.visit-notifier/— a small standalone JVM backend (plaincom.sun.net.httpserver.HttpServer, no framework) that receives onePOST /api/visitper browser session and emails the owner via the Resend HTTP API. Deployed separately (e.g. Render).
First, run the development server by typing the following command in a terminal under the site folder:
$ cd site
$ kobweb runOpen http://localhost:8080 with your browser to see the result.
You can use any editor you want for the project, but we recommend using IntelliJ IDEA Community Edition downloaded using the Toolbox App.
Press Q in the terminal to gracefully stop the server.
Feel free to edit / add / delete new components, pages, and API endpoints! When you make any changes, the site will indicate the status of the build and automatically reload when ready.
When you are ready to ship, you should shutdown the development server and then export the project using:
kobweb exportWhen finished, you can run a Kobweb server in production mode:
kobweb run --env prodIf you want to run this command in the Cloud provider of your choice, consider disabling interactive mode since nobody is sitting around watching the console in that case anyway. To do that, use:
kobweb run --env prod --nottyKobweb also supports exporting to a static layout which is compatible with static hosting providers, such as GitHub Pages, Netlify, Firebase, any presumably all the others. You can read more about that approach here: https://bitspittle.dev/blog/2022/staticdeploy
This repo now contains a separate backend service in visit-notifier/ for visit email notifications. The frontend stays
static on GitHub Pages and sends one POST /api/visit request per browser session.
Set the backend base URL at build time:
./gradlew :site:kobwebExport -PkobwebExportLayout=STATIC -PkobwebEnvironment=PROD -PvisitNotifyApiBaseUrl=https://your-backend.example.comFor local frontend development, the visit reporter falls back to http://localhost:8787 when the site runs on
localhost and no explicit visitNotifyApiBaseUrl is provided.
Copy visit-notifier/.env.example to visit-notifier/.env for local development, or into your host's runtime environment
settings for deployment. Required runtime variables:
ALLOWED_ORIGINS=https://<your-gh-pages-domain>,https://<your-custom-domain>
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxx
VISIT_NOTIFY_TO=you@example.com
VISIT_NOTIFY_FROM=notifications@yourdomain.comEmails are sent via the Resend HTTP API (port 443), not SMTP — this is what lets the
backend run on Render's free tier, which blocks outbound SMTP port 587. VISIT_NOTIFY_FROM must be a
verified sender/domain in your Resend account.
Run the backend locally with:
./gradlew :visit-notifier:runThe backend now reads configuration from process environment variables and also from a local .env file. Process
environment variables take precedence over .env values.
Endpoints:
GET /healthPOST /api/visit
Use the Docker service type for visit-notifier only.
Set these values in Render:
Root Directory: leave blankDockerfile Path:DockerfilePORT:10000ALLOWED_ORIGINS: your frontend origin(s), comma-separatedRESEND_API_KEY: your Resend API keyVISIT_NOTIFY_TO: the inbox that should receive the visit emailsVISIT_NOTIFY_FROM: a verified sender/domain in your Resend account
After deploy, Render will give you a service URL like https://your-service.onrender.com. Put that in the GitHub
variable VISIT_NOTIFY_API_BASE_URL before you next export or deploy the frontend.