diff --git a/.eslintrc.js b/.eslintrc.js index 0b3aa22..d851acf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,7 @@ module.exports = { browser: true, 'jest/globals': true, }, + ignorePatterns: ['node_modules/**'], settings: { react: { version: 'detect', diff --git a/.gitignore b/.gitignore index cda40ce..b2be3d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ /node_modules /.pnp .pnp.js - +.vscode # testing /coverage diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0b4fbaf..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,19 +0,0 @@ -/* -👋 Hi! This file was autogenerated by tslint-to-eslint-config. -https://github.com/typescript-eslint/tslint-to-eslint-config - -It represents the closest reasonable ESLint configuration to this -project's original TSLint configuration. - -We recommend eventually switching this configuration to extend from -the recommended rulesets in typescript-eslint. -https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md - -Happy linting! 💖 -*/ -{ - "cSpell.words": [ - "botcommander", - "esnext" - ] -} diff --git a/README.md b/README.md index 660302a..34d17b4 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,153 @@ - + +# Bot Commander -**Formulated Autoamation RPA Resources** +[](https://app.circleci.com/pipelines/github/FormulatedAutomation/Profiler) + -- [/r/OpenSourceRPA](https://reddit.com/r/OpenSourceRPA) -- [OpenSource RPA LinkedIn - Group](https://www.linkedin.com/groups/12366622/) -- [FormulatedAutomation's YouTube - Screencasts](https://www.youtube.com/channel/UC_IMgIFlNBG94Vm8tNCNeUQ) -- [Formulated Automation Podcast](https://www.formulatedautomation.com/category/podcast/) +### A human-friendly interface for running bots. +Bot Commander talks to vendor APIs directly to provide an environment for business-stakeholders to work with automations. -# FormulatedAutomation-Profiler +Bot Commander is a [nextjs](https://nextjs.org/) web application that speaks directly to RPA vendor APIs for you. It offers an extensible starting point if you need to trigger bots running and report on their status. -[](https://app.circleci.com/pipelines/github/FormulatedAutomation/Profiler) -[](https://badge.fury.io/py/fa-profiler) + + + - +Currently, UiPath and Robocorp bots are supported but more platforms can be implemented via a system of pluggable backends. Contribution guidelines are forthcoming but pull requests are welcome. -### Introduction +This is experimental software and will be undergoing rapid change -This project allows organizations to quickly create interfaces for -their bots for end users. +# Get Started -⚠️ This project is currently a work in process and should not be used in -production environments. ⚠️ +Before getting started, you will need API Access to your bot provider. This guide assumes that you have access to your vendor and have bots that you would like to run. -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +### Download the Project -## Getting Started +```bash +git clone git@github.com:FormulatedAutomation/BotCommander.git +npm install +``` -### Installation +## Configuration -//TODO: Installation steps +### Connecting UiPath -### Configuration +To connect your UiPath bot, you need both the account API credentials as well as the bots basic information. -//TODO: Configuration steps +API credentials will be listed in under 'sources' in `config/api.js`, while the bot will be under `bots` -### Running the server +An example of a UiPath source config would be: -//TODO: How to run the server +```jsx +{ + uipath: { + platformHostname: 'platform.uipath.com', + path: 'organization/myServiceInstanceLogicalName', + refreshToken: process.env.UIPATH_REFRESH_TOKEN, + serviceInstanceLogicalName: 'myServiceInstanceLogicalName', + clientId: 'abc123456', + }, +``` + +Once you've defined a source, you can then define the bots which will use those source credentials to interact with the API. + +The definiation of a UiPath bot looks like this: + +```js + { + id: 'Turkish.Lira.to.USD', + name: 'Turkish Lira Conversion Bot', + description: 'Converts Turkish Lira to USD', + source: 'uipath', + type: 'uipath', + acl: { + groups: ['admins', 'users'], + }, + }, +``` + +For more details about where to find these keys, [click here](uipath_credentials_how_to.md). + +### Connecting Robocloud + +To connect your Robocloud bot, you need three pieces of information about your bot: + +- Workspace ID +- Process ID +- Process Secret + +This information can be found in the Robocloud + +- [Activate the Process API](https://robocorp.com/docs/product-manuals/robocorp-cloud/robocorp-cloud-process-api) in Robocloud +- Add your Process Secret and bot values to `config/api.js` within the `bots` list. + +Here is an example entry: + +```jsx +{ + id: 'Robocloud.Demo', + name: 'My Robot', + description: 'My Special Robot That Helps Me Out', + secret: '****PROCESS-SECRET****', + workspaceId: '****WORKSPACE-ID****', + processId: '****PROCESS-ID****', + type: 'robocloud', + acl: { + groups: ['admins', 'users'], + }, + } +``` -First, run the development server: +## Access Control List + +TBD high-level explanation of how ACL works. + +## Authorization + +Bot Commander uses [next-auth](https://next-auth.js.org/) and have included an [Auth0](https://auth0.com/) provider. An example of the auth config file found at `config/auth.js` + +```jsx +// config/auth.js + +export default [ + Providers.Auth0({ + domain: '****AUTH0-DOMAIN****', + clientId: '****CLIENT-ID****', + clientSecret: '****CLIENT-SECRET****', + }), + // ...add more providers here +] +``` + +## Environment Variables + +Create a file named `.env` in the root directory of the project with environment variables you would like the application to use. You should also be able to use actual environment variables as well. + +TBD - Required Variables to Add + +## Running + +Since the app is a nextjs application you can find plentiful [resources](https://nextjs.org/docs) on how to get setup. To test out your instance just run the following to launch the dev server. ```bash -SECRET=123456 npm run dev -# or -SECRET=123456 yarn dev +# be sure to `npm install` before this +npm run dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. \ No newline at end of file +## Docker Guide + +Bot Commander works well with Docker as a self-contained nodejs application. + + +**Formulated Automation RPA Resources** + + +- [/r/OpenSourceRPA](https://reddit.com/r/OpenSourceRPA) +- [OpenSource RPA LinkedIn + Group](https://www.linkedin.com/groups/12366622/) +- [FormulatedAutomation's YouTube + Screencasts](https://www.youtube.com/channel/UC_IMgIFlNBG94Vm8tNCNeUQ) +- [Formulated Automation Podcast](https://www.formulatedautomation.com/category/podcast/) diff --git a/components/BotRunForm.js b/components/BotRunForm.js index 22337e9..cd5faae 100644 --- a/components/BotRunForm.js +++ b/components/BotRunForm.js @@ -12,7 +12,7 @@ const BotRunForm = ({ botInfo, setInputArgs, handleSubmit, loading }) => {