Welcome to the Plant 3D Explorer repository. It is the home of our webapp dedicated to the exploration of single plant acquisitions and reconstruction.
For a general documentation on the whole ROMI project, head over here.
You will need npm
to use this package.
It comes with nodejs
, as per the official instruction.
To install v16.X, for ubuntu:
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
For other distro look here or here for non linux distro. To make sure everything works fine, your version of nodejs must be >= 10, and your version of npm must be >= 6. To test it:
node -v
npm -v
First clone the plant-3d-explorer
git repository and enter the downloaded folder:
git clone https://github.com/romi/plant-3d-explorer.git
cd plant-3d-explorer
This is needed to install the dependencies of the project. At the root of the project directory, execute the following command:
npm install
Still at root of the project directory, you can run:
This will run the tests for the project. It will permanently run and run again on files when they are changed. Multiple commands are available, see this for more info.
Each test file is located with the component it is testing. So the tests for the file src/ScanList/index.js
are located in src/Scanlist/index.test.js
.
To run the app in the development mode, just execute :
npm start
After a brief, the terminal should display:
Compiled successfully!
You can now view sony_visualiseur-plantes-3d in the browser.
Local: http://localhost:3000/
On Your Network: http://192.168.0.18:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.
Then, open http://localhost:3000 to view it in the browser.
You need to add a file .env.local
at project's root to set the API URL
:
REACT_APP_API_URL='{`API URL}'
Without this, the app will use http://localhost:5000
.
To use a local database, you must run the data storage server from this repository.
Warning : To run plant-3d-explorer
on bleeding edge linux (such as Fedora Linux or Arch-based distros), see issue 155
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 for more information.
To build the image, at the root directory of the repo:
./docker/build.sh
You can use the -h
option for more information.
To run the container
./docker/run.sh
Once it's up, you should be able to access the viewer here: http://localhost:3000/
important:
Use
chrome
asfirefox
has some issues with the used JavaScript libraries!
Push it on roboticsmicrofarms
docker hub:
docker push roboticsmicrofarms/plant-3d-explorer:2.1
This requires a valid account, token and existing repository (plant-3d-explorer
) on docker hub!
First you need to pull the docker image:
docker pull roboticsmicrofarms/plant_3d_explorer
Then you can run it with:
docker run -p 3000:3000 roboticsmicrofarms/plant_3d_explorer
To use a local database, for testing or development, we provide a docker compose recipe that:
- start a
PlantDB
container usingroboticsmicrofarms/plantdb
- start a
Plant 3D Explorer
container usingroboticsmicrofarms/plant-3d-explorer
note:
You need
docker-compose
installed, see here.
From plant-3d-explorer
's root directory :
export ROMI_DB=<path/to/db>
docker-compose -f ./docker/docker-compose.yml up -d
important:
Do not forget to set
ROMI_DB
, the path to the database.
note: To stop the containers:
docker-compose stop
To use local builds for development or debugging purposes:
- build your image following the instructions above and use a specific tag like
debug
- edit the
docker-compose.yml
file to add the previously defined tag to the name of the image to start
https://romi.github.io/plant-3d-explorer/
The documentation of this package is done by docz. To install it, and its dependencies, do:
npm install docz react react-dom
Then:
npm run docz:dev
If you experience any difficulty with docz
, head over here.