Giter Club home page Giter Club logo

smart-irrigation's Introduction

Setup

  1. Setup Environment Variables
  2. Yarn Install
  3. Run yarn dlx @yarnpkg/sdks to update your local yarn config with the editor tools

Local DB

Run docker start smart-irrigation if you've already got the container running and it's stopped, otherwise run docker run --name smart-irrigation -p 4001:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres and yarn seed:real

Folders

/micro-controller

Holds all of the logic to control the ESP8266 running NodeMCU. This is all lua, see the NodeMCU docs for more information.

There is a README in this folder that elaborates on how the project uses LFS (Lua File Store).

/packages/client

React FE used to remotely monitor and control the MCUs.

/packages/server

NodeJS backend written in TypeScript over the NestJS framework. Monitors, stores sensor data, configures, and controls the MCUs.

/packages/prisma

Holds the Prisma ORM configuration and generated types.

Getting Started

Run yarn start:dev to start both the client and server Run yarn start:micro-controller to start the LFS builder and remote http-server used by the MCUs for OTA LFS updates.

Deploying (CapRover)

You will need to have caprover CLI installed and be logged into the caprover instance.

Run yarn deploy:server to begin the deployment

Connecting to db

The db is running in caprover, and port 5050 has been mapped to port 5432 internally, so to connect to it run:

pgcli 'postgresql://postgres:[email protected]:5050/postgres'

Notes

You will need to first check in your changes to main Caprover will pull the latest change, build the docker image based on Dockerfile, and then start the container which runs start.sh (migrates + starts nest app) There is a port mapping in caprover to map port 3000 to 8081 so that the FE can consume it

smart-irrigation's People

Contributors

korziee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.