Giter Site home page Giter Site logo

feraskhemakhem / arecanutfarminformatics Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 3.0 70.16 MB

GitHub repository for the project Arecanut Farm Informatics.

Python 99.34% Shell 0.04% PowerShell 0.02% Xonsh 0.01% C 0.06% JavaScript 0.10% CSS 0.21% HTML 0.23% Procfile 0.01%

arecanutfarminformatics's Introduction

ArecanutFarmInformatics

This code base is the GitHub repository for the project Arecanut Farm Informatics created for the graduate course CSCE 606 - Software Engineering. Setup the project by following the instructions mentioned below:

Prerequisite

Verify whether you have installed python by checking its version. To check python version:

python -V

Make sure you have installed pip:

python-pip

Cloning The Project:

  • Clone the project code using the following git command and then switch to the cloned project folder:

     HTTPS: git clone https://github.com/feraskhemakhem/ArecanutFarmInformatics.git 
     OR if using Github CLI: gh repo clone feraskhemakhem/ArecanutFarmInformatics
     
     cd ArecanutFarmInformatics/AgriHelp
    
  • Install dependencies, (use sudo if required)

     pip install -r requirements.txt
    
  • A .env file must be added to the AgriHelp subfolder. A .env file with all the necessary secrets is ecrypted in the secrets folder. Move the decrypted file to the AgriHelp/ folder to ensure that the database can be accessed for all functionality.

Running the Project Locally

  • Start application hosting it locally:

     python app.py
     OR
     python -m flask run
    

Common error faced while running locally is "Flask ImportError: No Module Named Flask" for which you can create a virtual env by following steps mentioned below: virtualenv flask

  cd flask
  
  source bin/activate

Now you should see (flask) on the left of the command line. Then proceed to install flask:

  pip install flask
  • In the browser go to:

     http://localhost:5000          
    

You'd be able to see the landing page of the ArecanutFarmInformatics website from where you can proceed to login or register yourself prior to logging in to check out the available functionalities.

Database Connection and Heroku Deployment

Heroku Deployment

  • In order to deploy to Heroku, first a Heroku app must be created and connected to the codebase. Under the settings tab, add config vars for each key in the .env file of the secret folder (the key is the name, the value is the secret).

  • Finally, deploy the code from the main branch to ensure that it works. The procfile should include both dynos needed to run. In order for the clock dyno to run on time, we must run a clock process to start the cronjob. This will enable scheduling of email notifications. Running the following command in Heroku CLI will enable this:

    heroku ps:scale clock=1
    

At this point, everything should be running as intended.

Database Connection

  • Please note that direct connection to the database is NOT required to deploy the project, and is only required if one wishes to look into the tables of the database.

  • The database is written in MySQL, hosted on an Amazon RDS DB instance. To directly access the database, we use MySQL Workbench. For details on connecting to our database with MySQL Workbench, please refer to this resource: https://aws.amazon.com/premiumsupport/knowledge-center/connect-rds-mysql-workbench/. The parameters needed are all included in the .env of the secret folder.

  • The database's name is FarmInformatics, with the following table names:

    • Users, used to store user login data
    • Tanks, used to store information about water tanks
    • Rainfall, used to store information about rainfall on given timeframes
    • Plots, used to store information about the plot(s) of land the user keeps track of

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.