No description
  • CSS 53.6%
  • HTML 24.8%
  • Zig 14.9%
  • JavaScript 6.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AramJonghu d52dab4d58
All checks were successful
CI / prettier (push) Successful in 9s
CI / fmt (push) Successful in 36s
CI / build (push) Successful in 56s
chore(README): Readme update; minor corrections and coming soon block
2026-07-21 03:42:15 +02:00
.forgejo/workflows chore(tailwind dep): now part of build with autodetect musl or glibc 2026-07-19 21:45:31 +02:00
public chore(formatting): height changes 2026-07-19 21:31:52 +02:00
src feat(rate limiter): added rate limiter 2026-07-19 20:29:12 +02:00
.gitignore chore(ci): file location mismatch messing up zig build 2026-07-19 21:00:46 +02:00
.prettierignore chore(ci): adjustments fixing CI checkout + minor improvements 2026-07-19 20:36:47 +02:00
.prettierrc chore(ci): checkout fix + prettier mismatch fix 2026-07-19 20:42:20 +02:00
build.zig chore(tailwind dep): now part of build with autodetect musl or glibc 2026-07-19 21:45:31 +02:00
build.zig.zon feat: Zig HTTP server with zap + TailwindCSS build 2026-07-19 20:00:29 +02:00
LICENSE Chore(LICENSE): LICENSE added 2026-07-19 20:01:28 +02:00
package.json chore(format + contact form): prettier run + contact form updates 2026-07-19 20:29:12 +02:00
README.md chore(README): Readme update; minor corrections and coming soon block 2026-07-21 03:42:15 +02:00

Maran — Freelance Portfolio

Portfolio site with Zig backend serving static frontend + contact API.

Stack

Layer Choice Notes
Language Zig 0.16.0
HTTP server zap (master) serves static files + POST /api/contact
CSS TailwindCSS v4 (standalone CLI) auto-downloaded on first build
Theme Catppuccin Mocha/Latte JS toggle, persisted to localStorage
Font Inter (self-hosted, 4 WOFF2) no Google Fonts
Map Leaflet + OpenStreetMap centered on 's-Hertogenbosch
Contact form POST /api/contact → JSON file rate-limited: 2 req / 60 min window

Build

zig build
  • Compiles Zig binary (zig-out/bin/maran-site)
  • Runs Tailwind CLI (input.css → style.css)
  • Auto-downloads Tailwind CLI for Linux x64 (glibc or musl) if missing
  • Also available: zig build css (Tailwind only), zig build test

Run

zig build run   # serves on http://localhost:8080

Server defaults: port 8080, 2 threads, 1 worker.

TLS

TLS requires OpenSSL at build time. In build.zig, set openssl = true and install libssl-dev:

const zap = b.dependency("zap", .{
    .openssl = true,
    // ...
});

Then configure cert in src/main.zig:

const tls = try zap.Tls.init(.{
    .server_name = "example.com",
    .public_certificate_file = "/path/to/cert.pem",
    .private_key_file = "/path/to/key.pem",
});
var listener = zap.HttpListener.init(.{
    .port = 443,
    .tls = tls,
    // ...
});

Ports < 1024 need root or setcap cap_net_bind_service=+ep zig-out/bin/maran-site.

Contact form submissions

Stored as JSON files in data/contact-submissions/{timestamp}-{name}.json.

Dev tooling

LSPs installed via npm (dev only, not for build):

npm install

Provides typescript-language-server, tailwindcss-language-server, vscode-{html,css,json}-language-server, eslint.

All npm artifacts (node_modules/, package-lock.json) are gitignored.

Project layout

├── data/
│   └── contact-submissions/   contact form submissions (gitignored, created at runtime)
├── public/
│   ├── fonts/inter/           self-hosted Inter WOFF2
│   ├── js/main.js             theme toggle, map, contact form
│   ├── index.html             portfolio page
│   ├── input.css              Tailwind source + Catppuccin vars
│   ├── style.css              generated by Tailwind (gitignored)
│   └── maran.png              logo + favicon
├── src/
│   └── main.zig               zap server
├── tailwindcss                standalone CLI binary (gitignored)
├── build.zig
├── build.zig.zon
├── .forgejo/
│   └── workflows/ci.yml       CI (fmt, prettier, build)
├── package.json               dev tools manifest
└── LICENSE                    BSD 3-Clause

Coming soon

  • Email delivery send contact form submissions via transactional email API (Resend, Mailgun) or local MTA (maddy)
  • Deployment systemd unit, reverse proxy setup, or direct TLS via zap
  • Optionally environment config env vars for port, TLS paths, SMTP credentials

License

BSD 3-Clause. See LICENSE.