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)
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
git clone <repository-url>
cd invoicesCreate 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
docker compose up --build- Invoice service: http://localhost:8081
- Product service: http://localhost:8082
- User service: http://localhost:8083
- NIF service: http://localhost:8084
- Angular frontend: http://localhost:4200
- Flask AI microservice: http://localhost:5000
- RabbitMQ Management: http://localhost:15672 (user: guest, pass: guest)
- MongoDB: localhost:27017
- 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.
POST /api/invoices/upload— Upload an invoice (.HEIC)GET /api/invoices— Fetch all invoicesPOST /api/invoices— Add a new invoice (manual)GET /api/invoices/:id— Fetch invoice by IDDELETE /api/invoices/:id— Delete invoice by IDGET /api/products— Fetch productsGET /api/users— Fetch usersGET /api/nif/validate— Validate NIF
- Backend: Go 1.21+, Gin, MongoDB driver, RabbitMQ
- AI Microservice: Python 3.11+, Flask, Pillow, pyheif, pytesseract, OpenCV, pyzbar
- Frontend: Angular 17+, Bootstrap, TailwindCSS
- 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
MIT
Pull requests and issues are welcome!