Repository for the app part of Forstler. Please keep in mind that this is a work in progress.
This repository is the single page application part of Forstler. Forstler is an app to monitor and visualize forest health. It uses regional data from third party providers and compares it with the local data which is being gathered by the Forstler IoT module.
The IoT part can be found in the forstler-iot repository.
The Forstler app also tries to provide recommendations for tree species, which can be suitable for the selected location, based on the climate, lighting and soil conditions.
This project is currently just a prototype and needs further development to be fully functional.
This project assumes that you have Node.js and Docker already up and running on your machine.
-
The Docker Desktop application is optional, but a nice user interface tool to visualise the running containers.
-
Download the docker-compose.yml file, and store it in a dedicated directory. You can download the file from the Kaggle Forstler Project.
-
Compose a docker container from the docker-compose.yml file in the directory where the file is located:
docker-compose -f docker-compose.yml up
- The docker container should now be up and running.
- You can terminate the container via the Docker Desktop application, or with the following command:
docker stop forstler-mysqldb
- To restart the created container, use the Docker Desktop application, or the following command:
docker start forstler-mysqldb
The following part assumes that you set up the MySQL docker container following the instructions from the previous section: “Create a MySQL container in Docker”.
I am using Sequel Ace since it seems to be the most reliable SQL workbench for me, but the following procedure should be roughly the same for other SQL workbenches as well.
- Start the forstler-mysqldb docker container.
- Open the SQL workbench of your choice and enter the credentials and port.
- The port should be set to: 3307.
- Test the connection and and insert the chosen password from the docker-compose.yml .
- You can now use the user interface of the SQL workbench to work with the database.
All the necessary data for the prototype can be found and downloaded from the Kaggle Forstler Project. Also included are the aforementioned docker-compose.yml and the following dbconfig.env.
Also included are the CREATE TABLE syntaxed, which should be used in the created docker container to create the necessary tables. Once these are created, import the CSV datasets. They are conveniently named after the table that they should be imported in.
Insert a dbconfig.env file in the root directory of the project (the directory with client and server inside).
In case you are using the stock configuration from the part “Create a MySQL container in Docker” you can simply download the dbconfig.env file from the Kaggle Forstler Project and store it in the root directory (i.e. in the directory with the server and client directories).
In case you used your personal configuration in the previous parts, make sure to adapt the information accordingly. The .env is included in the .gitignore file to make sure, that your supplied credentials will not be uploaded in case you want to fork this project.
- Naviagte to the
./forstler-app/server
directory. - Install the dependencies:
npm install
- In the CLI start the server with the following command:
node index.js
- You should be greeted with the following statement if everything worked our correctly: “Server listening on port 3001”
- Naviagte to the
./forstler-app/client
directory. - Install the dependencies:
npm install
- In the CLI start the server with the following command:
npm start
- The react.js app should now be up and running on the port 3000.