{"id":20039082,"url":"https://github.com/defra/sroc-charging-module-api","last_synced_at":"2026-03-01T13:33:47.914Z","repository":{"id":37093635,"uuid":"303344151","full_name":"DEFRA/sroc-charging-module-api","owner":"DEFRA","description":"Charge calculation and transaction billing API","archived":false,"fork":false,"pushed_at":"2026-02-22T17:15:47.000Z","size":6558,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T22:00:03.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-12T09:35:57.000Z","updated_at":"2026-02-22T17:14:38.000Z","dependencies_parsed_at":"2023-02-18T07:31:13.113Z","dependency_job_id":"f33fcb0a-272b-474e-9388-5430c0ec4f06","html_url":"https://github.com/DEFRA/sroc-charging-module-api","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/DEFRA/sroc-charging-module-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fsroc-charging-module-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fsroc-charging-module-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fsroc-charging-module-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fsroc-charging-module-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/sroc-charging-module-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fsroc-charging-module-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29970426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T13:32:00.443Z","status":"ssl_error","status_checked_at":"2026-03-01T13:32:00.084Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-13T10:35:22.351Z","updated_at":"2026-03-01T13:33:47.894Z","avatar_url":"https://github.com/DEFRA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SROC Charging Module API\n\n![Build Status](https://github.com/DEFRA/sroc-charging-module-api/workflows/CI/badge.svg?branch=main)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_sroc-charging-module-api\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DEFRA_sroc-charging-module-api)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_sroc-charging-module-api\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_sroc-charging-module-api)\n[![Known Vulnerabilities](https://snyk.io/test/github/DEFRA/sroc-charging-module-api/badge.svg)](https://snyk.io/test/github/DEFRA/sroc-charging-module-api)\n[![Licence](https://img.shields.io/badge/Licence-OGLv3-blue.svg)](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3)\n\nThis API provides an interface for calculating charges, queuing transactions and generating transaction files used to produce invoices.\n\n## Prerequisites\n\nMake sure you already have:\n\n- [Node.js v16.*](https://nodejs.org/en/)\n- [PostgreSQL v12](https://www.postgresql.org/)\n\n## Installation\n\nFirst clone the repository and then drop into your new local repo:\n\n```bash\ngit clone https://github.com/DEFRA/sroc-charging-module-api.git \u0026\u0026 cd sroc-charging-module-api\n```\n\nOur preference is to run the database and API within Docker, so [install Docker](https://docs.docker.com/get-docker/) if you don't already have it.\n\n## Configuration\n\nAny configuration is expected to be driven by environment variables when the service is run in production as per [12 factor app](https://12factor.net/config).\n\nHowever when running locally in development mode or in test it makes use of the [Dotenv](https://github.com/motdotla/dotenv) package. This is a shim that will load values stored in a `.env` file into the environment which the service will then pick up as though they were there all along.\n\nCheck out [.env.example](/.env.example) for details of the required things you'll need in your `.env` file.\n\nRefer to the [config files](config) for details of all the configuration used.\n\n## Docker\n\nAs [Docker](https://www.docker.com/) is our chosen solution for deploying and managing the app in production we also use it for local development. The following will get an environment up and running quickly ready for development. It assumes 2 things\n\n- you have Docker installed\n- you are using [VSCode](https://code.visualstudio.com/) for development\n\n### Initial build\n\nOpen the project in VSCode and then use the [Command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) to access the tasks we have provided in [tasks.json](.vscode/tasks.json)\n\nWith the palette open search for **Run test task** and once highlighted select it. From the list that's presented select **⬆️ UP (CMA)**\n\nYou should see a new terminal open up and [Docker Compose](https://docs.docker.com/compose/) begin to start building the images. Once that is done it will switch to running the API in docker.\n\n### Prep the databases\n\nThe main database is automatically created but the 'test' database is not. Plus both need the [DB migrations](/db/migrations) to be run against them, and the main database needs to be [seeded](/db/seeds).\n\nThe good news is all this is automated. Again, using the command palette and the **Run test task** option find and select **🗄️ DB (CMA)**. It will setup both databases and leave the API ready for use.\n\n\u003e You can also use this same command to reset the databases at anytime\n\n### Non-vscode users\n\nIf you are not a VSCode user it does not mean you cannot use Docker. Refer to [tasks.json](.vscode/tasks.json) for the commands being run and implement them in your preferred tool.\n\n## Testing the app\n\nTo run lint checks use the command palette and the **Run test task** option to find and select\n\n- **🔎 LINT (CMA)**\n\nTo run unit tests find and select\n\n- **✅ TEST (CMA)**\n\nCheck out the `scripts` in [package.json](package.json) if you intend to run things locally.\n\n## Contributing to this project\n\nIf you have an idea you'd like to contribute please log an issue.\n\nAll contributions should be submitted via a pull request.\n\n## License\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:\n\n\u003chttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\u003e\n\nThe following attribution statement MUST be cited in your products and applications when using this information.\n\n\u003e Contains public sector information licensed under the Open Government license v3\n\n### About the license\n\nThe Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.\n\nIt is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fsroc-charging-module-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fsroc-charging-module-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fsroc-charging-module-api/lists"}