{"id":25497248,"url":"https://github.com/jurajmajer/invoice-microservice","last_synced_at":"2026-04-10T07:02:57.113Z","repository":{"id":275118599,"uuid":"925103108","full_name":"jurajmajer/invoice-microservice","owner":"jurajmajer","description":"Microservice written in Python for creating invoices based on jinja templates","archived":false,"fork":false,"pushed_at":"2025-03-05T14:54:04.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T11:45:40.569Z","etag":null,"topics":["docker","fastapi","invoice-generator","jinja2","kubernetes","microservice","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jurajmajer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-31T08:29:28.000Z","updated_at":"2025-03-05T14:54:08.000Z","dependencies_parsed_at":"2025-03-05T14:39:31.311Z","dependency_job_id":null,"html_url":"https://github.com/jurajmajer/invoice-microservice","commit_stats":null,"previous_names":["jurajmajer/invoice-microservice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jurajmajer/invoice-microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurajmajer%2Finvoice-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurajmajer%2Finvoice-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurajmajer%2Finvoice-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurajmajer%2Finvoice-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jurajmajer","download_url":"https://codeload.github.com/jurajmajer/invoice-microservice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurajmajer%2Finvoice-microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280833006,"owners_count":26398970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","fastapi","invoice-generator","jinja2","kubernetes","microservice","python3"],"created_at":"2025-02-19T01:18:55.042Z","updated_at":"2025-10-24T17:10:19.824Z","avatar_url":"https://github.com/jurajmajer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice Microservice\n[![Build Docker Image](https://github.com/jurajmajer/invoice-microservice/actions/workflows/build-docker-image.yml/badge.svg)](https://github.com/jurajmajer/invoice-microservice/actions/workflows/build-docker-image.yml)\n![pylint Score](https://mperlet.github.io/pybadge/badges/9.94.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/jurajmajer/invoice-microservice/blob/main/LICENSE)\n\n## Installation on Kubernetes\n1. Create database on your DB server. We use MySQL.\n```sql\nCREATE DATABASE IF NOT EXISTS `invoice-microservice` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'invoice-microservice'@'%' IDENTIFIED BY '\u003cinsert_password_here\u003e';\nGRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, LOCK TABLES ON `invoice-microservice`.* TO 'invoice-microservice'@'%';\n```\n2. Create schema in the database using Alembic migration.\n3. Review deployment scripts for Kubernetes in folder `infra/k8s`. At minimum you have to modify `1-init.yaml` and set secret values (replace `\u003cdefine-this\u003e` with actual value).\n4. Apply kubernetes scripts:\n```\nkubectl apply -f infra/k8s/1-init.yaml\nkubectl apply -f infra/k8s/2-define-storage.yaml\nkubectl apply -f infra/k8s/3-deployment.yaml\n```\n5. Save your invoice templates to TEMPLATE_ROOT. See details about TEMPLATE_ROOT structure below.\n\n### Environment variables which need to be set in runtime\n* `TEMPLATE_ROOT` - folder where all templates are stored. No default value, must be set.\n* `OUTPUT_FOLDER` - folder where created invoices will be saved. No default value, must be set.\n* `DEFAULT_LANG` - default language. If template for requested language is not found, default language will be used if set. No default value, optional parameter.\n* `DB_URI` - Database connection string. No default value, must be set. E.g.: mysql://invoice-microservice:\u003cpassword\u003e@\u003cdb-server\u003e/invoice-microservice\n\n### TEMPLATE_ROOT structure\ninvoice-microservice assumes following structure of TEMPLATE_ROOT folder:\n\n```\nTEMPLATE_ROOT\n│\n└───en\n│   │\n│   └───\u003ctemplateId1\u003e\n│   │      html.jinja2\n│   │      params.json\n│   │  \n│   └───\u003ctemplateId2\u003e\n|          html.jinja2\n|          params.json\n│\n└───de\n│   │\n│   └───\u003ctemplateId1\u003e\n│   │      html.jinja2\n│   │  \n│   └───\u003ctemplateId2\u003e\n|          html.jinja2\n```\nUnder TEMPLATE_ROOT there is a set of folders named by languages (`en`, `de` etc.). In every language folder there are folders named by template IDs. In every template ID folder there must be one file for html invoice template named exactly `html.jinja2` and one optional file containing template params named exactly `params.json`.\n\n## Usage\nOther pods should use OpenAPI interface of invoice-microservice to use it. OpenAPI interface does not require any authentication. It is assumed invoice-microservice is accessible only within the cluster. Swagger documentation is available after installation under [http://\\\u003cinvoice-microservice\\\u003e/docs](http://invoice-microservice/docs). Alternatively, you can check out the swagger UI [here](https://jurajmajer.github.io/invoice-microservice/openapi/).\n\n\n## Contribution / Development\n### Generate requirements.txt (Powershell)\nNavigate in Powershell to the root folder of project, e.g. `C:\\projects\\invoice-microservice` and execute:\n```Powershell\n.\\script\\create-pip-requirements.ps1\n```\n\n### Generate and apply Alembic migration (Powershell)\nNavigate in Powershell to `db` folder of project, e.g. `C:\\projects\\invoice-microservice\\app\\db` and execute:\n```Powershell\n$env:PYTHONPATH = 'C:/projects/invoice-microservice/'\n$env:DB_URI = 'mysql://invoice-microservice:\u003cpassword\u003e@localhost/invoice-microservice'\nalembic revision --autogenerate -m \"\u003ccustom message\u003e\"\nalembic upgrade head\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurajmajer%2Finvoice-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjurajmajer%2Finvoice-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurajmajer%2Finvoice-microservice/lists"}