Go to file
pooyarhz99 06307b09e5 Added woodpecker. 2025-10-16 17:20:27 +03:30
common Fixed MatterQuantity typing issue. 2025-09-07 15:30:21 +03:30
config Changed dockerfile, added error handling to /submit-document. 2025-07-12 17:41:17 +03:30
core temporary 2/9/2025 2025-09-02 15:39:47 +03:30
database initial commit 2025-07-07 18:48:38 +03:30
document Final qrcode 2025-09-13 21:15:29 +03:30
route Final qrcode 2025-09-13 21:15:29 +03:30
server Final qrcode 2025-09-13 21:15:29 +03:30
storage/2025/8-August/qrcode temporary 2/9/2025 2025-09-02 15:39:47 +03:30
.dockerignore Add Dockerfile and .dockerignore for containerization 2025-07-10 16:39:17 +03:30
.env.example document generation, and signing are usable now 2025-07-10 14:42:25 +03:30
.gitignore Returns qr_code and doc_id upon sumbission, added a new api handler as fallback for qr_code link generation. 2025-09-03 16:50:35 +03:30
Dockerfile Dockerfile typo 2025-09-07 15:34:18 +03:30
README.md Returns qr_code and doc_id upon sumbission, added a new api handler as fallback for qr_code link generation. 2025-09-03 16:50:35 +03:30
deploy.sh Reverted Dockerfile changes 2025-07-12 14:42:44 +00:00
go.mod temporary 2/9/2025 2025-09-02 15:39:47 +03:30
go.sum temporary 2/9/2025 2025-09-02 15:39:47 +03:30
main.go initial commit 2025-07-07 18:48:38 +03:30
woodpecker.yml Added woodpecker. 2025-10-16 17:20:27 +03:30

README.md

Build

Requires go 1.24.3 and later (as specified in go.mod).

Windows
C:\> go build -o iralex-einvoice.exe
Linux & MacOS

Todo...

Usage

  1. Create the required environment variables according to the .env.example file. If not provided, the application aborts.
  2. Run the program:
    root@ubuntu:~$ iralex-einvoice.exe
    Listening on http://0.0.0.0:1404
    
  3. The GET /ping route can be used to check if the server is running properly.
  4. The GET /submit route can be used to submit an invoice. The body must have the necessary invoice data to submit.

Port

You can specify the port the application listens on. There are two ways to do this. You can either specify the PORT environment variable.

Linux and MacOS:

export PORT=8080

Windows:

set PORT=8080

.env File:

PORT=8080

Or you can specify the port inline using the -port command-line argument:

root@ubuntu:~$ iralex-einvoice.exe -port=8080
Listening on http://0.0.0.0:8080

Note that -port (command-line argument) has a higher priority than PORT (environment variable). So specifying -port overwrites everything else. If nothing is specified, a default port will be opened.

Module Structure

  • common: Contains common types for use between packages in order to avoid cyclic dependencies. This package should not depend on any other package except those from the standard library or third-party libraries.
  • config: Some configurations for the application, such as default timeout, default port, debug mode, etc.
  • core: Core functionalities, including logging, environment variables, command-line arguments, disk operations, and a very simple file-based caching system.
  • document: Document generation, signing, etc.
  • route: The third-party API routes the application calls into, such as those of Iralex and LHDN.
  • server: A simple HTTP server.