From 3381eb8457595a54e8f991983c10ae11f04d57b6 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Tue, 9 Jan 2024 20:08:38 -0800 Subject: [PATCH] Add repo dev QoL changes fix VITE_BASE_API to be relative on build to support remote hosting --- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/01_bug.yml | 43 ++ .github/ISSUE_TEMPLATE/02_feature.yml | 22 + .github/ISSUE_TEMPLATE/03_documentation.yml | 13 + .github/ISSUE_TEMPLATE/config.yml | 5 + .github/workflows/build-and-push-image.yaml | 22 +- backend/storage/settings.json | 652 ++++++++++++-------- docker/DOCKER.md | 4 +- docker/docker-compose.yml | 1 - frontend/src/utils/constants.ts | 3 +- pull_request_template.md | 36 ++ 11 files changed, 544 insertions(+), 258 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/01_bug.yml create mode 100644 .github/ISSUE_TEMPLATE/02_feature.yml create mode 100644 .github/ISSUE_TEMPLATE/03_documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 pull_request_template.md diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..411f850f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: Mintplex-Labs \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/01_bug.yml b/.github/ISSUE_TEMPLATE/01_bug.yml new file mode 100644 index 00000000..91f24ff3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug.yml @@ -0,0 +1,43 @@ +name: 🐛 Bug Report +description: File a bug report for VectorAdmin +title: "[BUG]: " +labels: [possible bug] +body: + - type: markdown + attributes: + value: | + Use this template to file a bug report for VectorAdmin. Please be as descriptive as possible to allow everyone to replicate and solve your issue. + + Want help contributing a PR? Use our repo chatbot by OnboardAI! https://app.getonboardai.com/chat/github/mintplex-labs/vector-admin + + - type: dropdown + id: runtime + attributes: + label: How are you running VectorAdmin? + description: VectorAdmin can be run in many environments, pick the one that best represents where you encounter the bug. + options: + - Docker (local) + - Docker (remote machine) + - Local development + - Not listed + default: 0 + validations: + required: true + + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Are there known steps to reproduce? + description: | + Let us know how to reproduce the bug and we may be able to fix it more + quickly. This is not required, but it is helpful. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/02_feature.yml b/.github/ISSUE_TEMPLATE/02_feature.yml new file mode 100644 index 00000000..4958fffe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature.yml @@ -0,0 +1,22 @@ +name: ✨ New Feature suggestion +description: Suggest a new feature for VectorAdmin! +title: "[FEAT]: " +labels: [enhancement, feature request] +body: + - type: markdown + attributes: + value: | + Share a new idea for a feature or improvement. Be sure to search existing + issues first to avoid duplicates. + + Want help contributing a PR? Use our repo chatbot by OnboardAI! https://app.getonboardai.com/chat/github/mintplex-labs/vector-admin + + + - type: textarea + id: description + attributes: + label: What would you like to see? + description: | + Describe the feature and why it would be useful to your use-case as well as others. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/03_documentation.yml b/.github/ISSUE_TEMPLATE/03_documentation.yml new file mode 100644 index 00000000..55800856 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_documentation.yml @@ -0,0 +1,13 @@ +name: 📚 Documentation improvement +title: "[DOCS]: " +description: Report an issue or problem with the documentation. +labels: [documentation] + +body: + - type: textarea + id: description + attributes: + label: Description + description: Describe the issue with the documentation that is giving you trouble or causing confusion. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..d5485e65 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: 🧑‍🤝‍🧑 Community Discord + url: https://discord.gg/6UyHPeGZAC + about: Interact with the Mintplex Labs community here by asking for help, discussing and more! diff --git a/.github/workflows/build-and-push-image.yaml b/.github/workflows/build-and-push-image.yaml index 37a7cebc..48d3d626 100644 --- a/.github/workflows/build-and-push-image.yaml +++ b/.github/workflows/build-and-push-image.yaml @@ -1,8 +1,19 @@ name: Publish Docker image and Github Registry +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ['master'] + paths-ignore: + - '**.md' + - 'cloud-deployments/*' + - 'images/**/*' + - '.vscode/**/*' + - '**/.env.example' + - '.github/ISSUE_TEMPLATE/**/*' jobs: push_to_registries: @@ -14,6 +25,11 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v4 + + - name: Parse repository name to lowercase + shell: bash + run: echo "repo=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT + id: lowercase_repo - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a @@ -41,6 +57,10 @@ jobs: with: context: . file: ./docker/Dockerfile + platforms: linux/amd64 push: true - tags: ${{ steps.meta.outputs.tags }} + tags: | + ${{ steps.meta.outputs.tags }} + ${{ github.ref_name == 'master' && 'mintplexlabs/vectoradmin:latest' || '' }} + ${{ github.ref_name == 'master' && format('ghcr.io/{0}:{1}', steps.lowercase_repo.outputs.repo, 'latest') || '' }} labels: ${{ steps.meta.outputs.labels }} diff --git a/backend/storage/settings.json b/backend/storage/settings.json index 98f127db..afc8999e 100644 --- a/backend/storage/settings.json +++ b/backend/storage/settings.json @@ -1,10 +1,10 @@ { - "organizations": { - "slug": "organizations", + "_prisma_migrations": { + "slug": "_prisma_migrations", "table": { - "name": "organizations", + "name": "_prisma_migrations", "pk": "id", - "verbose": "organizations" + "verbose": "_prisma_migrations" }, "columns": [ { @@ -13,7 +13,7 @@ "control": { "text": true }, - "type": "integer", + "type": "varchar(36)", "allowNull": false, "defaultValue": null, "listview": { @@ -24,12 +24,144 @@ } }, { - "name": "name", - "verbose": "name", + "name": "checksum", + "verbose": "checksum", + "control": { + "text": true + }, + "type": "varchar(64)", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "finished_at", + "verbose": "finished_at", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": true, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "migration_name", + "verbose": "migration_name", + "control": { + "text": true + }, + "type": "varchar(255)", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "logs", + "verbose": "logs", "control": { "text": true }, "type": "text", + "allowNull": true, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "rolled_back_at", + "verbose": "rolled_back_at", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": true, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "started_at", + "verbose": "started_at", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": false, + "defaultValue": "now()", + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "applied_steps_count", + "verbose": "applied_steps_count", + "control": { + "text": true + }, + "type": "integer", + "allowNull": false, + "defaultValue": "0", + "listview": { + "show": true + }, + "editview": { + "show": true + } + } + ], + "mainview": { + "show": true + }, + "listview": { + "order": {}, + "page": 25 + }, + "editview": { + "readonly": false + } + }, + "system_settings": { + "slug": "system_settings", + "table": { + "name": "system_settings", + "pk": "id", + "verbose": "system_settings" + }, + "columns": [ + { + "name": "id", + "verbose": "id", + "control": { + "text": true + }, + "type": "integer", "allowNull": false, "defaultValue": null, "listview": { @@ -40,8 +172,8 @@ } }, { - "name": "slug", - "verbose": "slug", + "name": "label", + "verbose": "label", "control": { "text": true }, @@ -56,8 +188,8 @@ } }, { - "name": "uuid", - "verbose": "uuid", + "name": "value", + "verbose": "value", "control": { "text": true }, @@ -115,12 +247,12 @@ "readonly": false } }, - "organization_api_keys": { - "slug": "organization_api_keys", + "users": { + "slug": "users", "table": { - "name": "organization_api_keys", + "name": "users", "pk": "id", - "verbose": "organization_api_keys" + "verbose": "users" }, "columns": [ { @@ -140,8 +272,8 @@ } }, { - "name": "apiKey", - "verbose": "apiKey", + "name": "email", + "verbose": "email", "control": { "text": true }, @@ -155,6 +287,38 @@ "show": true } }, + { + "name": "password", + "verbose": "password", + "control": { + "text": true + }, + "type": "text", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "role", + "verbose": "role", + "control": { + "text": true + }, + "type": "text", + "allowNull": false, + "defaultValue": "'default'::text", + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, { "name": "createdAt", "verbose": "createdAt", @@ -171,6 +335,74 @@ "show": true } }, + { + "name": "lastUpdatedAt", + "verbose": "lastUpdatedAt", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": false, + "defaultValue": "CURRENT_TIMESTAMP", + "listview": { + "show": true + }, + "editview": { + "show": true + } + } + ], + "mainview": { + "show": true + }, + "listview": { + "order": {}, + "page": 25 + }, + "editview": { + "readonly": false + } + }, + "organization_users": { + "slug": "organization_users", + "table": { + "name": "organization_users", + "pk": "id", + "verbose": "organization_users" + }, + "columns": [ + { + "name": "id", + "verbose": "id", + "control": { + "text": true + }, + "type": "integer", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "user_id", + "verbose": "user_id", + "control": { + "text": true + }, + "type": "integer", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, { "name": "organization_id", "verbose": "organization_id", @@ -187,6 +419,22 @@ "show": true } }, + { + "name": "createdAt", + "verbose": "createdAt", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": false, + "defaultValue": "CURRENT_TIMESTAMP", + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, { "name": "lastUpdatedAt", "verbose": "lastUpdatedAt", @@ -215,12 +463,12 @@ "readonly": false } }, - "organization_connections": { - "slug": "organization_connections", + "organizations": { + "slug": "organizations", "table": { - "name": "organization_connections", + "name": "organizations", "pk": "id", - "verbose": "organization_connections" + "verbose": "organizations" }, "columns": [ { @@ -240,8 +488,8 @@ } }, { - "name": "type", - "verbose": "type", + "name": "name", + "verbose": "name", "control": { "text": true }, @@ -256,8 +504,8 @@ } }, { - "name": "settings", - "verbose": "settings", + "name": "slug", + "verbose": "slug", "control": { "text": true }, @@ -272,12 +520,12 @@ } }, { - "name": "organization_id", - "verbose": "organization_id", + "name": "uuid", + "verbose": "uuid", "control": { "text": true }, - "type": "integer", + "type": "text", "allowNull": false, "defaultValue": null, "listview": { @@ -331,12 +579,12 @@ "readonly": false } }, - "organization_workspaces": { - "slug": "organization_workspaces", + "organization_api_keys": { + "slug": "organization_api_keys", "table": { - "name": "organization_workspaces", + "name": "organization_api_keys", "pk": "id", - "verbose": "organization_workspaces" + "verbose": "organization_api_keys" }, "columns": [ { @@ -356,8 +604,8 @@ } }, { - "name": "name", - "verbose": "name", + "name": "apiKey", + "verbose": "apiKey", "control": { "text": true }, @@ -372,12 +620,28 @@ } }, { - "name": "slug", - "verbose": "slug", + "name": "createdAt", + "verbose": "createdAt", "control": { "text": true }, - "type": "text", + "type": "timestamp", + "allowNull": false, + "defaultValue": "CURRENT_TIMESTAMP", + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "organization_id", + "verbose": "organization_id", + "control": { + "text": true + }, + "type": "integer", "allowNull": false, "defaultValue": null, "listview": { @@ -388,8 +652,60 @@ } }, { - "name": "uuid", - "verbose": "uuid", + "name": "lastUpdatedAt", + "verbose": "lastUpdatedAt", + "control": { + "text": true + }, + "type": "timestamp", + "allowNull": false, + "defaultValue": "CURRENT_TIMESTAMP", + "listview": { + "show": true + }, + "editview": { + "show": true + } + } + ], + "mainview": { + "show": true + }, + "listview": { + "order": {}, + "page": 25 + }, + "editview": { + "readonly": false + } + }, + "organization_connections": { + "slug": "organization_connections", + "table": { + "name": "organization_connections", + "pk": "id", + "verbose": "organization_connections" + }, + "columns": [ + { + "name": "id", + "verbose": "id", + "control": { + "text": true + }, + "type": "integer", + "allowNull": false, + "defaultValue": null, + "listview": { + "show": true + }, + "editview": { + "show": true + } + }, + { + "name": "type", + "verbose": "type", "control": { "text": true }, @@ -404,8 +720,8 @@ } }, { - "name": "fname", - "verbose": "fname", + "name": "settings", + "verbose": "settings", "control": { "text": true }, @@ -759,12 +1075,12 @@ "readonly": false } }, - "users": { - "slug": "users", + "jobs": { + "slug": "jobs", "table": { - "name": "users", + "name": "jobs", "pk": "id", - "verbose": "users" + "verbose": "jobs" }, "columns": [ { @@ -784,8 +1100,8 @@ } }, { - "name": "email", - "verbose": "email", + "name": "taskName", + "verbose": "taskName", "control": { "text": true }, @@ -800,14 +1116,14 @@ } }, { - "name": "password", - "verbose": "password", + "name": "status", + "verbose": "status", "control": { "text": true }, "type": "text", "allowNull": false, - "defaultValue": null, + "defaultValue": "'pending'::text", "listview": { "show": true }, @@ -816,30 +1132,14 @@ } }, { - "name": "role", - "verbose": "role", + "name": "data", + "verbose": "data", "control": { "text": true }, "type": "text", "allowNull": false, - "defaultValue": "'default'::text", - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "createdAt", - "verbose": "createdAt", - "control": { - "text": true - }, - "type": "timestamp", - "allowNull": false, - "defaultValue": "CURRENT_TIMESTAMP", + "defaultValue": null, "listview": { "show": true }, @@ -848,48 +1148,12 @@ } }, { - "name": "lastUpdatedAt", - "verbose": "lastUpdatedAt", - "control": { - "text": true - }, - "type": "timestamp", - "allowNull": false, - "defaultValue": "CURRENT_TIMESTAMP", - "listview": { - "show": true - }, - "editview": { - "show": true - } - } - ], - "mainview": { - "show": true - }, - "listview": { - "order": {}, - "page": 25 - }, - "editview": { - "readonly": false - } - }, - "system_settings": { - "slug": "system_settings", - "table": { - "name": "system_settings", - "pk": "id", - "verbose": "system_settings" - }, - "columns": [ - { - "name": "id", - "verbose": "id", + "name": "result", + "verbose": "result", "control": { "text": true }, - "type": "integer", + "type": "text", "allowNull": false, "defaultValue": null, "listview": { @@ -900,12 +1164,12 @@ } }, { - "name": "label", - "verbose": "label", + "name": "run_by_user_id", + "verbose": "run_by_user_id", "control": { "text": true }, - "type": "text", + "type": "integer", "allowNull": false, "defaultValue": null, "listview": { @@ -916,12 +1180,12 @@ } }, { - "name": "value", - "verbose": "value", + "name": "organization_id", + "verbose": "organization_id", "control": { "text": true }, - "type": "text", + "type": "integer", "allowNull": false, "defaultValue": null, "listview": { @@ -975,12 +1239,12 @@ "readonly": false } }, - "jobs": { - "slug": "jobs", + "organization_workspaces": { + "slug": "organization_workspaces", "table": { - "name": "jobs", + "name": "organization_workspaces", "pk": "id", - "verbose": "jobs" + "verbose": "organization_workspaces" }, "columns": [ { @@ -1000,8 +1264,8 @@ } }, { - "name": "taskName", - "verbose": "taskName", + "name": "name", + "verbose": "name", "control": { "text": true }, @@ -1016,24 +1280,8 @@ } }, { - "name": "status", - "verbose": "status", - "control": { - "text": true - }, - "type": "text", - "allowNull": false, - "defaultValue": "'pending'::text", - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "data", - "verbose": "data", + "name": "slug", + "verbose": "slug", "control": { "text": true }, @@ -1048,8 +1296,8 @@ } }, { - "name": "result", - "verbose": "result", + "name": "uuid", + "verbose": "uuid", "control": { "text": true }, @@ -1064,8 +1312,8 @@ } }, { - "name": "run_by_user_id", - "verbose": "run_by_user_id", + "name": "organization_id", + "verbose": "organization_id", "control": { "text": true }, @@ -1080,14 +1328,14 @@ } }, { - "name": "organization_id", - "verbose": "organization_id", + "name": "createdAt", + "verbose": "createdAt", "control": { "text": true }, - "type": "integer", + "type": "timestamp", "allowNull": false, - "defaultValue": null, + "defaultValue": "CURRENT_TIMESTAMP", "listview": { "show": true }, @@ -1096,8 +1344,8 @@ } }, { - "name": "createdAt", - "verbose": "createdAt", + "name": "lastUpdatedAt", + "verbose": "lastUpdatedAt", "control": { "text": true }, @@ -1112,14 +1360,14 @@ } }, { - "name": "lastUpdatedAt", - "verbose": "lastUpdatedAt", + "name": "fname", + "verbose": "fname", "control": { "text": true }, - "type": "timestamp", + "type": "text", "allowNull": false, - "defaultValue": "CURRENT_TIMESTAMP", + "defaultValue": null, "listview": { "show": true }, @@ -1303,106 +1551,6 @@ "readonly": false } }, - "organization_users": { - "slug": "organization_users", - "table": { - "name": "organization_users", - "pk": "id", - "verbose": "organization_users" - }, - "columns": [ - { - "name": "id", - "verbose": "id", - "control": { - "text": true - }, - "type": "integer", - "allowNull": false, - "defaultValue": null, - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "user_id", - "verbose": "user_id", - "control": { - "text": true - }, - "type": "integer", - "allowNull": false, - "defaultValue": null, - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "organization_id", - "verbose": "organization_id", - "control": { - "text": true - }, - "type": "integer", - "allowNull": false, - "defaultValue": null, - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "createdAt", - "verbose": "createdAt", - "control": { - "text": true - }, - "type": "timestamp", - "allowNull": false, - "defaultValue": "CURRENT_TIMESTAMP", - "listview": { - "show": true - }, - "editview": { - "show": true - } - }, - { - "name": "lastUpdatedAt", - "verbose": "lastUpdatedAt", - "control": { - "text": true - }, - "type": "timestamp", - "allowNull": false, - "defaultValue": "CURRENT_TIMESTAMP", - "listview": { - "show": true - }, - "editview": { - "show": true - } - } - ], - "mainview": { - "show": true - }, - "listview": { - "order": {}, - "page": 25 - }, - "editview": { - "readonly": false - } - }, "organization_rag_tests": { "slug": "organization_rag_tests", "table": { diff --git a/docker/DOCKER.md b/docker/DOCKER.md index 69b18738..025e70fb 100644 --- a/docker/DOCKER.md +++ b/docker/DOCKER.md @@ -14,7 +14,7 @@ Run this command first to get a dockerized Postgres container running: `docker-compose up -d --build postgres` ## Run from Docker pre-built image -- `docker pull mintplexlabs/vectoradmin:master` to pull in latest image +- `docker pull mintplexlabs/vectoradmin` to pull in latest image - Run the command with env variables and image defined. `docker run -d -p 3001:3001 \ -e SERVER_PORT="3001" \ @@ -25,7 +25,7 @@ Run this command first to get a dockerized Postgres container running: -e INNGEST_SIGNING_KEY="random-string-goes-here" \ -e INNGEST_LANDING_PAGE="true" \ -e DATABASE_CONNECTION_STRING="postgresql://vectoradmin:password@xxxxxxx:5432/vdbms" \ -mintplexlabs/vectoradmin:master` +mintplexlabs/vectoradmin` ## Build docker image from source diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a8256765..f5af002f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -22,7 +22,6 @@ services: vector-admin: container_name: vector-admin image: vector-admin:latest - platform: linux/amd64 build: context: ../. dockerfile: ./docker/Dockerfile diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.ts index 39dd0f50..e603ac54 100644 --- a/frontend/src/utils/constants.ts +++ b/frontend/src/utils/constants.ts @@ -1,5 +1,4 @@ -export const API_BASE = - import.meta.env.VITE_API_BASE || 'http://127.0.0.1:3001/api'; +export const API_BASE = import.meta.env.VITE_API_BASE || "/api"; export const APP_NAME = import.meta.env.VITE_APP_NAME || 'VDMS'; export const STORE_USER = 'vdms_user'; export const STORE_TOKEN = 'vdms_authToken'; diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 00000000..1167880b --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,36 @@ + + ### Pull Request Type + + + +- [ ] ✨ feat +- [ ] 🐛 fix +- [ ] ♻️ refactor +- [ ] 💄 style +- [ ] 🔨 chore +- [ ] 📝 docs + +### Relevant Issues + + + +resolves #xxx + + +### What is in this change? + +Describe the changes in this PR that are impactful to the repo. + + +### Additional Information + +Add any other context about the Pull Request here that was not captured above. + +### Developer Validations + + + +- [ ] I ran `yarn lint` from the root of the repo & committed changes +- [ ] Relevant documentation has been updated +- [ ] I have tested my code functionality +- [ ] Docker build succeeds locally