zlattea

git clone https://git.smesh.lol/zlattea.git

Zlattea

Билки и чайове от Стара планина. Онлайн магазин.

Quick Start (local)

git clone ssh://git@git.smesh.lol:2222/~/zlattea.git
cd zlattea
./install.sh

The install script will prompt for:

  • Admin password (required)
  • Port (default 3000)
  • Bind address (default 127.0.0.1)

Everything else is automatic: prerequisites (apt/dnf/pacman), bun, dependencies, database setup, product seeding, and build. Both API and web servers start when done. Log in at /user with admin@zlattea.com and the password you chose.

Production install (server)

git clone ssh://git@git.smesh.lol:2222/~/zlattea.git
cd zlattea
sudo ADMIN_PASSWORD=<admin-pass> SITE_DOMAIN=shop.yourdomain.com ./install.sh

Running as root installs to /opt/zlattea as a zlattea system user with:

  • systemd services (zlattea-api on 3001, zlattea-web on 3002)
  • a Caddy site config in /etc/caddy/conf.d/<domain>.caddy (auto-imported into the main Caddyfile, TLS via Let's Encrypt)
  • logs in /var/log/zlattea/

Optional env for the admin account: ADMIN_EMAIL (default admin@zlattea.com) and NOSTR_PUBKEY (links your nostr identity to the admin account).

After install

Everything payment/email related is configured from the admin panel at /user - no server edits needed:

  • Payments tab: Stripe keys and BTCPay Server (URL + API key + store ID)
  • Опции tab: SMTP settings for order emails (Gmail: host smtp.gmail.com, port 587, user + 16-char app password)
  • BTCPay settlement requires the store webhook to POST to https://<domain>/api/webhooks/btcpay with a secret stored as BTCPAY_WEBHOOK_SECRET in the .env (create the webhook in BTCPay Server: Store → Settings → Webhooks)

Remove

  • Local: ./uninstall.sh
  • Production: sudo SITE_DOMAIN=shop.yourdomain.com ./teardown.sh

Stack

  • Astro - SSR frontend
  • Hono - API server
  • SQLite (Bun native) - database
  • Bun - runtime, package manager, bundler
  • Stripe - card payments (Apple Pay, Google Pay)
  • BTCPay Server - Bitcoin (on-chain + Lightning via LNURL)

Features

Store

  • Product catalog with categories (Билки / Диви плодове)
  • Product detail pages with usage recommendations (BG/EN)
  • Shopping cart (localStorage)
  • Multi-method checkout: Stripe cards, BTCPay (Bitcoin + Lightning), cash on delivery
  • Courier shipping (Econt) with office search and city filter; fixed rates up to 1kg (€5.22 to address, €3.95 to office/locker), Econt API above 1kg
  • Free pickup option (admin toggle): no shipping fee, vendor contacts the buyer to arrange time and location
  • Bulgarian / English i18n

Auth

  • Email/password login with bcrypt
  • Nostr login (NIP-07 browser extensions, kind 22242 challenge auth)
  • Mandatory password setup for Nostr users

Admin Panel

Navigate to /user after logging in as admin.

  • Products: inline editing (name BG/EN, price, weight, stock, harvest year, category, images with upload), reorder, delete
  • Orders: status transitions (paid → shipped → delivered, cancel), Econt label printing
  • Users: admin toggle, order history, register new user by email (backup admin login)
  • Messages: contact form inbox
  • Options: configurable about page (image + markdown BG/EN), delivery page (image + markdown BG/EN), contact details (phone, email, address, services markdown, pickup markdown), SMTP email settings
  • Terms: terms of service (BG/EN) + privacy policy (BG/EN) markdown editors
  • Доставка: Econt API credentials, fallback rates, free shipping threshold
  • Payments: Stripe + BTCPay Server API key configuration

Content Pages

  • About page with configurable image + markdown text
  • Delivery page with configurable image + markdown text
  • Contact page with configurable phone/email/address (address per language), services, pickup sections, contact form
  • Terms of service and privacy policy rendered from markdown
  • All hero images unified to shop-hero.jpg

Responsive

  • Mobile hamburger drawer with nav links + cart/login actions + lang toggle (BG/EN) + logout
  • iOS Safari button styling fix (-webkit-appearance: none)
  • Admin panel tabs wrap on narrow screens
  • Body scroll locked when drawer open

files