Skip to content

Plant-Controller provides a managementment api/ui to control a smart iot plant care system

License

Notifications You must be signed in to change notification settings

alex-held/plant-controller

Repository files navigation

Plant-Controller

Copyright 2021 GitHub

GitHub GitHub Wiki GitHub pull requests Commit Activity

frontend docker shield backend docker shield

Environment setup

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

Start in development mode

Start the database

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.

Start the backend service

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.

Start in production mode (docker-compose)

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

About

Plant-Controller provides a managementment api/ui to control a smart iot plant care system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published