{"id":28929297,"url":"https://github.com/arevi/express-mongo-license-api-template","last_synced_at":"2025-07-25T17:38:54.122Z","repository":{"id":42710770,"uuid":"293641157","full_name":"arevi/express-mongo-license-api-template","owner":"arevi","description":"A minimal template for a hardware based licensing and authentication system, written in TypeScript using Express \u0026 MongoDB.","archived":false,"fork":false,"pushed_at":"2023-01-07T21:11:55.000Z","size":555,"stargazers_count":12,"open_issues_count":25,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-04T10:10:26.361Z","etag":null,"topics":["api","express","expressjs","javascript","licensing","mongodb","mongoose","nodejs","template","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-07T22:02:31.000Z","updated_at":"2022-09-02T21:48:05.000Z","dependencies_parsed_at":"2023-02-08T02:00:39.908Z","dependency_job_id":null,"html_url":"https://github.com/arevi/express-mongo-license-api-template","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/arevi/express-mongo-license-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-mongo-license-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-mongo-license-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-mongo-license-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-mongo-license-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arevi","download_url":"https://codeload.github.com/arevi/express-mongo-license-api-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arevi%2Fexpress-mongo-license-api-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304275,"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","mongodb","mongoose","nodejs","template","typescript"],"created_at":"2025-06-22T14:16:11.599Z","updated_at":"2025-07-25T17:38:54.102Z","avatar_url":"https://github.com/arevi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express MongoDB License API Template\n\nA minimal template for a hardware based licensing and authentication system, written in TypeScript using Express \u0026amp; MongoDB (Mongoose).\n\n\u0026nbsp;\n\n## Getting Started\n\n1. Git clone https://github.com/arevi/express-mongo-license-api-template.git\n2. npm install\n\n3. Rename the \"database.sample.ts\" file to \"database.ts\"\n4. Provide your MongoURI within this file.\n\n\u0026nbsp;\n\n## NPM Commands\n\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\n## API Specification\n\nThe following below is a minimal API specification to provide a quick overview of the template functionality.\n\n\u0026nbsp;\n\n### Auth/Verify (POST)\n\n---\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\n```\nPOST\n\n{\n    \"key\":\"123456\",\n    \"machineId\":\"000000\"\n}\n```\n\n\u0026nbsp;\n\n### Auth/Reset (POST)\n\n---\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\n```\nPOST\n\n{\n    \"key\":\"123456\"\n}\n```\n\n\u0026nbsp;\n\n### Auth/Heartbeat (Get)\n\n---\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\n```\nGET /auth/heartbeat/000000\n```\n\n\u0026nbsp;\n\n## API Responses\n\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\n### Success Messages (HTTP Status Code 200)\n\n```\n{\n    \"message\": \"Success\"\n}\n```\n\n```\n{\n    \"message\":\"Key reset\"\n}\n```\n\n\u0026nbsp;\n\n### Failure Messages (HTTP Status Code 400 or 401)\n\n---\n\n```\n{\n    \"message\": \"Invalid key\"\n}\n```\n\n```\n{\n    \"message\":\"Bad request\"\n}\n```\n\n```\n{\n    \"message\":\"The key is already bound.\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farevi%2Fexpress-mongo-license-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farevi%2Fexpress-mongo-license-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farevi%2Fexpress-mongo-license-api-template/lists"}