From 5da590d46cbff59a8626e02ff7ee99ca91ed2054 Mon Sep 17 00:00:00 2001 From: ViktorStarostenko <71509965+ViktorStarostenko@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:03:40 +0300 Subject: [PATCH 1/4] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 22 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..cf2cb0b3f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,22 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[Bug]:" +labels: '' +assignees: '' + +--- + +**Preconditions** (Any important steps we need to know) + +**Steps to reproduce** (How to reproduce what you found step by step) + +**Actual behavior** (A short description of what you found) + +**Expected behavior** (A short description of what you expected to find) + + +**Screenshots** (Paste or drag-and-drop a screenshot or a link to a recording) + + +**Additional context** (Operating system, version of RedisInsight, Redis database version, Redis module version, database type, connection type, any other information) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..6640f54bf1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Feature Request]:" +labels: '' +assignees: '' + +--- + +**Problem description** (Describe the problem you would like to solve with this feature request or suggested idea). + + + +**How often do you encounter this problem** (Describe how frequent this problem occurs). + + + + + +**Alternatives considered** (Describe any alternative features or products you've considered). + +**Additional information** (Add any other context or details here). From 24bf087f07c4c6138d97a4f355a79b7332d1ef51 Mon Sep 17 00:00:00 2001 From: ViktorStarostenko <71509965+ViktorStarostenko@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:09:22 +0300 Subject: [PATCH 2/4] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 3 +++ .github/ISSUE_TEMPLATE/feature_request.md | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cf2cb0b3f3..98eadde329 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,10 +9,13 @@ assignees: '' **Preconditions** (Any important steps we need to know) + **Steps to reproduce** (How to reproduce what you found step by step) + **Actual behavior** (A short description of what you found) + **Expected behavior** (A short description of what you expected to find) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 6640f54bf1..aafa701581 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature request -about: Suggest an idea for this project +about: Request a feature or submit an idea title: "[Feature Request]:" labels: '' assignees: '' @@ -10,13 +10,10 @@ assignees: '' **Problem description** (Describe the problem you would like to solve with this feature request or suggested idea). - -**How often do you encounter this problem** (Describe how frequent this problem occurs). - - - +**How often do you encounter this problem** (Describe how frequently this problem occurs). **Alternatives considered** (Describe any alternative features or products you've considered). + **Additional information** (Add any other context or details here). From 18648599e4248fba93ae11e8a31e57751913401a Mon Sep 17 00:00:00 2001 From: ViktorStarostenko <71509965+ViktorStarostenko@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:14:35 +0300 Subject: [PATCH 3/4] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 98eadde329..cf8821fbf9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,4 +22,4 @@ assignees: '' **Screenshots** (Paste or drag-and-drop a screenshot or a link to a recording) -**Additional context** (Operating system, version of RedisInsight, Redis database version, Redis module version, database type, connection type, any other information) +**Additional context** (Operating system, version of RedisInsight, Redis database version, Redis module version, database type, connection type, logs, or any other information) From d75dadff99f0ecb72f84c96c9da8a7be82367f3b Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 17 Nov 2021 18:11:57 +0300 Subject: [PATCH 4/4] Create required docs --- CONDUCT | 96 ++++++++++++++++++++++ CONTRIBUTIONING.md | 27 ++++++ LICENSE | 2 +- README.md | 164 +++++++++++++++++++++++++++++-------- redisinsight/api/README.md | 63 -------------- 5 files changed, 254 insertions(+), 98 deletions(-) create mode 100644 CONDUCT create mode 100644 CONTRIBUTIONING.md delete mode 100644 redisinsight/api/README.md diff --git a/CONDUCT b/CONDUCT new file mode 100644 index 0000000000..0cde069924 --- /dev/null +++ b/CONDUCT @@ -0,0 +1,96 @@ +Contributor Covenant Code of Conduct +Our Pledge +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. +Our Standards +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, +and learning from the experience +* Focusing on what is best not just for us as individuals, but for the +overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or +advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others’ private information, such as a physical or email +address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + +Enforcement Responsibilities +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. +Scope +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. +Enforcement +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +this email address: redisinsight@redis.com. +All complaints will be reviewed and investigated promptly and fairly. +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. +Enforcement Guidelines +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: +1. Correction +Community Impact: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. +Consequence: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. +2. Warning +Community Impact: A violation through a single incident or series +of actions. +Consequence: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. +3. Temporary Ban +Community Impact: A serious violation of community standards, including +sustained inappropriate behavior. +Consequence: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. +4. Permanent Ban +Community Impact: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. +Consequence: A permanent ban from any sort of public interaction within +the community. +Attribution +This Code of Conduct is adapted from the Contributor Covenant, +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +Community Impact Guidelines were inspired by Mozilla’s code of conduct +enforcement ladder. +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTIONING.md b/CONTRIBUTIONING.md new file mode 100644 index 0000000000..006309cd29 --- /dev/null +++ b/CONTRIBUTIONING.md @@ -0,0 +1,27 @@ +# Contributing + +Thank you for contributing! Pull requests are always welcome! + +## Git Commits + +Please ensure your commits are small and focused; they should tell a story of your change. This helps reviewers to follow your changes, especially for more complex changes. + + +## Submitting an issue +If you find a bug in the source code, you can help us by +submit an issue to our [GitHub Repository](https://github.com/RedisInsight/RedisInsight) + +Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available. + + +## Github Pull Requests + +Use the following procedure to submit a pull request: + + a. Fork RedisInsight on github ( https://docs.github.com/en/github/getting-started-with-github/fork-a-repo ) + b. Create a topic branch (git checkout -b my_branch) + c. Push to your branch (git push origin my_branch) + d. Initiate a pull request on github ( https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request ) + e. Done :) + +Before creating pull request please make sure that [tests](README.md#tests) are passing diff --git a/LICENSE b/LICENSE index 7ad9b79ae5..ea3921393f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Server Side Public License + Server Side Public License VERSION 1, OCTOBER 16, 2018 Copyright © 2018 MongoDB, Inc. diff --git a/README.md b/README.md index 18e0cd6d9f..e29400c3ee 100644 --- a/README.md +++ b/README.md @@ -6,34 +6,32 @@ Awesome Redis GUI written in Electron, NodeJS and React ## Directory Structure -- `redisinsight/ui` - Contains the frontend code. -- `redisinsight/api` - Contains the backend code. +- `redisinsight/ui` - Contains the frontend code +- `redisinsight/api` - Contains the backend code - `scripts` - Build scripts and other build-related files - `configs` - Webpack configuration files and other build-related files -- `tests` - Contains the e2e and integration tests. +- `tests` - Contains the e2e -## Development Workflow +## Prerequisites -### Installation +Make sure you have installed following packages: +* [Node](https://nodejs.org/en/download/) >=14.x and <16 +* [yarn](https://www.npmjs.com/package/yarn) >=1.21.3 + +## Installation + +Before development or build you have to install required dependencies ```bash $ yarn install $ yarn --cwd redisinsight/api/ ``` -### Packaging the desktop app +## Development -After you have installed all dependencies you can package the app. -Run `yarn package:prod` to package app for the local platform: +There are 2 ways to develop: -```bash -# Production -$ yarn package:prod -``` - -And packaged installer will be in the folder _release_ - -### Running the desktop app +### Developing using electron app After you have installed all dependencies you can now run the app. Run `yarn start` to start an electron application that will watch and build for you. @@ -43,32 +41,51 @@ Run `yarn start` to start an electron application that will watch and build for $ yarn start ``` -### Running frontend part of the app +### Developing using web -After you have installed all dependencies you can now run the app. -Run `yarn start:web` to start a local server that will watch and build for you. +#### Running backend part of the app + +Run `yarn --cwd redisinsight/api/ start:dev` to start a local API at `localhost:5000`. ```bash # Development -$ yarn start:web +$ yarn --cwd redisinsight/api/ start:dev ``` -### Running backend part of the app +While the API is running, open your browser and navigate to http://localhost:5000/api/docs. You should see the Swagger UI. + +#### Running frontend part of the app -After you have installed all dependencies run `yarn --cwd redisinsight/api/ start:dev` to start a local API at `localhost:5000`. +Run `yarn start:web` to start a local server for UI. ```bash # Development -$ yarn --cwd redisinsight/api/ start:dev +$ yarn start:web ``` -While the API is running, open your browser and navigate to http://localhost:5000/api/docs. You should see the Swagger UI. +Web interface will be available at http://localhost:8080 -### Building frontend part of the app +Now servers will watch for changes and automatically build for you -Run `yarn build:web` to build fronted to `/redisinsight/ui/dist/`. +## Build + +### Packaging the desktop app -## Docker +#### Building statics for enablement area and default plugins + +Run `yarn build:statics` or `yarn build:statics:win` for Windows + +After you have installed all dependencies you can package the app. +Run `yarn package:prod` to package app for the local platform: + +```bash +# Production +$ yarn package:prod +``` + +And packaged installer will be in the folder _./release_ + +### Create docker image There are 2 different docker images available @@ -97,7 +114,7 @@ Example: docker run -p 5000:5000 -d --cap-add ipc_lock redisinsight ``` -Then api docs and main ui should be available on http://localhost/api/docs and http://localhost +Then api docs and main ui should be available on http://localhost:5000/api/docs and http://localhost:5000 #### Build Docker with API only @@ -115,16 +132,95 @@ Example: docker run -p 5000:5000 -d --cap-add ipc_lock api.redisinsight ``` -Then api docs and main ui should be available on http://localhost/api/docs +Then api docs and main ui should be available on http://localhost:5000/api/docs + +## Tests -## Continuous Integration +### Running frontend tests -## Related Repositories +#### Run UI unit tests -## Running e2e tests in root tests/e2e +```bash + yarn test +``` + +### Running backend tests + +#### Run backend unit tests + +```bash + # Plain tests + yarn --cwd redisinsight/api test + + # Tests with coverage + yarn --cwd redisinsight/api test:cov +``` + +### Run backend integration tests (using local server) + +```bash + # Plain tests + yarn --cwd redisinsight/api test:api + + # Tests with coverage + yarn --cwd redisinsight/api test:api:cov +``` + +> **_NOTE_**: Using `yarn test:api*` scripts you should have redis server up and running. +By default tests will look on `localhost:6379` without any auth +To customize tests configs you should run test with proper environment variables + +Example: + +If you have redis server running on a different host or port `somehost:7777` with default user pass `somepass` + +You should run test commands with such environment variables + +```bash + # Plain tests + TEST_REDIS_HOST=somehost \ + TEST_REDIS_PORT=7777 \ + TEST_REDIS_PASSWORD-somepass \ + yarn --cwd redisinsight/api test:api +``` + +You can find all possible environment variable available in the [constants.ts](redisinsight/api/test/helpers/constants.ts) file + +### Run backend integration tests (using docker) + +Here you should not care about tests and local redis database configuration + +We will spin up server inside docker container and run tests over it + +```bash + # run this this command + ./redisinsight/api/test/test-runs/start-test-run.sh -r oss-st-6 +``` +- -r - is the Redis Test Environment name + +We are supporting several test environments to run tests on various Redis databases: +- **oss-st-5** - _OSS Standalone v5_ +- **oss-st-5-pass** - _OSS Standalone v5 with admin pass required_ +- **oss-st-6** - _OSS Standalone v6 and all modules_ +- **oss-st-6-tls** - _OSS Standalone v6 with TLS enabled_ +- **oss-st-6-tls-auth** - _OSS Standalone v6 with TLS auth required_ +- **oss-clu** - _OSS Cluster_ +- **oss-clu-tls** - _OSS Cluster with TLS enabled_ +- **oss-sent** - _OSS Sentinel_ +- **re-st** - _Redis Enterprise with Standalone inside_ +- **re-clu** - _Redis Enterprise with Cluster inside_ + + +### Running E2E tests + +Install E2E tests deps + +```bash + yarn --cwd tests/e2e +``` -- To run E2E tests run command: +Run E2E tests ```bash - yarn test-chrome + yarn --cwd tests/e2e test:chrome ``` diff --git a/redisinsight/api/README.md b/redisinsight/api/README.md deleted file mode 100644 index e3e09c1b52..0000000000 --- a/redisinsight/api/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# RedisInsight API - -## Description -RedisInsight provides an intuitive and efficient GUI for Redis, allowing you to interact with your databases and manage your data—with built-in support for most popular Redis modules. It provides tools to analyze the memory, profile the performance of your database usage, and guide you toward better Redis usage. - -## Prerequisites - -Make sure you have installed following packages: -* [Node](https://nodejs.org/en/download/) >= 8.0 -* [npm](https://www.npmjs.com/get-npm) >= 5 - -## Dependencies used -* [NestJS](https://nestjs.com/) - -## Getting started - -### Installation - -```bash -$ yarn install -``` - -### Running the app - -```bash -# development -$ yarn start - -# watch mode -$ yarn start:dev - -# production mode -$ yarn start:prod -``` - -### Formatting - -Formatting required before submitting pull request. - -Prints the filenames of files that are different from Prettier formatting -```bash -$ yarn format -``` -### Swagger OpenApi - -The [OpenAPI](https://swagger.io/specification/) specification is a language-agnostic definition format used -to describe RESTful APIs. - -While the application is running, open your browser and navigate to `http://localhost[:]/api/docs`. -You should see the Swagger UI. - -### Test - -```bash -# unit tests -$ yarn test - -# e2e tests -$ yarn test:e2e - -# test coverage -$ yarn test:cov -```