Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Update local-setup-ui.md #6

Merged
merged 14 commits into from
Oct 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 34 additions & 21 deletions docusaurus-docs/community/contribute/local-setup-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,59 @@ To get started with conda-store-ui development, there are a couple of options. T

## Pre-requisites
Copy link
Owner

@pavithraes pavithraes Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's Ok with you, I might update this section in my pull request to point to the page that outlines the git cloning & branching workflow: https://github.com/pavithraes/conda-store/blob/contrib-docs/docusaurus-docs/community/contribute/contribute-code.md#setup-for-local-development

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That almost makes sense to me, but I'm not sure where/how Docker fits into this suggestion. Should we move the Docker installation instructions out of the core, ui, and juptyerlab-extension docs and into the contribute-code doc?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep Docker here, and only remove the git & GitHub specific instructions in favour of the above doc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍


We use [Docker Compose](https://docs.docker.com/compose/) to set up the infrastructure before starting ensure that you have Docker compose installed. If you need to install docker-compose, please see their [installation documentation](https://docs.docker.com/compose/install/)
No matter which option you choose, you must first complete the following steps.

1. Fork and clone the [conda-store-ui](https://github.com/conda-incubator/conda-store-ui.git) repository.
2. Copy `.env.example` to `.env`. All default settings should work, but if you want to test against a different version of conda-store-server, you can specify it in the `.env` file by setting the `CONDA_STORE_SERVER_VERSION` variable to the desired version
1. [Install Docker Compose](https://docs.docker.com/compose/install/). We use [Docker Compose](https://docs.docker.com/compose/) to set up the infrastructure. So before starting, ensure that you have Docker Compose installed.
2. [Fork the conda-store-ui repository](https://github.com/conda-incubator/conda-store-ui/fork), then `git clone` it to your computer.
3. Copy `.env.example` to `.env`. All default settings should work, but if you want to test against a different version of conda-store-server, you can specify it in the `.env` file by setting the `CONDA_STORE_SERVER_VERSION` variable to the desired version.

## Docker (Recommended)

Once you have a [local copy of the `conda-store` repository](community/contribute/contribute-code#setup-for-local-development)
## Basic local development (recommended)

Running conda-store-ui in Docker is the simplest way to set up your local development environment.

1. Run `yarn run start:docker` to start the entire development stack.
Open your local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then log in using the default username of `username` and default password of `password`.
### Install the right version of Yarn

Yarn is a package manager for JavaScript dependencies. It requires that you [download and install Node.js](https://nodejs.org/en/download/package-manager). Once you have Node.js installed, you can follow the instructions to [install Yarn](https://yarnpkg.com/getting-started/install).

1. Change to the project root: `cd conda-store-ui`
2. Find out what version of Yarn is required: `cat package.json | grep packageManager`
3. Compare to the version of Yarn that you installed: `yarn --version`

### Run the UI web app in Docker container

1. Run `yarn install`. This will download or update the needed JavaScript dependencies into a directory named `node_modules/`. This directory will be exposed in the next step to the `conda-store-ui` Docker container for use at runtime by the Conda Store UI app.
2. Run `yarn run start:docker` to start the entire development stack. This step may take a few minutes the first time you run it.
3. Open your local browser and go to [http://localhost:8000](http://localhost:8000) to see conda-store-ui.
4. You can then log in using the default username of `username` and default password of `password`.

**Note:** Hot reloading is enabled, so when you make changes to source files, your browser will reload and reflect the changes.

## Without Docker
## Advanced local development

For many Conda Store UI development tasks, the basic setup should work. But if you need to work extensively in the UI codebase, then you will probably want to run the conde-store-ui app locally rather than within a Docker container.

This setup still uses Docker for supporting services but runs conda-store-ui locally.
Note: this setup still uses Docker for supporting services (such as the database, server, worker, and cloud storage), but runs conda-store-ui locally.

### Set up your environment
### Set up your Conda environment

This project uses [Conda](https://conda.io) for package management. To set up Conda, please see their [installation documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html).
1. Change to the project root ` cd conda-store-ui`
2. From the project root create the conda environment `conda env create -f environment_dev.yml`
3. Activate the development environment `conda activate cs-ui-dev-env`
4. Install yarn dependencies `yarn install`

### Run the application
1. Change to the project root: `cd conda-store-ui`
2. From the project root, create the conda environment: `conda env create -f environment_dev.yml`
gabalafou marked this conversation as resolved.
Show resolved Hide resolved

### Run the UI app locally

1. Run `yarn run start` and wait for the application to finish starting up
Open your local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then log in using the default username of `username` and default password of `password`.
1. Activate the development environment: `conda activate cs-ui-dev-env`
2. Install/update JavaScript dependencies: `yarn install`
3. Run `yarn run start` and wait for the application to finish starting up
4. Open your local browser and go to [http://localhost:8000](http://localhost:8000) to see conda-store-ui.
5. You can then log in using the default username of `username` and default password of `password`.

**Note:** Hot reloading is enabled, so when you make changes to source files, your browser will reload and reflect the changes.
gabalafou marked this conversation as resolved.
Show resolved Hide resolved

## Run the test suite

We currently use jest in order to run unit tests.
We currently use Jest in order to run unit tests.

```bash
yarn test // find every test with the .test.[tsx|ts] extension
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn is also still used down here. Not sure about getting rid of all mention of installing yarn?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one creates the conda environment per the instructions above yarn should be already installed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should probably somehow be moved into Advanced development then.

Expand Down