Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
115 changes: 9 additions & 106 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -1,137 +1,40 @@
# Getting started

## Recommended software:
## Required software

- Node 8.12.0 or later (https://nodejs.org/en/)
- VSCode (https://code.visualstudio.com/), or other IDE with typescript support (like WebStorm)
- yarn package manager (https://yarnpkg.com/en/)
- Any GIT client (standalone, or embedded into your IDE)
- `node` 8.12.0 or higher (https://nodejs.org/en/)
- `yarn` package manager (https://yarnpkg.com/en/).
- Please note that `npm` is not applicable for installing or building the application.

## Running the project with template

Clone the repository.

To install react app use:

```
npm install -g create-react-app
```

To build and then start the project use:
## Install

```
git clone git@github.com:epam/badgerdoc.git
cd badgerdoc/web
yarn
yarn start
```

Then open your browser on http://localhost:3000/

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
Launches the test runner in the interactive watch mode.

See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

# Build configuration

## CSS/SCSS Modules

We build styles using SCSS in combination with CSS modules.

If you have the following MyComponent.module.scss file:

```
.my-header {
color: red;
}
```

You can import and use selectors from it from your tsx file:

```
import * as React from 'react';
import * as css from './MainPage.module.scss';

export const MyComponent = <div className={ css.mainPanel }>
```

css.mainPanel will be equal to auto-generated class name, which is guaranteed to be unique across the project. In development mode, selector will contain the name of the file and hash, like "MainPage_mainPanel\_\_140Pj". In production mode, selectors will be made short to reduce size.

If you need an usual global selector, use:

```
:global(.my-selector)
```

Read more on CSS Modules here: https://github.com/css-modules/css-modules

Read more on SCSS here: https://sass-lang.com/

## SVG icons

SVG files can be imported like this:

```
import { ReactComponent as myIcon } from 'icons/myIcon.svg'
```

After this, myIcon.svg will be included in SVG sprite as a symbol, and myIcon variable will contain and object with meta-information about the SVG file, like { id, url, viewBox } or like React.SFC.

[comment]: <> (## Working the .NET/Java server)

[comment]: <> (By default, the project is configured to run without the server &#40;like .NET/Java-based REST APIs&#41;.)

[comment]: <> (Usually, back-end project serves static assets as well as it's REST APIs. Considering this, when you'll get back-end server running, you need to change some settings:)

[comment]: <> (- make sure your server can serve static files from /built path.)

[comment]: <> (- the app uses Single Page Application approach, so routing is done at client-side. To support this, you'll need to tweak your server-side routing so any unknown path &#40;like /home&#41; serves the /built/index.html file content)

[comment]: <> (- on developers machines, setup the server to run on some spare port &#40;like 44301&#41;)

[comment]: <> (- Back-end developers can use "yarn build" after getting the source, to get recent version of UI scripts)

[comment]: <> (- On your build/CI script use "yarn prod" command to build the bundle.js.)

# Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn about UII, visit [UUI documentation website](https://uui.epam.com/)

To learn React, check out the [React documentation](https://reactjs.org/).

## Project Structure Overview

<img src='./docs/structure.png' />

## Local Development

To work in local environment you need to start up the **_local backend_** and configure env variables for correct connection.
For that you need to copy content of `.env.example` file to `.env.local` and specify provided variables.

## Test
Libraries for testing:
- React testing library
- Jest
Binary file removed web/docs/structure.png
Binary file not shown.