reformat for gitea

This commit is contained in:
2025-10-17 09:12:59 +02:00
parent 3ad22163af
commit 88cf59550c

112
README.md
View File

@ -1,15 +1,17 @@
# Dusty Marble - RPNAB Invoicing Portal # 🧾 RPNAB Invoicing Portal
This is a Rust-based single-page web application for Rent & Petroleum Nordic AB, designed to streamline internal operations and provide customers with access to their invoice documents. 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 ## 🎯 Project Goal
The primary goal is to make invoicing more efficient by: The primary goal is to increase operational efficiency by:
- Allowing internal users to upload structured transaction lists (CSV)
- Converting those transactions into a format suitable for invoice attachments
- Giving customers secure access to view/download their invoices
The application will include both a web UI and a command-line interface for administrative tasks. - 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
--- ---
@ -17,67 +19,67 @@ The application will include both a web UI and a command-line interface for admi
### Core Technologies ### Core Technologies
| Layer | Tool | Notes | | Layer | Tool | Description |
|---------------|------------------|--------------------------------------------| |---------------|------------------|-------------|
| Frontend | [Leptos](https://github.com/leptos-rs/leptos) | Rust SPA framework with reactive UI | | Frontend | [Leptos](https://github.com/leptos-rs/leptos) | Rust-based SPA framework with SSR support |
| Backend | [Axum](https://github.com/tokio-rs/axum) | Lightweight async Rust web framework | | Backend | [Axum](https://github.com/tokio-rs/axum) | Async Rust web framework |
| Database | MariaDB + [`sqlx`](https://github.com/launchbadge/sqlx) | Compile-time checked queries | | Database | MariaDB + [`sqlx`](https://github.com/launchbadge/sqlx) | Compile-time verified SQL queries |
| Migrations | [Goose](https://github.com/sifrr/goose) | Simple SQL-based migration tool | | Migrations | [Goose](https://github.com/sifrr/goose) | SQL migration runner |
| CLI Tooling | Rust + [`clap`](https://github.com/clap-rs/clap) | For admin-only workflows | | CSV Parsing | [`csv`](https://docs.rs/csv/latest/csv/) | High-performance CSV parser |
| CSV Parsing | [`csv`](https://docs.rs/csv/latest/csv/) | Robust parser with `serde` integration | | CLI Tools | Rust + [`clap`](https://github.com/clap-rs/clap) | Command-line admin tasks |
| PDF Generation| HTML + `wkhtmltopdf` or `weasyprint` | For generating styled invoice documents | | PDF Generation| HTML + `wkhtmltopdf` or `weasyprint` | Generate styled invoice documents |
| Styling | Tailwind CSS (optional) | Utility-first styling | | Styling | Tailwind CSS (optional) | Utility-first styling framework |
--- ---
## 🗺️ Development Plan ## 🗺️ Development Roadmap
### Phase 1: Project Setup ### Phase 1: Project Setup
- [x] Set up Git repository - [x] Create Git repository
- [ ] Initialize Cargo workspace - [ ] Initialize Rust workspace (`Cargo.toml`)
- [ ] Create initial `README.md` - [ ] Set up frontend, backend, CLI structure
- [ ] Set up Gitea repository - [x] Write project README
### Phase 2: Core Infrastructure ### Phase 2: Infrastructure
- [ ] Set up `frontend/` and `backend/` crates - [ ] Add `.env` and config boilerplate
- [ ] Configure `sqlx` and `Goose` for MariaDB - [ ] Set up Goose migration framework
- [ ] Define initial DB schema - [ ] Connect to MariaDB using `sqlx`
- [ ] Add `.env` for local secrets - [ ] Define initial DB schema (users, invoices, transactions)
### Phase 3: Admin Interface ### Phase 3: Admin Functions
- [ ] Implement login system for internal user - [ ] Implement admin login (cookie-based)
- [ ] Create CLI for uploading CSV files - [ ] Create CLI tool for CSV uploads
- [ ] Parse CSV and store transactions in DB - [ ] Parse CSV → normalize → store in DB
- [ ] Implement basic web UI for uploading and verifying CSV data - [ ] Web UI to verify and review uploads
### Phase 4: Customer Portal ### Phase 4: Customer Portal
- [ ] Implement customer login system - [ ] Implement customer login
- [ ] Create UI for listing invoices - [ ] Build UI to view invoice list
- [ ] Render invoices as HTML - [ ] Render invoice details
- [ ] Enable download of invoices as PDF - [ ] Add option to download as PDF
### Phase 5: Polish and Deployment ### Phase 5: Polish & Deploy
- [ ] Add basic access logging - [ ] Input validation + error handling
- [ ] Add error handling and input validation - [ ] Session persistence + CSRF protection
- [ ] Set up reverse proxy (e.g., Caddy) for HTTPS - [ ] Serve behind reverse proxy (Caddy)
- [ ] Package and deploy to FreeBSD jail - [ ] Deploy to FreeBSD jail
--- ---
## 📁 Project Structure (planned) ## 📁 Planned Project Structure
```text
rpnab-invoicing/ rpnab-invoicing/
├── frontend/ # Leptos SPA ├── frontend/ # Leptos SPA (Rust + WASM)
├── backend/ # Axum web API ├── backend/ # Axum HTTP API
├── cli/ # CSV import + admin commands ├── cli/ # Rust CLI binary for admin use
├── shared/ # Models, helpers, reused logic ├── shared/ # Common logic, models, parsing helpers
├── migrations/ # Goose SQL migration files ├── migrations/ # Goose SQL migration scripts
├── static/ # Public files (PDF template, CSS) ├── static/ # Public assets (PDF templates, CSS)
├── .env # DB and secret configs (local only) ├── .env # Local config (not checked in)
└── Cargo.toml └── Cargo.toml # Workspace definition
--- 🚧 Project Status
## 🚧 Status This project is in the planning and bootstrapping phase.
Initial development will begin in Q4 2025.
> Project is in early planning and infrastructure phase.
> Active development begins Q4 2025.