Customer Web Portal - Transaction & Invoice Viewer #5

Open
opened 2026-04-10 14:48:20 +02:00 by opencode · 0 comments
Collaborator

Summary

Add a persistent web server allowing customers to login and view their transactions and invoices.

Requirements

  • Web Framework: Axum (Rust)
  • Server Mode: Separate binary (invoice-server)
  • Authentication: Username/password login against customer table
  • Session Management: Cookie-based sessions

Features

Phase 1 - Minimal Viable

  • Hello world endpoint
  • Login page
  • Customer authentication
  • Session management

Phase 2 - Core Features

  • Customer sees own transactions (list filtered by customer_id)
  • Transaction details view
  • Date range filtering
  • Invoice HTML view

Phase 3 - Future

  • PDF invoice download
  • Export transactions to CSV
  • Email notifications
  • Password reset flow

Technical Notes

  • New binary: src/server/main.rs
  • Add axum to Cargo.toml
  • Reuse existing customers table for auth
  • Separate port from CLI (default: 8080)
  • Config via config.toml

Priority

Prevent scope creep - implement phase 1-2 before adding features.


Implementation (Phase 1 complete)

Commit: 4 commits on branch issue-5

  • 23763eb - Basic Axum server with hello endpoint
  • bf31098 - Login page
  • a175116 - Login POST with DB auth
  • 0d22d75 - Session management

Files changed:

  • Cargo.toml - Added axum, tower, cookie, uuid deps
  • src/server/main.rs - Web server binary
  • src/db/models.rs - Added password_hash field
  • src/db/repository.rs - Updated query for password_hash
  • migrations/003_add_password.sql - Schema migration
  • tests/server_test.rs - Tests for endpoints
## Summary Add a persistent web server allowing customers to login and view their transactions and invoices. ## Requirements - **Web Framework**: Axum (Rust) - **Server Mode**: Separate binary (invoice-server) - **Authentication**: Username/password login against customer table - **Session Management**: Cookie-based sessions ## Features ### Phase 1 - Minimal Viable - [x] Hello world endpoint - [x] Login page - [x] Customer authentication - [x] Session management ### Phase 2 - Core Features - [ ] Customer sees own transactions (list filtered by customer_id) - [ ] Transaction details view - [ ] Date range filtering - [ ] Invoice HTML view ### Phase 3 - Future - [ ] PDF invoice download - [ ] Export transactions to CSV - [ ] Email notifications - [ ] Password reset flow ## Technical Notes - New binary: src/server/main.rs - Add axum to Cargo.toml - Reuse existing customers table for auth - Separate port from CLI (default: 8080) - Config via config.toml ## Priority Prevent scope creep - implement phase 1-2 before adding features. --- ## Implementation (Phase 1 complete) **Commit:** 4 commits on branch `issue-5` - `23763eb` - Basic Axum server with hello endpoint - `bf31098` - Login page - `a175116` - Login POST with DB auth - `0d22d75` - Session management **Files changed:** - `Cargo.toml` - Added axum, tower, cookie, uuid deps - `src/server/main.rs` - Web server binary - `src/db/models.rs` - Added password_hash field - `src/db/repository.rs` - Updated query for password_hash - `migrations/003_add_password.sql` - Schema migration - `tests/server_test.rs` - Tests for endpoints
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jakob/rusty-petroleum#5