{"id":19333210,"url":"https://github.com/pgrimaud/lametric-app-starter","last_synced_at":"2025-10-29T16:40:33.127Z","repository":{"id":37585556,"uuid":"230428673","full_name":"pgrimaud/lametric-app-starter","owner":"pgrimaud","description":"Starter for creating LaMetric apps easily","archived":false,"fork":false,"pushed_at":"2023-04-19T21:19:30.000Z","size":156,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-24T09:16:32.957Z","etag":null,"topics":["lametric","lametric-app","php","template","template-project"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/pgrimaud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"pgrimaud","custom":["https://www.paypal.me/grimaudpierre","https://www.paypal.me/nisouc"]}},"created_at":"2019-12-27T11:02:57.000Z","updated_at":"2025-04-29T13:34:23.000Z","dependencies_parsed_at":"2024-11-10T02:50:49.370Z","dependency_job_id":"f994489d-e01e-41b1-ac63-92d58d96c212","html_url":"https://github.com/pgrimaud/lametric-app-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/pgrimaud/lametric-app-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Flametric-app-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Flametric-app-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Flametric-app-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Flametric-app-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgrimaud","download_url":"https://codeload.github.com/pgrimaud/lametric-app-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Flametric-app-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273105959,"owners_count":25046950,"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-09-01T02:00:09.058Z","response_time":120,"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":["lametric","lametric-app","php","template","template-project"],"created_at":"2024-11-10T02:50:36.554Z","updated_at":"2025-10-29T16:40:28.095Z","avatar_url":"https://github.com/pgrimaud.png","language":"PHP","funding_links":["https://github.com/sponsors/pgrimaud","https://www.paypal.me/grimaudpierre","https://www.paypal.me/nisouc"],"categories":[],"sub_categories":[],"readme":"# LaMetric App Starter\n\nThis starter allow you to create LaMetric apps easily. (Indicator App)\n\n## How to use it?\n\nFork this project or create a new repository using [this link](https://github.com/pgrimaud/lametric-app-starter/generate).\n\n## How it works?\n\n### Step 1\n\nDeclare fields you want to retrieve from your LaMetric App you designed, in file `config/fields.php`.\n\ne.g.\n\n```php\nreturn [\n    [\n        'key'  =\u003e 'field-1',\n        'type' =\u003e Field::TEXT_TYPE,\n    ],\n    [\n        'key'  =\u003e 'field-2',\n        'type' =\u003e Field::NUMBER_TYPE,\n    ],\n    [\n        'key'  =\u003e 'field-3',\n        'type' =\u003e Field::SWITCH_TYPE,\n    ],\n    [\n        'key'     =\u003e 'field-4',\n        'type'    =\u003e Field::CHOICES_TYPE,\n        'choices' =\u003e [\n            'iron-man',\n            'captain-america',\n            'ant-man',\n            'thor',\n        ]\n    ]\n];\n```\n\nFields type association with https://developer.lametric.com :\n\n - **Field::TEXT_TYPE** : Text field\n - **Field::NUMBER_TYPE** : Number\n - **Field::SWITCH_TYPE** : Switch\n - **Field::CHOICES_TYPE** : Single choice\n\nThe `src/Validator.php` object will check parameters sent by the app and manage errors.\n\nYou can also add `default` key to a field. If the value is missing from app request, this valus will be use.\n\ne.g.\n\n```php\nreturn [\n    [\n        'key'     =\u003e 'field-1',\n        'type'    =\u003e Field::TEXT_TYPE,\n        'default' =\u003e 'hello'\n    ],\n];\n```\n\n### Step 2\n\nAdd you logic to the method `fetchData()` in `src/Api.php`.\nMaybe you need to extract data from an API. You can inject any dependencies as needed.\n\nYou can also inject credentials like secret api-key : copy `config/credentials.php.dist` to `config/credentials.php` and edit content.\n\n```php\n/**\n * object $this-\u003eclient (Guzzle HTTP) is available to make curl requests\n * array $this-\u003ecredentials contains sensitive data\n * array $parameters (credentials) can contain sensitive data\n */\n```\n\n### Step 3\n\nAdapt the method `mapData()` in `src/Api.php` to manage frames and data you need.\n\nMore information about frames [here](https://lametric-documentation.readthedocs.io/en/latest/guides/first-steps/first-lametric-indicator-app.html#id1).\n\n### Step 4 \u0026 Hosting\n\nYou can deploy it everywhere you want. You only need PHP and `ext-json` (`ext-curl` if you consume an API).\n\nYou only need to configure the docroot of your vhost to the folder **public**.\n\n## Feedback\n\nIf you need help, [create an issue](https://github.com/pgrimaud/lametric-app-starter/issues) or contact me on [Twitter](http://twitter.com/pgrimaud_).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrimaud%2Flametric-app-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgrimaud%2Flametric-app-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrimaud%2Flametric-app-starter/lists"}