{"id":28929256,"url":"https://github.com/arevi/express-sql-license-api-template","last_synced_at":"2025-07-27T15:15:14.539Z","repository":{"id":42711062,"uuid":"293378171","full_name":"arevi/express-sql-license-api-template","owner":"arevi","description":"A minimal template for a hardware based licensing and authentication system, written in TypeScript using Express \u0026 TypeORM (SQL).","archived":false,"fork":false,"pushed_at":"2023-01-07T21:11:10.000Z","size":551,"stargazers_count":3,"open_issues_count":25,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-04T10:10:26.574Z","etag":null,"topics":["api","express","expressjs","javascript","licensing","nodejs","sql","template","typeorm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/arevi.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}},"created_at":"2020-09-06T23:25:32.000Z","updated_at":"2023-01-07T04:20:51.000Z","dependencies_parsed_at":"2023-02-08T02:02:19.024Z","dependency_job_id":null,"html_url":"https://github.com/arevi/express-sql-license-api-template","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/arevi/express-sql-license-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-sql-license-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-sql-license-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-sql-license-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-sql-license-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arevi","download_url":"https://codeload.github.com/arevi/express-sql-license-api-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-sql-license-api-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304281,"owners_count":23138307,"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","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":["api","express","expressjs","javascript","licensing","nodejs","sql","template","typeorm","typescript"],"created_at":"2025-06-22T14:16:00.362Z","updated_at":"2025-07-27T15:15:14.532Z","avatar_url":"https://github.com/arevi.png","language":"TypeScript","readme":"# Express SQL License API Template\nA minimal template for a hardware based licensing and authentication system, written in TypeScript using Express \u0026amp; SQL (TypeORM).\n\n\u0026nbsp;\n## Getting Started\n1. Git clone https://github.com/arevi/express-sql-license-api-template.git\n2. npm install\n\n3. Rename the \"database.sample.ts\" file to \"database.ts\"\n4. Provide your SQL database information within this file. The type is set to postgres by default (Recommended) but mySQL and many others are supported.\n\n\u0026nbsp;\n## NPM Commands\n| Command        | Effect                                                            |\n| -------------- | ----------------------------------------------------------------- |\n| `dev:start`    | Launches the api in development mode, with hot reloading enabled. |\n| `dev:webpack`  | Compiles a development build of the project                       |\n| `prod:webpack` | Compiles a production build of the project                        |\n\n\u0026nbsp;\n## API Specification\nThe following below is a minimal API specification to provide a quick overview of the template functionality.\n\n\u0026nbsp;\n### Auth/Verify (POST) \n---\nThe verify route provides an API route for sending a license key and machineId. This route will check if the key is currently bound to a machine. If it is bound to a machine it will verify it is the current machine being requested. If the key is not bound, it will then be bound the requesting machine.\n\n*Example Payload*\n```\nPOST\n\n{\n    \"key\":\"123456\",\n    \"machineId\":\"000000\"\n}\n```\n\n\u0026nbsp;\n### Auth/Reset (POST)\n---\nThe request route provides a convenient API route for removing the association of a machineId to a license key.\n\n*Example Payload*\n```\nPOST\n\n{\n    \"key\":\"123456\"\n}\n```\n\n\u0026nbsp;\n### Auth/Heartbeat (Get)\n---\nThe heartbeat route provides a simple api route for verifying a machineId is still registered to a key within this database. This helps prevent key abuse by authenticating, then resetting and allowing someone else to reuse a key.\n\n**The machineID is passed as a URL parameter.**\n\nExample Request\n```\nGET /auth/heartbeat/000000\n```\n\n\u0026nbsp;\n## API Responses\nTo keep the project minimal and simplified the API provides a preset number of responses corresponding to the result of the data result.\n\n\u0026nbsp;\n### Success Messages (HTTP Status Code 200)\n```\n{\n    \"message\": \"Success\"\n}\n```\n```\n{\n    \"message\":\"Key reset\"\n}\n```\n\n\u0026nbsp;\n### Failure Messages (HTTP Status Code 400 or 401)\n---\n```\n{\n    \"message\": \"Invalid key\"\n}\n```\n```\n{   \n    \"message\":\"Bad request\"\n}\n```\n```\n{\n    \"message\":\"The key is already bound.\"\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farevi%2Fexpress-sql-license-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farevi%2Fexpress-sql-license-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farevi%2Fexpress-sql-license-api-template/lists"}