{"id":29020379,"url":"https://github.com/appbaseio/batteries","last_synced_at":"2025-06-26T01:05:30.827Z","repository":{"id":33265152,"uuid":"136585444","full_name":"appbaseio/batteries","owner":"appbaseio","description":"Pluggable modules for mappings, search preview and analytics","archived":false,"fork":false,"pushed_at":"2025-05-26T03:58:07.000Z","size":1838,"stargazers_count":8,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"arc","last_synced_at":"2025-06-19T03:06:40.521Z","etag":null,"topics":["hacktoberfest","hacktoberfest2022"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appbaseio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-06-08T07:47:46.000Z","updated_at":"2025-05-25T11:11:14.000Z","dependencies_parsed_at":"2023-10-12T22:40:15.932Z","dependency_job_id":"9fafbd74-df03-4f23-a73d-82544a16133b","html_url":"https://github.com/appbaseio/batteries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/appbaseio/batteries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fbatteries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fbatteries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fbatteries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fbatteries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appbaseio","download_url":"https://codeload.github.com/appbaseio/batteries/tar.gz/refs/heads/arc","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fbatteries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978910,"owners_count":23239417,"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":["hacktoberfest","hacktoberfest2022"],"created_at":"2025-06-26T01:05:30.096Z","updated_at":"2025-06-26T01:05:30.788Z","avatar_url":"https://github.com/appbaseio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# batteries\n\nPublic pluggable modules for use within appbase.io dashboard, dejavu, and reactive apps.\n\n## Setup\n\n1. Setup the submodule:\n\n```bash\ngit submodule init\ngit submodule sync\ngit submodule update --recursive --remote\n```\n\n2. Installation:\n\n```bash\nyarn add emotion react-emotion antd @appbaseio/reactivesearch react-expand-collapse codesandbox react-element-to-jsx-string appbase-js react-ace brace recharts moment lodash reselect redux-thunk react-joyride\nyarn add -D babel-plugin-emotion babel-plugin-import\n```\n\nAdd `babel-plugin-import`:\n\n```js\n// .babelrc or babel-loader option\n{\n\t\"plugins\": [\n\t\t[\n\t\t\t\"import\",\n\t\t\t{ \"libraryName\": \"antd\", \"libraryDirectory\": \"es\", \"style\": \"css\" }\n\t\t]\n\t]\n}\n```\n\n\u003e You will need to setup css-loader in your webpack config for react-select\n\n3. Setup redux\n\n```js\nimport {\n createStore, combineReducers,\n} from 'redux';\n\n// import your root reducer (optional)\nimport rootReducer from '../reducers';\n\n// import batteries reducers\nimport batteriesReducers from 'batteries/modules/reducers';\n\n// use it for creating the store:\ncreateStore(combineReducers({ ...rootReducer, ...batteriesReducers })),\n```\n\n4. Import:\n\n-   Desired actions from `batteries/modules/actions`\n-   Selectors from `batteries/modules/selectors`\n\nand connect your component to the redux store powered by batteries.\n\n## Usage\n\n### BaseContainer\n\nUse this component to provide the basic data to `batteries` components.\nBy default it executes the following tasks.\n\n-   Sets the app name \u0026 app id in redux store.\n-   Fetches the basic app information\n-   Fetches the app plan\n\n## Props\n\n| Prop               | Required |    Type    | Default Value | Description                                                              |\n| :----------------- | :------: | :--------: | :-----------: | :----------------------------------------------------------------------- |\n| appName            |  `yes`   |  `string`  |       -       | Name of the app.                                                         |\n| appId              |   `no`   |  `string`  |       -       | App id                                                                   |\n| shouldFetchAppPlan |   `no`   | `boolean`  |    `true`     | To define that whether the component should fetch app plan or not        |\n| shouldFetchAppInfo |   `no`   | `boolean`  |    `true`     | To define that whether the component should fetch app information or not |\n| component          |   `no`   | `function` |       -       | Render prop function                                                     |\n\n## Example\n\n```js\nimport Analytics from 'batteries/components/Analytics'\n...\n\u003cBaseContainer appName=\"movies-xyz\"\u003e\n  \u003cAnalytics/\u003e\n\u003c/BaseContainer\u003e\n```\n\n### SearchSandbox\n\nUse this component to display the `SearchPreview` component.\n\n## Props\n\n| Prop              | Required |   Type    | Default Value | Description                                                                                                    |\n| :---------------- | :------: | :-------: | :-----------: | :------------------------------------------------------------------------------------------------------------- |\n| appName           |  `yes`   | `string`  |       -       | Name of the app.                                                                                               |\n| appId             |   `no`   | `string`  |       -       | App id                                                                                                         |\n| isDashboard       |   `no`   | `boolean` |    `false`    | Prefrences handling and profile view                                                                           |\n| useCategorySearch |   `no`   | `boolean` |    `false`    | If true renders `CategorySearch` else `DataSearch`                                                             |\n| showCodeSandbox   |   `no`   | `boolean` |    `true`     | If false hides `Open in CodeSandbox` button                                                                    |\n| customProps       |   `no`   | `object`  |     `{}`      | To pass props directly to Reactive Components like `ReactiveList`, `MultiList`, `CategorySearch`, `DataSearch` |\n| attribution       |   `no`   | `object`  |       -       | Pass `text` and `link` key in object to be displayed at bottom right in codesandbox                            |\n\n## Example\n\n```js\nimport SearchSandbox from 'batteries/components/SearchSandbox';\nimport Editor from 'batteries/components/SearchSandbox/containers/Editor';\n...\n\u003cSearchSandbox\n\tappId={appId}\n\tappName={appName}\n\tcredentials={credentials}\n\tisDashboard\n\tuseCategorySearch={false}\n\tattribution={{\n\t\ttext: 'Powered by Appbase',\n\t\tlink: 'appbase.io'\n\t}}\n\tshowCodeSandbox\n\tcustomProps={{\n\t\tReactiveList: {\n\t\t\tonData: res =\u003e (\n\t\t\t\t\u003cdiv style={{ background: 'aqua' }}\u003e{JSON.stringify(res)}\u003c/div\u003e\n\t\t\t),\n\t\t\tstyle: { background: 'red' },\n\t\t},\n\t\tDataSearch: {\n\t\t\trenderSuggestions: res =\u003e (\n\t\t\t\t\u003cdiv style={{ background: 'yellow' }}\u003e{JSON.stringify(res)}\u003c/div\u003e\n\t\t\t),\n\t\t},\n\t}}\n\u003e\n\t\u003cEditor /\u003e\n\u003c/SearchSandbox\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Fbatteries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappbaseio%2Fbatteries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Fbatteries/lists"}