{"id":24998038,"url":"https://github.com/riennevaplus/prompt-app","last_synced_at":"2025-07-09T07:34:59.393Z","repository":{"id":57331701,"uuid":"258663410","full_name":"RienNeVaPlus/prompt-app","owner":"RienNeVaPlus","description":"👩‍💻 Provides an interface for node apps. Comes with built-in services for managing jobs and encrypting environment data.","archived":false,"fork":false,"pushed_at":"2023-07-12T05:23:32.000Z","size":248,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T15:06:24.415Z","etag":null,"topics":[],"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/RienNeVaPlus.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}},"created_at":"2020-04-25T01:39:36.000Z","updated_at":"2021-12-04T20:30:50.000Z","dependencies_parsed_at":"2025-02-05T04:15:11.711Z","dependency_job_id":null,"html_url":"https://github.com/RienNeVaPlus/prompt-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RienNeVaPlus%2Fprompt-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RienNeVaPlus%2Fprompt-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RienNeVaPlus%2Fprompt-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RienNeVaPlus%2Fprompt-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RienNeVaPlus","download_url":"https://codeload.github.com/RienNeVaPlus/prompt-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246215821,"owners_count":20741894,"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":[],"created_at":"2025-02-04T17:38:26.334Z","updated_at":"2025-03-29T16:42:22.505Z","avatar_url":"https://github.com/RienNeVaPlus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👩‍💻 prompt-app\n\nProvides an interface for node apps. Comes with built-in services for managing jobs (\"cronjobs\") and encrypting sensitive environment data.\n\nIt's basically [prompts](https://github.com/terkelg/prompts) thrown at your service classes.\n\n![prompt-app-example](./example.gif \"prompt-app-example\")\n\n*Note: This is the result of a hackaton.*\n\n## Install\n\n```\nnpm install prompt-app // or\nyarn add prompt-app\n```\n\n## Structure\n\nSee [example](./example) for details and run `yarn example`.\n\n#### index.ts\n\n```ts\nimport App from 'prompt-app'\nimport * as services from './services'\n\nApp({services});\n```\n\n#### services/*\n\n```ts\nexport class Server {\n\tstatic description = 'Node.js Web Server';\n\tstatic color = 'red';\n\n\t/**\n\t * Jobs are executed every job.interval and only if job.executable return true\n\t * Rather than providing them as an object, they can be arrays as well:\n\t * [Server.$flushCache, 30, (...) =\u003e ..., 'Description'] is equal to:\n\t */\n\tstatic jobs: promptApp.Job[] = [{\n\t\t$: Server.$flushCache,\n\t\tinterval: 30,\n\t\texecutable: ({between}) =\u003e between(8, 22, true),\n\t\tdescription: 'Weekdays from 8 to 22'\n\t}];\n\n\t/**\n\t * Receives the decrypted credentials (.env)\n\t */\n\tstatic onCredentials(_credentials: any){\n\t\t// new Server(credentials);\n\t}\n\n\t/**\n\t * Exposed Method\n\t *\n\t * By default, all methods starting with an upper-case character or with a dollar sign are exposed\n\t * Use config.exposeMethod: (name) =\u003e boolean to change this\n\t * The method name is mapped using config.mapMethodName ($flushCache =\u003e Flush Cache)\n\t */\n\tstatic $flushCache({debug}: any){\n\t\tdebug('Flushing Caches (not rly)...');\n\t\treturn true;\n\t}\n}\n```\n\n#### .env\n\nA challenge can be created on first run.\n\n```ts\nAPP_CHALLENGE=4f766d25fd5f7cdf1a8e98bc7907865cf6c76274d8a215549e121c26c48013713ab1102640e11d810a4d87c98b00c8772fc92edc1f0e507ca152834a0e1a01d790af2970c5855fb7c4bca766bfc7e1aad57995ae297bbab072979d073e496998c28e047ea71e6ea843d9\nAPP_PASSWORD=secret\nAPP_SERVER_CREDENTIALS=a514e5f926c4ddb1a412429f3ebc2adc1627d0db71eeca68df9ea2af6343aab89ec6e77d4c71f05f3b11ba97b50c873f36cd5778601c16d6c64e5b77176ba628095d86cdeec3fc35db91484274a237949c1a4635fd450db386272e1fd0b00940945ec06f6d461cf294bbb15f356e3cffcd152cd21e46f5a2bb4b72a59d6a08fa2f7c652a0d355853deedd2efd564\n```\n\nManage encrypted service credentials by using the built in \"Encrypt\"-Tool. Provide the encrypted strings in `APP_SERVICE-NAME_CREDENTIALS` to have them decrypted and handed over to `service.onCredentials(credentials)`.\n\n\u003e Warning: never provide `APP_PASSWORD` in any production environment.\n\n### Thanks to\n- [prompts](https://github.com/terkelg/prompts)\n- every other dependency","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friennevaplus%2Fprompt-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friennevaplus%2Fprompt-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friennevaplus%2Fprompt-app/lists"}