Agriboard is an administrative dashboard for the agriculture software stack. It is used to manage users and view advanced analytics.
The repository can be run with docker and not installing any other dependencies.
The dockerize.sh
script has been made for this purpose.
The ./dockerize.sh
script can be used with the following arguments:
-
init
- creates a Docker image based on the Dockerfile -
build
- installs the node modules and build the project usingnpm run build
-
run
- installs the node modules and starts a development web server at<docker_ip>:8080
== Dependencies
To install all other dependencies, run yarn
Important
|
Please use yarn to manage your dependencies. |
To start developing, run:
npm start
And navigate to localhost:8080
in a browser.
Hot reloading is enabled, so the server does not needed to be restarted or the any page reloaded when changes are made. Any changes will automatically propogate to the browser while maintaining the previous state of agriboard.
Agriboard adheres to the AirBnB style guide. Read over this briefly to understand the reasoning behind the linting rules.
To perform a single run of the tests:
npm run test
This will run both the unit tests, and the integration tests. Testing will fail if any of the tests do not adhere to the styleguide.
To only run unit tests:
npm run test:unit:single
To run only the integration tests:
npm run test:inte:single
To rebuild the tests on changes, remove :single
.
For example:
npm run test:unit
This project uses Typescript. As such if a package is added that does not include a type definition file, the types must be added as a dependency as well. This can be determined if:
-
An editor complains it cannot find types for
<package>
. -
The installed package does not have a type definition at its root. The type definition file has a
.d.ts
suffix. -
Typescript throws a compilation error complaining that
<package> is implicitly of type any
.
To install types for a package:
yarn add --dev @types/<package>
Where <package>
is the name of the package.
To build for production:
npm run build
To serve the files, http-server
can be installed via:
yarn global add http-server
and the files served using:
http-server dist/ -p 8080