From 517e95adc24df957bc78ec9ccf1d5a90654cf9e8 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sun, 21 Jun 2026 18:39:48 +0000 Subject: [PATCH] chore: rebrand ReceiptNext to NextExpense - Rename Go module from github.com/cclohmar/ReceiptNext to NextExpense - Update all import paths across 7 Go source files - Update templates (titles, headings, branding) - Update static files (manifest.json, sw.js, CSS) - Update config (Makefile, install.sh, .env.example) - Update README with new name and URLs - Rename service file receiptnext.service -> nextexpense.service - Update install paths, service names, log paths in install.sh --- .env.example | 2 +- Makefile | 6 +++--- README.md | 22 +++++++++---------- contrib/nextexpense.service | 25 ++++++++++++++++++++++ contrib/receiptnext.service | 25 ---------------------- go.mod | 2 +- install.sh | 40 +++++++++++++++++------------------ internal/email/smtp.go | 6 +++--- internal/handlers/auth.go | 10 ++++----- internal/handlers/events.go | 6 +++--- internal/handlers/expenses.go | 8 +++---- internal/handlers/file.go | 6 +++--- internal/utils/uuid.go | 2 +- main.go | 14 ++++++------ static/css/style.css | 2 +- static/manifest.json | 4 ++-- static/sw.js | 8 +++---- templates/dashboard.html | 4 ++-- templates/event_expenses.html | 2 +- templates/index.html | 4 ++-- templates/onboarding.html | 4 ++-- 21 files changed, 101 insertions(+), 101 deletions(-) create mode 100644 contrib/nextexpense.service delete mode 100644 contrib/receiptnext.service diff --git a/.env.example b/.env.example index a3eb775..00d6164 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -# ReceiptNext Configuration +# NextExpense Configuration # Copy this file to .env and fill in your credentials. # Run `bash install.sh` for interactive setup. diff --git a/Makefile b/Makefile index 8c7b224..4d27d20 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# ReceiptNext — AI-Powered Expense Tracker +# NextExpense — AI-Powered Expense Tracker # Makefile for build, install, and deployment BINARY = app @@ -30,7 +30,7 @@ build-all: build-linux-amd64 build-linux-arm64 # ------------------------------------------------------------------- install: build - @echo "==> Installing ReceiptNext..." + @echo "==> Installing NextExpense..." cp $(BINARY) /usr/local/bin/$(BINARY) @if [ ! -f /etc/$(BINARY)/.env ]; then \ mkdir -p /etc/$(BINARY); \ @@ -52,7 +52,7 @@ uninstall: -rm -f /etc/systemd/system/$(BINARY).service -systemctl daemon-reload -rm -f /usr/local/bin/$(BINARY) - @echo "==> ReceiptNext uninstalled" + @echo "==> NextExpense uninstalled" # ------------------------------------------------------------------- # Service management diff --git a/README.md b/README.md index 19469d4..f531147 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ReceiptNext — AI-Powered Expense Tracker +# NextExpense — AI-Powered Expense Tracker > A production-ready, mobile-first Progressive Web App (PWA) for expense management with passwordless OTP login, AI receipt extraction (Gemini / OpenAI-compatible), and CSV/PDF email reporting with receipt images. @@ -9,7 +9,7 @@ ## 🚀 One-Command Install ```bash -bash -c "$(curl -fsSL https://git.lohmar.co.uk/cclohmar/ReceiptNext/raw/branch/main/install.sh)" +bash -c "$(curl -fsSL https://git.lohmar.co.uk/cclohmar/NextExpense/raw/branch/main/install.sh)" ``` Or from a local clone: @@ -20,7 +20,7 @@ Or from a local clone: The installer will: -1. Clone the repo to `/opt/receiptnext/` +1. Clone the repo to `/opt/nextexpense/` 2. Build the binary (pure Go, no CGO, no dependencies) 3. Ask which AI provider to use: @@ -30,9 +30,9 @@ The installer will: ``` 4. Prompt for SMTP settings (for OTP emails and report delivery) -5. Create `/opt/receiptnext/.env` with all configuration +5. Create `/opt/nextexpense/.env` with all configuration 6. Set up a systemd service that auto-starts on boot -7. Start ReceiptNext +7. Start NextExpense **Result:** A fully configured, always-running expense tracker at `http://YOUR_SERVER:8080`. @@ -41,7 +41,7 @@ The installer will: ## 🔄 Updating ```bash -bash /opt/receiptnext/install.sh -update +bash /opt/nextexpense/install.sh -update ``` Update pulls the latest code, copies updated templates/static, rebuilds the binary, automatically backs up the database, and restarts the service. @@ -56,8 +56,8 @@ No pre-built binaries are distributed — building from source guarantees the la ### Manual Build ```bash -git clone https://git.lohmar.co.uk/cclohmar/ReceiptNext.git -cd ReceiptNext +git clone https://git.lohmar.co.uk/cclohmar/NextExpense.git +cd NextExpense # Build for your current platform CGO_ENABLED=0 go build -buildvcs=false -ldflags="-s -w" -o app . @@ -102,7 +102,7 @@ Configuration is via environment variables in `.env`. The install script builds ```bash # If installed via systemd: -systemctl start receiptnext +systemctl start nextexpense # Or run directly: ./app @@ -160,7 +160,7 @@ Navigate to `http://YOUR_SERVER:8080` ## 🏗️ Project Structure ``` -/opt/receiptnext/ +/opt/nextexpense/ ├── app # Compiled binary ├── .env # Configuration (optional) ├── backups/ # Automatic DB backups (from -update) @@ -177,7 +177,7 @@ Navigate to `http://YOUR_SERVER:8080` ├── install.sh # Installer script ├── Makefile # Build targets └── contrib/ - └── receiptnext.service # Systemd service file + └── nextexpense.service # Systemd service file ``` --- diff --git a/contrib/nextexpense.service b/contrib/nextexpense.service new file mode 100644 index 0000000..f2abefd --- /dev/null +++ b/contrib/nextexpense.service @@ -0,0 +1,25 @@ +[Unit] +Description=NextExpense — AI-Powered Expense Tracker +Documentation=https://git.lohmar.co.uk/cclohmar/NextExpense +After=network.target + +[Service] +Type=simple +User=nextexpense +Group=nextexpense +WorkingDirectory=/opt/nextexpense +ExecStart=/opt/nextexpense/app +Restart=always +RestartSec=5 +EnvironmentFile=-/opt/nextexpense/.env +StandardOutput=append:/var/log/nextexpense.log +StandardError=append:/var/log/nextexpense.log + +# Security hardening +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=full +ProtectHome=true + +[Install] +WantedBy=multi-user.target diff --git a/contrib/receiptnext.service b/contrib/receiptnext.service deleted file mode 100644 index e21161e..0000000 --- a/contrib/receiptnext.service +++ /dev/null @@ -1,25 +0,0 @@ -[Unit] -Description=ReceiptNext — AI-Powered Expense Tracker -Documentation=https://git.lohmar.co.uk/cclohmar/ReceiptNext -After=network.target - -[Service] -Type=simple -User=receiptnext -Group=receiptnext -WorkingDirectory=/opt/receiptnext -ExecStart=/opt/receiptnext/app -Restart=always -RestartSec=5 -EnvironmentFile=-/opt/receiptnext/.env -StandardOutput=append:/var/log/receiptnext.log -StandardError=append:/var/log/receiptnext.log - -# Security hardening -NoNewPrivileges=true -PrivateTmp=true -ProtectSystem=full -ProtectHome=true - -[Install] -WantedBy=multi-user.target diff --git a/go.mod b/go.mod index 1fee12c..79ecb16 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cclohmar/ReceiptNext +module github.com/cclohmar/NextExpense go 1.23.0 diff --git a/install.sh b/install.sh index 0467bf7..d989cb6 100755 --- a/install.sh +++ b/install.sh @@ -1,22 +1,22 @@ #!/usr/bin/env bash # -# ReceiptNext Installer +# NextExpense Installer # ===================== # # Usage: -# curl -fsSL https://git.lohmar.co.uk/cclohmar/ReceiptNext/raw/branch/main/install.sh | bash +# curl -fsSL https://git.lohmar.co.uk/cclohmar/NextExpense/raw/branch/main/install.sh | bash # bash install.sh — Full install # bash install.sh -update — Pull latest, rebuild, restart # -# Installs to /opt/receiptnext/ and sets up a systemd service. +# Installs to /opt/nextexpense/ and sets up a systemd service. # Uses sudo internally only for operations that require it. # set -euo pipefail -INSTALL_DIR="/opt/receiptnext" -SERVICE_NAME="receiptnext" -REPO_URL="https://git.lohmar.co.uk/cclohmar/ReceiptNext.git" +INSTALL_DIR="/opt/nextexpense" +SERVICE_NAME="nextexpense" +REPO_URL="https://git.lohmar.co.uk/cclohmar/NextExpense.git" RED='\033[0;31m' GREEN='\033[0;32m' @@ -44,7 +44,7 @@ sudo_if() { if [ "${1:-}" = "-update" ]; then echo "" echo " ╔═══════════════════════════════════════╗" - echo " ║ ReceiptNext — Update Mode ║" + echo " ║ NextExpense — Update Mode ║" echo " ╚═══════════════════════════════════════╝" echo "" @@ -66,10 +66,10 @@ if [ "${1:-}" = "-update" ]; then else warn "Not a git repository — re-cloning..." cd /tmp - rm -rf receiptnext-update - sudo_if git clone "$REPO_URL" receiptnext-update - sudo_if rsync -a --delete receiptnext-update/ "$INSTALL_DIR/" - rm -rf receiptnext-update + rm -rf nextexpense-update + sudo_if git clone "$REPO_URL" nextexpense-update + sudo_if rsync -a --delete nextexpense-update/ "$INSTALL_DIR/" + rm -rf nextexpense-update cd "$INSTALL_DIR" fi @@ -144,7 +144,7 @@ if [ "${1:-}" = "-update" ]; then sleep 2 if systemctl is-active --quiet "$SERVICE_NAME"; then - info "Update complete — ReceiptNext is running" + info "Update complete — NextExpense is running" else warn "Service did not start. Check: systemctl status $SERVICE_NAME" fi @@ -156,7 +156,7 @@ fi # ────────────────────────────────────────────────────────────────── echo "" echo " ╔═══════════════════════════════════════╗" -echo " ║ ReceiptNext Installer ║" +echo " ║ NextExpense Installer ║" echo " ╚═══════════════════════════════════════╝" echo "" @@ -327,7 +327,7 @@ fi # ── 7. Write .env ──────────────────────────────────────────────── info "Creating .env..." sudo_if tee "$INSTALL_DIR/.env" > /dev/null << ENVEOF -# ReceiptNext Configuration +# NextExpense Configuration # Generated by install.sh on $(date) PORT=${PORT} @@ -386,8 +386,8 @@ sudo_if chmod 775 "${INSTALL_DIR}/storage" info "Creating systemd service..." sudo_if tee "/etc/systemd/system/${SERVICE_NAME}.service" > /dev/null << SERVEOF [Unit] -Description=ReceiptNext — AI-Powered Expense Tracker -Documentation=https://git.lohmar.co.uk/cclohmar/ReceiptNext +Description=NextExpense — AI-Powered Expense Tracker +Documentation=https://git.lohmar.co.uk/cclohmar/NextExpense After=network.target [Service] @@ -399,8 +399,8 @@ ExecStart=${INSTALL_DIR}/app Restart=always RestartSec=5 EnvironmentFile=-${INSTALL_DIR}/.env -StandardOutput=append:/var/log/receiptnext.log -StandardError=append:/var/log/receiptnext.log +StandardOutput=append:/var/log/nextexpense.log +StandardError=append:/var/log/nextexpense.log [Install] WantedBy=multi-user.target @@ -411,7 +411,7 @@ sudo_if systemctl enable "${SERVICE_NAME}" info "Service created: /etc/systemd/system/${SERVICE_NAME}.service" # ── 9. Start ───────────────────────────────────────────────────── -info "Starting ReceiptNext..." +info "Starting NextExpense..." sudo_if systemctl restart "${SERVICE_NAME}" 2>/dev/null || true sleep 2 @@ -431,7 +431,7 @@ echo " Logs: journalctl -u $SERVICE_NAME -f" echo "" if systemctl is-active --quiet "${SERVICE_NAME}"; then - info "ReceiptNext is running on port ${PORT}" + info "NextExpense is running on port ${PORT}" echo " Open http://localhost:${PORT} (or your server IP)" else warn "Service did not start. Check: systemctl status ${SERVICE_NAME}" diff --git a/internal/email/smtp.go b/internal/email/smtp.go index cc6da2c..df79e77 100644 --- a/internal/email/smtp.go +++ b/internal/email/smtp.go @@ -1,4 +1,4 @@ -// Package email provides SMTP email sending for ExpenseFlow, including OTP +// Package email provides SMTP email sending for NextExpense, including OTP // verification codes and expense report emails with CSV or PDF attachments. // // Credentials are passed via the constructor; the caller is responsible for @@ -62,7 +62,7 @@ func NewSender(host, port, user, pass, from string) *Sender { // SendOTP sends a plain-text OTP verification email to the given recipient. // The email contains a standard subject line and the 6-digit verification code. func (s *Sender) SendOTP(to, code string) error { - subject := "Your ReceiptNext OTP" + subject := "Your NextExpense OTP" body := fmt.Sprintf("Your verification code is: %s", code) msg := buildPlainMessage(s.from, to, subject, body) @@ -194,7 +194,7 @@ func buildMultipartMessage(from, to, subject, body string, attachments []*Attach writeHeader(&b, "From", from) writeHeader(&b, "To", to) writeHeader(&b, "Subject", subject) - writeHeader(&b, "Message-ID", fmt.Sprintf("<%d.receiptnext@post.2-4-h.app>", time.Now().UnixNano())) + writeHeader(&b, "Message-ID", fmt.Sprintf("<%d.nextexpense@post.2-4-h.app>", time.Now().UnixNano())) writeHeader(&b, "Date", time.Now().Format(time.RFC1123Z)) // Create a multipart writer using a unique boundary string. diff --git a/internal/handlers/auth.go b/internal/handlers/auth.go index 85af0bc..96e19bd 100644 --- a/internal/handlers/auth.go +++ b/internal/handlers/auth.go @@ -1,4 +1,4 @@ -// Package handlers implements HTTP handlers for ExpenseFlow, providing +// Package handlers implements HTTP handlers for NextExpense, providing // passwordless email OTP authentication, event management, expense tracking, // and report generation endpoints. package handlers @@ -14,10 +14,10 @@ import ( "sync" "time" - "github.com/cclohmar/ReceiptNext/internal/auth" - "github.com/cclohmar/ReceiptNext/internal/database" - "github.com/cclohmar/ReceiptNext/internal/email" - "github.com/cclohmar/ReceiptNext/internal/utils" + "github.com/cclohmar/NextExpense/internal/auth" + "github.com/cclohmar/NextExpense/internal/database" + "github.com/cclohmar/NextExpense/internal/email" + "github.com/cclohmar/NextExpense/internal/utils" ) // --------------------------------------------------------------------------- diff --git a/internal/handlers/events.go b/internal/handlers/events.go index c53d2fa..428acd2 100644 --- a/internal/handlers/events.go +++ b/internal/handlers/events.go @@ -1,4 +1,4 @@ -// Package handlers provides HTTP request handlers for ExpenseFlow. +// Package handlers provides HTTP request handlers for NextExpense. // // This file implements event management endpoints including dashboard // listing, event creation, reopening, and expense viewing. @@ -15,8 +15,8 @@ import ( "strconv" "time" - "github.com/cclohmar/ReceiptNext/internal/database" - "github.com/cclohmar/ReceiptNext/internal/utils" + "github.com/cclohmar/NextExpense/internal/database" + "github.com/cclohmar/NextExpense/internal/utils" "github.com/go-chi/chi/v5" ) diff --git a/internal/handlers/expenses.go b/internal/handlers/expenses.go index cef7d36..e615ad1 100644 --- a/internal/handlers/expenses.go +++ b/internal/handlers/expenses.go @@ -1,4 +1,4 @@ -// Package handlers provides HTTP request handlers for ExpenseFlow. +// Package handlers provides HTTP request handlers for NextExpense. // // This file implements expense upload, AI extraction, and save handlers // that drive the core receipt capture workflow using HTMX partial responses. @@ -24,9 +24,9 @@ import ( "github.com/go-chi/chi/v5" "golang.org/x/image/draw" - "github.com/cclohmar/ReceiptNext/internal/ai" - "github.com/cclohmar/ReceiptNext/internal/database" - "github.com/cclohmar/ReceiptNext/internal/utils" + "github.com/cclohmar/NextExpense/internal/ai" + "github.com/cclohmar/NextExpense/internal/database" + "github.com/cclohmar/NextExpense/internal/utils" ) var uuidRe = regexp.MustCompile(`^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`) diff --git a/internal/handlers/file.go b/internal/handlers/file.go index acfc519..665c9c0 100644 --- a/internal/handlers/file.go +++ b/internal/handlers/file.go @@ -1,4 +1,4 @@ -// Package handlers implements HTTP request handlers for ExpenseFlow. +// Package handlers implements HTTP request handlers for NextExpense. // // This file implements the event filing workflow — generating CSV or PDF // expense reports and emailing them as attachments to a specified recipient. @@ -23,8 +23,8 @@ import ( "github.com/go-chi/chi/v5" "github.com/jung-kurt/gofpdf" - "github.com/cclohmar/ReceiptNext/internal/database" - "github.com/cclohmar/ReceiptNext/internal/email" + "github.com/cclohmar/NextExpense/internal/database" + "github.com/cclohmar/NextExpense/internal/email" ) // --------------------------------------------------------------------------- diff --git a/internal/utils/uuid.go b/internal/utils/uuid.go index 7964886..93fb354 100644 --- a/internal/utils/uuid.go +++ b/internal/utils/uuid.go @@ -1,4 +1,4 @@ -// Package utils provides common utility functions for ReceiptNext. +// Package utils provides common utility functions for NextExpense. package utils import ( diff --git a/main.go b/main.go index db0a887..797519c 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -// ReceiptNext — AI-Powered Expense Tracker +// NextExpense — AI-Powered Expense Tracker // // A production-ready, mobile-first Progressive Web App (PWA) that uses // passwordless email OTP login, event-based expense tracking, AI receipt @@ -27,11 +27,11 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/joho/godotenv" - "github.com/cclohmar/ReceiptNext/internal/auth" - "github.com/cclohmar/ReceiptNext/internal/database" - "github.com/cclohmar/ReceiptNext/internal/email" - "github.com/cclohmar/ReceiptNext/internal/handlers" - "github.com/cclohmar/ReceiptNext/internal/utils" + "github.com/cclohmar/NextExpense/internal/auth" + "github.com/cclohmar/NextExpense/internal/database" + "github.com/cclohmar/NextExpense/internal/email" + "github.com/cclohmar/NextExpense/internal/handlers" + "github.com/cclohmar/NextExpense/internal/utils" ) func main() { @@ -274,7 +274,7 @@ func main() { } }() - log.Printf("INFO main: ReceiptNext server starting on %s", addr) + log.Printf("INFO main: NextExpense server starting on %s", addr) log.Printf("INFO main: open http://localhost%s in your browser", addr) if err := srv.ListenAndServe(); err != http.ErrServerClosed { diff --git a/static/css/style.css b/static/css/style.css index 04a8d79..d7a85b2 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,5 +1,5 @@ /* ========================================================================== - ReceiptNext — PWA Expense Tracker Stylesheet + NextExpense — PWA Expense Tracker Stylesheet "The Terminal Mint" dark palette | Mobile-first responsive ========================================================================== */ diff --git a/static/manifest.json b/static/manifest.json index d672d4d..22a067c 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -1,6 +1,6 @@ { - "name": "ReceiptNext", - "short_name": "ReceiptNext", + "name": "NextExpense", + "short_name": "NextExpense", "start_url": "/", "display": "standalone", "theme_color": "#10b981", diff --git a/static/sw.js b/static/sw.js index f705975..aa961e3 100644 --- a/static/sw.js +++ b/static/sw.js @@ -1,11 +1,11 @@ /* ============================================================ - * ReceiptNext — Service Worker + * NextExpense — Service Worker * Version: 2.0.0 - * Cache name: receiptnext-v2 + * Cache name: nextexpense-v2 * Strategy: Cache-first for shell assets, network-only for API * ============================================================ */ -const CACHE_NAME = 'receiptnext-v1'; +const CACHE_NAME = 'nextexpense-v1'; // Shell assets to pre-cache on install const SHELL_ASSETS = [ @@ -195,7 +195,7 @@ self.addEventListener('fetch', event => { // Return a minimal offline fallback for navigations if (request.mode === 'navigate') { return new Response( - 'Offline — ReceiptNext

You\'re offline

ReceiptNext needs an internet connection to load. Please check your connection and try again.

', + 'Offline — NextExpense

You\'re offline

NextExpense needs an internet connection to load. Please check your connection and try again.

', { status: 503, statusText: 'Service Unavailable', diff --git a/templates/dashboard.html b/templates/dashboard.html index 53aa3ee..d8ccc7f 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -4,7 +4,7 @@ - ReceiptNext + NextExpense @@ -14,7 +14,7 @@
-

ReceiptNext

+

NextExpense

diff --git a/templates/event_expenses.html b/templates/event_expenses.html index 47143cb..8f2635b 100644 --- a/templates/event_expenses.html +++ b/templates/event_expenses.html @@ -4,7 +4,7 @@ - {{.Event.Name}} - ReceiptNext + {{.Event.Name}} - NextExpense diff --git a/templates/index.html b/templates/index.html index 8dfb24c..a63be7a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,7 +6,7 @@ - ReceiptNext + NextExpense @@ -19,7 +19,7 @@