You need to have Go,
Node.js, Docker, and Docker Compose
Verify the tools by running the following commands:
go version
npm --version
docker --version
docker-compose --version
In the project directory run the command (you might
need to prepend it with sudo
depending on your setup):
docker-compose -f docker-compose-dev.yml up
This starts a local PostgresSQL on localhost:5432
.
The database will be populated with test records
from the init-db.sql file.
Navigate to the server
folder and start the back end:
cd server
export LOG_LEVEL=debug
export PG_URL=postgres://postgres:postgres@localhost:5432/plant-controller?sslmode=disable
export HTTP_ADDR=localhost:8080
go run main.go
The back end will serve on http://localhost:8080.
Navigate to the frontend
folder, install dependencies,
and start the front end development server by running:
cd frontend
npm install
npm start
The application will be available on http://localhost:3000.
Perform:
docker-compose up
This will build the application and start it together with its database. Access the frontend on http://localhost:80, the backend on http://localhost:8080