retool-proxy v1.0.0
Retool-Proxy
A web service that interact with retool database for validating user email and store scraping data from partner chrome extension.
Overview
The retool proxy service serves as the middle layer for partner chrome extension and retool database, it can validate if user exist as partner in retool db, and also send scrapping data into retool db.
Getting Started
Requirements
- Node version v15.4.0 (Specified in .nvmrc)
- npm or yarn
- MongoDB instance (local or remote)
- Botkeeper Auth API
Setup
$ git clone https://gitlab.com/botkeeper/retool-proxy
$ cp .env.sample .env
$ cd retool-proxy
$ npm install
$ npm run watch # For build and run the project
You should now be able to access the API via http://localhost:3000
Find API Docs in Postman under 'Scalebot' Workspace
Dependencies (TODO)
Deployment
- After master branch merged and sandbox finish running, test sandbox retool-proxy by port-forwarding to it in pp2-sandbox namespace, for details on portforward see https://botkeeper.atlassian.net/wiki/spaces/BG/pages/532283421/Development+Environment+Setup+Kubernetes+Argo+Vault+and+MongoDB
- For staging and production the retool-proxy lives under pp2-staging and pp2-production respectively, to deploy to staging/production run the staging/prod pipeline manually to deploy respectively, then port-forward the app and test in the enviornment.
Testing
API Keys
You need to include a valid api key for your local ADMIN_API_KEY
environment variable.
To create a valid API Key:
- Create new service
retool-proxy
locally through admin_ui if one does not exist - For this new service, create roles and permissions if they don't exist
- Be sure the
admin
access role has permissionscan_read_retool_data
andcan_write_retool_data
- Create a new api key with owner
retool-proxy
and api key roleclient
for the Admin service, and api key roleadmin
for the retool-proxy service
Versioning
This was originally set up without api versioning in mind. We're starting at V1. If you add new route, it should first go to the generic /routers
folder. If it needs to be versioned then you would add it to /routers/v1
, etc.
3 years ago