Skip to content

Commit 2288ce5

Browse files
authored
readme updates (#18007)
1 parent 1e59d88 commit 2288ce5

File tree

2 files changed

+63
-39
lines changed

2 files changed

+63
-39
lines changed

.github/BUILD.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In order to build the Umbraco source code locally with Visual Studio Code, first
3636

3737
Open the root folder of the repository in Visual Studio Code.
3838

39-
To build the front end you'll need to open the command pallet (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and run `>Tasks: Run Task` followed by `Client Build`.
39+
To build the front-end you'll need to open the command pallet (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and run `>Tasks: Run Task` followed by `Client Build`.
4040

4141
You can also run the tasks manually on the command line:
4242

@@ -46,9 +46,7 @@ npm i
4646
npm run build:for:cms
4747
```
4848

49-
If you just want to watch the UI Client to `Umbraco.Web.UI` then instead of running `build:for:cms`, you can do: `npm run dev:mock`. This will launch the Vite dev server on http://localhost:5173 and watch for changes with mocked API responses.
50-
51-
You can also run `npm run dev:server` to run the Vite server against a local Umbraco instance. In this case, you need to have the .NET project running and accept connections from the Vite server. Please see the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
49+
If you want to make changes to the UI, you can choose to run a front-end development server. To learn more please read the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
5250

5351
The login screen is a different frontend build, for that one you can run it as follows:
5452

Lines changed: 61 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
# Umbraco.Web.UI.Client (Bellissima)
1+
# Umbraco.Web.UI.Client
22

3-
This is the working folder for the Umbraco Backoffice client, also known as Bellissima. This is a SPA (Single Page Application) built with Lit.
3+
This is the Umbraco Backoffice UI/Client, also known as Bellissima.
44

5-
## Installation instructions
5+
This is for you as a contributor who likes to make changes to the Backoffice UI/Client project.
66

7-
1. Run `npm install`
8-
2. Run `npm run dev` to launch Vite in dev mode
7+
## Installation
98

10-
### Environment variables
9+
1. Make sure you have [NodeJS](https://nodejs.org/en/download) installed.
10+
2. Run `npm install` to install the dependencies.
1111

12-
The development environment supports `.env` files, so in order to set your own make a copy
13-
of `.env` and name it `.env.local` and set the variables you need.
12+
## Ways to run a Development Server
1413

15-
As an example to show the installer instead of the login screen, set the following
16-
in the `.env.local` file to indicate that Umbraco has not been installed:
14+
1. If you will be working from VS Code, there is options to run both [back-end and front-end server in debug modes](#debug-via-vs-code).
1715

18-
```bash
19-
VITE_UMBRACO_INSTALL_STATUS=must-install
20-
```
16+
2. Or you can choose to [run each of these individually](#run-a-front-end-server-against-a-local-umbraco-instance), this can be done from the Command-line/Terminal, but requires a few lines from configuration on the back-end server.
2117

22-
## Environments
18+
### Debug via VS Code
2319

24-
### Development
20+
If you are using VS Code, you can use the `launch.json` file to start the development server. This will also start the Umbraco instance and open the browser.
2521

26-
The development environment is the default environment and is used when running `npm run dev`. All API calls are mocked and the Umbraco Backoffice is served from the `src` folder.
22+
You should run the task **Backoffice Launch (Vite + .NET Core)** in the **Run and Debug** panel, which will start the Vite server and the Umbraco instance. It automatically configures Umbraco (using environment variables) to use the Vite server as the Backoffice host. This task will also open a browser window, so you can start developing right away. The first time you run this task, it will take a little longer to start the Umbraco instance, but subsequent runs will be faster. Keep an eye on the Debug Console to see when the Umbraco instance is ready and then refresh the browser.
2723

28-
### Run against a local Umbraco instance
24+
If you want to run the Vite server only, you can run the task **Backoffice Launch Vite**, which will start the Vite server only and launch a browser.
2925

30-
If you have a local Umbraco instance running, you can use the development environment to run against it by overriding the API URL and bypassing the mock-service-worker in the frontend client.
26+
If you have an existing Vite server running, you can run the task **Backoffice Attach Vite** to attach the debugger to the Vite server.
3127

32-
Create a `.env.local` file and set the following variables:
28+
### Run a front-end server against a local Umbraco instance
3329

34-
```bash
35-
VITE_UMBRACO_API_URL=https://localhost:44339 # This will be the URL to your Umbraco instance
36-
VITE_UMBRACO_USE_MSW=off # Indicate that you want all API calls to bypass MSW (mock-service-worker)
37-
```
3830

39-
Open this file in an editor: `src/Umbraco.Web.UI/appsettings.Development.json` and add this to the `Umbraco:CMS:Security` section to override the backoffice host:
31+
To enable the client running on a different server, we need to correct the `appsettings.json` of your project.
32+
33+
For code contributions you can use the backend project of `src/Umbraco.Web.UI`.
34+
Open this file in an editor: `src/Umbraco.Web.UI/appsettings.Development.json` and add these 4 fields to the `Umbraco > CMS > Security`:
4035

4136
```json
4237
"Umbraco": {
@@ -51,30 +46,61 @@ Open this file in an editor: `src/Umbraco.Web.UI/appsettings.Development.json` a
5146
}
5247
```
5348

54-
Now start the vite server by running the command: `npm run dev:server` in the `Umbraco.Web.UI.Client` folder, and finally open the http://localhost:5173 URL in your browser.
49+
This will override the backoffice host URL, enabling the Client to run from a different origin.
5550

56-
### VS Code
51+
#### Run the front-end server
5752

58-
If you are using VS Code, you can use the `launch.json` file to start the development server. This will also start the Umbraco instance and open the browser.
53+
Now start the Vite server by running the command: `npm run dev:server` in the `Umbraco.Web.UI.Client` folder.
5954

60-
You should run the task **Backoffice Launch (Vite + .NET Core)** in the **Run and Debug** panel, which will start the Vite server and the Umbraco instance. It automatically configures Umbraco (using environment variables) to use the Vite server as the Backoffice host. This task will also open a browser window, so you can start developing right away. The first time you run this task, it will take a little longer to start the Umbraco instance, but subsequent runs will be faster. Keep an eye on the Debug Console to see when the Umbraco instance is ready and then refresh the browser.
55+
Finally open `http://localhost:5173` in your browser.
6156

62-
If you want to run the Vite server only, you can run the task **Backoffice Launch Vite**, which will start the Vite server only and launch a browser.
57+
## Contributing
6358

64-
If you have an existing Vite server running, you can run the task **Backoffice Attach Vite** to attach the debugger to the Vite server.
59+
If you want to get started on contributing, please read the [contributing guidelines](/.github/contributing-backoffice.md).
60+
61+
A list of issues can be found on the [Umbraco-CMS Issue Tracker](https://github.com/umbraco/Umbraco-CMS/issues). Many of them are marked as `community/up-for-grabs` which means they are up for grabs for anyone to work on.
62+
63+
## Documentation
64+
65+
The documentation can be found on [Umbraco Docs](https://docs.umbraco.com/umbraco-cms).
66+
67+
## Advanced
6568

6669
### Storybook
6770

6871
You can test the Storybook locally by running `npm run storybook`. This will start the Storybook server and open a browser window with the Storybook UI.
6972

7073
Storybook is an excellent tool to test out UI components in isolation and to document them. It is also a great way to test the responsiveness and accessibility of the components.
7174

72-
## Contributing
75+
### Front-end server configuration
7376

74-
We accept contributions to this project. However be aware that we are mainly working on a private backlog, so not everything will be immediately obvious. If you want to get started on contributing, please read the [contributing guidelines](/.github/contributing-backoffice.md).
77+
When running `npm run dev` the default default environment and is used when running. In this case all API calls are mocked and the Umbraco Backoffice is served from the `src` folder.
7578

76-
A list of issues can be found on the [Umbraco-CMS Issue Tracker](https://github.com/umbraco/Umbraco-CMS/issues). Many of them are marked as `community/up-for-grabs` which means they are up for grabs for anyone to work on.
79+
This section describes how this can be used and how you can make your own configuration.
7780

78-
## Documentation
81+
#### Environment variables
7982

80-
The documentation can be found on [Umbraco Docs](https://docs.umbraco.com/umbraco-cms).
83+
You can setup your own environment variables for the development front-end server, which is based on Vite.
84+
85+
The development environment supports `.env` files, so in order to set your own make a copy
86+
of `.env` and name it `.env.local` and set the variables you need.
87+
88+
As an example to show the installer instead of the login screen, set the following
89+
in the `.env.local` file to indicate that Umbraco has not been installed:
90+
91+
```bash
92+
VITE_UMBRACO_INSTALL_STATUS=must-install
93+
```
94+
95+
#### Run against a local backend server
96+
97+
If you like the default script `npm run dev` to not use mock server and run against a server of your own configuration, this can be done via Environment variables.
98+
99+
Create a `.env.local` file and set the following variables:
100+
101+
```bash
102+
VITE_UMBRACO_API_URL=https://localhost:44339 # This will be the URL to your Umbraco instance
103+
VITE_UMBRACO_USE_MSW=off # Indicate that you want all API calls to bypass MSW (mock-service-worker)
104+
```
105+
106+
This example above, is identical to what happens when running `npm run dev:server`.

0 commit comments

Comments
 (0)