2019-08-31 20:51:14 -07:00
2020-02-05 12:05:43 -08:00
# DataHub Web
The DataHub web application is written in [TypeScript ](https://www.typescriptlang.org/ ) and [EmberJs ](https://emberjs.com/ ).
The application is developed using a modular monorepo architecture, via [Yarn Workspaces ](https://classic.yarnpkg.com/en/docs/workspaces ), that allows us to split the application features into individually installable packages.
2019-08-31 20:51:14 -07:00
2020-02-05 12:05:43 -08:00

## Folder Layout
The folder structure is organized as below:
```sh
datahub-web
├── @datahub # application modules / packages
├── blueprints # EmberJs blueprints for the app
├── configs # configuration sources for building the app
├── node_modules # installed packages dependencies
├── packages # application source directory
└── scripts # helper shell scripts
```
## Prerequisites
2020-02-07 10:08:57 -08:00
* [Also see Frontend ](https://github.com/linkedin/datahub/blob/master/datahub-frontend/README.md#pre-requisites )
2020-02-05 12:05:43 -08:00
* Other dependencies are installed as part of the build step
## Build
Running the build script `./gradlew build` from the top-level directory `<DOWNLOAD_DIRECTORY>/datahub` will build the entire app.
To build the web client (Ember application), you can run the following from the top-level directory
```sh
datahub> ./gradlew emberBuild
```
or
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub> ./gradlew :datahub-web:build
```
Building will run the monorepo test suite and transpile the TypeScript application into the `datahub-web/dist` folder.
## Developing & Running the web application
Once [DataHub GMS ](../gms ) and the [DataHub Frontend ](../datahub-frontend ) are running you can start [DataHub Web ](./ ) by running:
2020-02-06 09:54:43 -08:00
```sh
2020-02-24 11:36:26 +08:00
datahub> ./gradlew emberServe
2020-02-05 12:05:43 -08:00
```
or
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub-web> yarn # To install dependencies, if you skipped the build step above
datahub-web> yarn run dev # serve the ember application
```
This will start the ember application and proxy to your running instance of [DataHub Frontend ](../datahub-frontend ).
NOTE: If you are running [DataHub Frontend ](../datahub-frontend ) on a port other than 9001, you will need to update the proxy to this port number in the [gradle script ](./build.gradle ).
## Testing
To run all tests
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub> ./gradlew emberTest
2019-08-31 20:51:14 -07:00
```
2020-02-05 12:05:43 -08:00
or
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub> yarn test
2019-08-31 20:51:14 -07:00
```
2020-02-05 12:05:43 -08:00
To run test for a specific package / workspace in the [DataHub Web ](./ ) monorepo, you can execute
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub> yarn workspace < WORKSPACE_NAME > test # where WORKSPACE_NAME is a yarn workspace in @datathub/
2019-08-31 20:51:14 -07:00
```
2020-02-05 12:05:43 -08:00
For example:
2020-02-06 09:54:43 -08:00
```sh
2020-02-05 12:05:43 -08:00
datahub> yarn workspace @datahub/data -models test
2019-08-31 20:51:14 -07:00
```
2020-02-05 12:05:43 -08:00
## Contributing
2020-02-06 09:54:43 -08:00
[See contributing.md ](../CONTRIBUTING.md )