README.md 1.85 KB
Newer Older
markchkhotua's avatar
markchkhotua committed
1
2
3
4
# Genesys Catalog UI

React application.

Matija Obreza's avatar
Matija Obreza committed
5
6
# Run with Docker

7
8
Pick an image from [Docker image registry](https://gitlab.croptrust.org/genesys-pgr/catalog/genesys-catalog-ui/container_registry).

Matija Obreza's avatar
Matija Obreza committed
9
10
11
12
13
```bash
docker run -it \
  -e CLIENT_ID=my-...-client \
  -e CLIENT_SECRET=my-...-client \
  -e CATALOG_API_URL=https://catalog-master.review.genesys-pgr.org \
14
 dockerhub.croptrust.org/genesys-pgr/catalog/genesys-catalog-ui:1.0
Matija Obreza's avatar
Matija Obreza committed
15
16
```

17
18
Also inspect the Docker [swarm compose file](docker/review-compose-template.yml) that we use for CI.

markchkhotua's avatar
markchkhotua committed
19
20
21
22
# Development

This project uses npm, gulp and webpack to package the React TypeScript application.

23
24
Optional params supported:

Matija Obreza's avatar
Matija Obreza committed
25
`CLIENT_SECRET` - ui app sicret used for oauth authentication in java server
26

Matija Obreza's avatar
Matija Obreza committed
27
`CLIENT_ID` - ui app id used for oauth authentication in java server
28

Matija Obreza's avatar
Matija Obreza committed
29
`CATALOG_API_URL` - url to java server
30
31
32
33
34

`googleClientId` - id of google project, used for oauth authentication with google.

Google api for configure projects: <https://console.developers.google.com>

markchkhotua's avatar
markchkhotua committed
35
36
37
To start a live-reload server and work on the application, run:

```bash
Matija Obreza's avatar
Matija Obreza committed
38
npm run server
markchkhotua's avatar
markchkhotua committed
39
40
41
42
43
44
45
46
47
48
```

This starts the _webpack-dev-server_ on port 3000:

- <http://localhost:3000/webpack-dev-server/>
- <http://localhost:3000/>

Pack the React application for production and test server-side loading (run express server):

```bash
Matija Obreza's avatar
Matija Obreza committed
49
npm run server:production
markchkhotua's avatar
markchkhotua committed
50
```
Matija Obreza's avatar
Matija Obreza committed
51

52
Example of using optional params:
markchkhotua's avatar
markchkhotua committed
53

54
```bash
Matija Obreza's avatar
Matija Obreza committed
55
CLIENT_ID=client-id CLIENT_SECRET=client-secret CATALOG_API_URL=http://localhost:8080 npm run server
56
```
markchkhotua's avatar
markchkhotua committed
57
58
59
60
61
62
63
64
65
66

## Documentation

We rely on the following libraries to make things work:

- React Toolbox: <http://react-toolbox.com/#/components>
- Flexbox Grid Layout: <http://flexboxgrid.com/>
- Material Icons: <https://material.io/icons/>

- React CSS modules: <https://github.com/gajus/react-css-modules#whats-the-problem>
67

markchkhotua's avatar
markchkhotua committed
68
- Immutability helpers: <https://github.com/kolodny/immutability-helper>