Skip to content

QuickInvoice is a lightweight invoice management system with an event-driven architecture, developed with Angular, Go (Gin), MongoDB, RabbitMQ, and Docker. It provides a reactive frontend and Go-based microservices optimized for real-time processing and scalability.

Notifications You must be signed in to change notification settings

JoaoValente/quickInvoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickInvoice

A modern microservices-based application for managing invoices, featuring:

  • Go Microservices (Invoice, Product, User, NIF, RabbitMQ event handler)
  • Flask AI Microservice (HEIC image OCR & QR code extraction)
  • Angular Frontend
  • MongoDB (data storage)
  • RabbitMQ (message queue for async/event-driven tasks)
  • Docker Compose (easy orchestration of all services)

📦 Project Structure

invoices/
│
├── docker-compose.yml
│
├── invoice-service/           # Go microservice for invoices
│   ├── main.go
│   ├── go.mod
│   ├── Dockerfile
│   ├── api/
│   │   ├── controllers/
│   │   ├── models/
│   │   ├── routes/
│   │   └── services/
│   └── ...
│
├── product-service/           # Go microservice for products
│   ├── main.go
│   ├── go.mod
│   ├── Dockerfile
│   └── ...
│
├── user-service/              # Go microservice for users/auth
│   ├── main.go
│   ├── go.mod
│   ├── Dockerfile
│   └── ...
│
├── nif-service/               # Go microservice for NIF validation/lookup
│   ├── main.go
│   ├── go.mod
│   ├── Dockerfile
│   └── ...
│
├── rabbitmq-service/          # Go microservice for RabbitMQ event handling
│   ├── main.go
│   ├── go.mod
│   ├── Dockerfile
│   └── ...
│
├── ai-microservice/           # Flask microservice for OCR/QR
│   ├── app.py
│   ├── requirements.txt
│   ├── Dockerfile
│   └── ...
│
├── frontend/                  # Angular frontend
│   ├── src/
│   ├── Dockerfile
│   └── ...
│
└── README.md

🚀 Quick Start

1. Clone the repository

git clone <repository-url>
cd invoices

2. Set up environment variables

Create a .env file in each Go microservice directory (e.g., invoice-service/, product-service/, etc.) as needed:

MONGO_USER=your_mongo_user
MONGO_PASS=your_mongo_pass

3. Build and run all services

docker compose up --build

🧩 Microservices Overview

  • invoice-service: CRUD for invoices, communicates with product, user, NIF, and AI microservices.
  • product-service: CRUD for products.
  • user-service: User management and authentication.
  • nif-service: NIF validation and lookup.
  • rabbitmq-service: Handles async events, can be a worker or event processor.
  • ai-microservice: OCR/QR extraction from images.
  • frontend: Angular UI for manual entry, upload, and gallery.

📝 Example API Endpoints

  • POST /api/invoices/upload — Upload an invoice (.HEIC)
  • GET /api/invoices — Fetch all invoices
  • POST /api/invoices — Add a new invoice (manual)
  • GET /api/invoices/:id — Fetch invoice by ID
  • DELETE /api/invoices/:id — Delete invoice by ID
  • GET /api/products — Fetch products
  • GET /api/users — Fetch users
  • GET /api/nif/validate — Validate NIF

🛠️ Development

  • Backend: Go 1.21+, Gin, MongoDB driver, RabbitMQ
  • AI Microservice: Python 3.11+, Flask, Pillow, pyheif, pytesseract, OpenCV, pyzbar
  • Frontend: Angular 17+, Bootstrap, TailwindCSS

🐳 Docker Compose Services

  • invoice-service: Go API for invoices
  • product-service: Go API for products
  • user-service: Go API for users
  • nif-service: Go API for NIF validation
  • rabbitmq-service: Go RabbitMQ event handler
  • ai-microservice: Flask OCR/QR
  • frontend: Angular app
  • mongo: MongoDB database
  • rabbitmq: Message broker

📄 License

MIT


🤝 Contributing

Pull requests and issues are welcome!

About

QuickInvoice is a lightweight invoice management system with an event-driven architecture, developed with Angular, Go (Gin), MongoDB, RabbitMQ, and Docker. It provides a reactive frontend and Go-based microservices optimized for real-time processing and scalability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published