Skip to content

biagio-scaglia/ruby-pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Pulse 💎

Expense Tracker intelligente con CLI + Web Dashboard

Caratteristiche

  • 🖥️ CLI interattiva per inserimento rapido delle spese
  • 🤖 Parsing automatico del testo con regex intelligenti
  • 📊 Classificazione automatica delle spese per categoria
  • 💾 Database SQLite per persistenza dati
  • 🌐 API REST con Sinatra
  • 📱 Dashboard web moderna e responsive
  • 📤 Export in CSV e JSON
  • 📈 Report mensili automatici

Installazione

bundle install

Utilizzo

Installazione Dipendenze

bundle install

CLI Interattiva

ruby bin/ruby_pulse

Oppure usando Rake:

rake cli

La CLI supporta comandi interattivi:

  • Inserisci direttamente una spesa: "Ho speso 25.50 euro per la spesa"
  • list - Mostra tutte le spese
  • report - Report mensile
  • categories - Riepilogo per categoria
  • export csv - Esporta in CSV
  • export json - Esporta in JSON
  • delete <id> - Elimina una spesa
  • quit - Esci

Server Web

ruby bin/server

Oppure usando Rake:

rake server

Poi apri il browser su http://localhost:4567

Esempi

Per vedere esempi di utilizzo:

ruby examples.rb

Oppure:

rake examples

Struttura del Progetto

ruby-onrails/
├── lib/
│   ├── ruby_pulse/
│   │   ├── expense.rb
│   │   ├── parser.rb
│   │   ├── classifier.rb
│   │   ├── database.rb
│   │   ├── repository.rb
│   │   ├── exporter.rb
│   │   └── report_generator.rb
│   └── ruby_pulse.rb
├── bin/
│   ├── ruby_pulse
│   └── server
├── config/
│   └── database.rb
├── db/
│   └── schema.rb
├── public/
│   └── css/
│       └── style.css
├── views/
│   └── dashboard.erb
└── Gemfile

Esempi di Input

La CLI accetta input testuali naturali:

  • "Ho speso 25.50 euro per la spesa al supermercato"
  • "Cena al ristorante: 45€"
  • "Netflix subscription 9.99"
  • "Benzina 60 euro"
  • "Farmacia 12.30"
  • "Libro di Ruby 29.99 euro"
  • "Bolletta luce 85.50"

Il sistema riconosce automaticamente:

  • ✅ Importi in vari formati (25.50, 25,50, €25.50, 25 euro)
  • ✅ Date (oggi, ieri, formato DD/MM/YYYY)
  • ✅ Categorie (Alimentari, Ristoranti, Trasporti, Intrattenimento, Shopping, Salute, Casa, Educazione)

Architettura

Il progetto segue principi di OOP pulita e separazione delle responsabilità:

  • Expense: Modello di dominio per le spese
  • ExpenseParser: Parsing intelligente del testo con regex
  • ExpenseClassifier: Classificazione automatica per categoria
  • Database: Gestione connessione SQLite (Singleton)
  • ExpenseRepository: Pattern Repository per accesso dati
  • Exporter: Export in CSV e JSON
  • ReportGenerator: Generazione report mensili e statistiche
  • Service: Facade principale per l'applicazione

Licenza

MIT

About

Expense Tracker intelligente con CLI + Web Dashboard

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published