Files
dusty-marble/README.md
2025-10-17 09:12:59 +02:00

3.0 KiB

🧾 RPNAB Invoicing Portal

A single-page Rust web app for Rent & Petroleum Nordic AB, designed to streamline internal invoice processing and provide secure access for customers to view their invoice documents.


🎯 Project Goal

The primary goal is to increase operational efficiency by:

  • Enabling admin users to upload structured CSV transaction data
  • Storing and linking those transactions to invoice records
  • Allowing customers to log in and view/download invoice documents (HTML or PDF)
  • Providing a command-line interface for admin-only tasks

🧰 Tech Stack

Core Technologies

Layer Tool Description
Frontend Leptos Rust-based SPA framework with SSR support
Backend Axum Async Rust web framework
Database MariaDB + sqlx Compile-time verified SQL queries
Migrations Goose SQL migration runner
CSV Parsing csv High-performance CSV parser
CLI Tools Rust + clap Command-line admin tasks
PDF Generation HTML + wkhtmltopdf or weasyprint Generate styled invoice documents
Styling Tailwind CSS (optional) Utility-first styling framework

🗺️ Development Roadmap

Phase 1: Project Setup

  • Create Git repository
  • Initialize Rust workspace (Cargo.toml)
  • Set up frontend, backend, CLI structure
  • Write project README

Phase 2: Infrastructure

  • Add .env and config boilerplate
  • Set up Goose migration framework
  • Connect to MariaDB using sqlx
  • Define initial DB schema (users, invoices, transactions)

Phase 3: Admin Functions

  • Implement admin login (cookie-based)
  • Create CLI tool for CSV uploads
  • Parse CSV → normalize → store in DB
  • Web UI to verify and review uploads

Phase 4: Customer Portal

  • Implement customer login
  • Build UI to view invoice list
  • Render invoice details
  • Add option to download as PDF

Phase 5: Polish & Deploy

  • Input validation + error handling
  • Session persistence + CSRF protection
  • Serve behind reverse proxy (Caddy)
  • Deploy to FreeBSD jail

📁 Planned Project Structure

rpnab-invoicing/
├── frontend/       # Leptos SPA (Rust + WASM)
├── backend/        # Axum HTTP API
├── cli/            # Rust CLI binary for admin use
├── shared/         # Common logic, models, parsing helpers
├── migrations/     # Goose SQL migration scripts
├── static/         # Public assets (PDF templates, CSS)
├── .env            # Local config (not checked in)
└── Cargo.toml      # Workspace definition

🚧 Project Status

This project is in the planning and bootstrapping phase.
Initial development will begin in Q4 2025.