From ef31e4e04d0f1009ef15a5edf1444b86029a633f Mon Sep 17 00:00:00 2001 From: SANTO PAUL M Date: Thu, 30 Nov 2023 17:27:56 +0530 Subject: [PATCH] init add --- .firebaserc | 5 ++ .gitignore | 66 ++++++++++++++++ firebase.json | 10 +++ package.json | 12 +++ public/404.html | 33 ++++++++ public/index.html | 150 ++++++++++++++++++++++++++++++++++++ public/instance/posts.db | Bin 0 -> 12288 bytes public/main.py | 57 ++++++++++++++ public/templates/index.html | 150 ++++++++++++++++++++++++++++++++++++ 9 files changed, 483 insertions(+) create mode 100644 .firebaserc create mode 100644 .gitignore create mode 100644 firebase.json create mode 100644 package.json create mode 100644 public/404.html create mode 100644 public/index.html create mode 100644 public/instance/posts.db create mode 100644 public/main.py create mode 100644 public/templates/index.html diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..e35656e --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "intro-to-engineering" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbb58ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +firebase-debug.log* +firebase-debug.*.log* + +# Firebase cache +.firebase/ + +# Firebase config + +# Uncomment this if you'd like others to create their own Firebase project. +# For a team working on the same Firebase project(s), it is recommended to leave +# it commented so all members can deploy to the same project(s) in .firebaserc. +# .firebaserc + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..e782939 --- /dev/null +++ b/firebase.json @@ -0,0 +1,10 @@ +{ + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c129aef --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "eng_proj", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..829eda8 --- /dev/null +++ b/public/404.html @@ -0,0 +1,33 @@ + + + + + + Page Not Found + + + + +
+

404

+

Page Not Found

+

The specified file was not found on this website. Please check the URL for mistakes and try again.

+

Why am I seeing this?

+

This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html file in your project's configured public directory.

+
+ + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..058cce8 --- /dev/null +++ b/public/index.html @@ -0,0 +1,150 @@ + + + + + + + Irrigation System + + + + +
+
+ Featured +
+
+
Irrigate ur Plant
+

Irrigate ur plant with the click of a button

+ Go somewhere +
+ +
+ +
+
+ +
+

Temperature

+

The actual temperature is: {{ weather["days"][0]["temp"] }} F

+

feelslikemax: {{ weather["days"][0]["feelslikemax"] }} F

+

feelslikemin: {{ weather["days"][0]["feelslikemin"] }} F

+

description: {{ weather["days"][0]["description"] }}

+ +

Precipitation

+

Precipiation cover: {{weather["days"][0]["precipcover"]}}

+

Wind speed

+

Average speed: {{weather["days"][0]["windspeed"]}} km/hr

+

Gust Speed: {{weather["days"][0]["windgust"]}} km/hr

+

Water concentraion in soil

+

water concentration

+

Solar Radiation

+

Solar Radiation: {{ weather["days"][0]["solarradiation"] }}

+
+
+
+
+
+ + +
Enter a valid interval here.
+
+
+ + +
+
+ + +
+ +
+
+
+ + + \ No newline at end of file diff --git a/public/instance/posts.db b/public/instance/posts.db new file mode 100644 index 0000000000000000000000000000000000000000..7436eb8e087728f1492a5b900be0742edeccf8c7 GIT binary patch literal 12288 zcmeI#F-yZh6bJCTDry5I-LjQ8CQzis!AUTdLxVBemh}};IF9BH zI(6vgQ2r0@9q*1ia=%RPaqj1>q?f8L)0WQIka5l~i5O$N8wcIkgsKlWMK`N@S8#Uv z`ZF+pS-!zUae7DAg~eIE%;ZP&UUZ#(lCIiH z*NOhhWU43C*PkfQfl5P_5D1Rwwb2tWV=5P$##AOHaf?5lvG9)|vZUw<#&1px>^ U00Izz00bZa0SG_<0uaywe{+#W{r~^~ literal 0 HcmV?d00001 diff --git a/public/main.py b/public/main.py new file mode 100644 index 0000000..6f5f285 --- /dev/null +++ b/public/main.py @@ -0,0 +1,57 @@ +# from datetime import date +from flask import Flask, abort, render_template, redirect, url_for, flash, request +from flask_bootstrap import Bootstrap5 +# from flask_ckeditor import CKEditor +from flask_login import UserMixin, login_user, LoginManager, current_user, logout_user +from flask_sqlalchemy import SQLAlchemy +import requests + +app = Flask(__name__) +Bootstrap5(app) +base_url = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/Chennai,India" + +WEA_API_KEY = "BYQFA92QMMNN5WQSWHUQEVLMB" #weather api key + + +# body={ +# "location": "Chennai,India", +# } + +params = { + "key": WEA_API_KEY, +} +weather = requests.get(base_url,params=params) + + +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///posts.db' +db = SQLAlchemy() +db.init_app(app) + + +class User(UserMixin, db.Model): + __tablename__ = "users" + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String(100), unique=True) + password = db.Column(db.String(100)) + name = db.Column(db.String(100)) + + + +with app.app_context(): + db.create_all() + +@app.route("/home", methods=["GET", "POST"]) +def home(): + if request.method == "POST": + new_interval = request.form['new_interval'] + print(new_interval) + return render_template("index.html") + + + print(weather.json()) + return render_template("index.html", weather = weather.json()) + + + +if __name__ == "__main__": + app.run(port=5002, debug = True) \ No newline at end of file diff --git a/public/templates/index.html b/public/templates/index.html new file mode 100644 index 0000000..ed541bf --- /dev/null +++ b/public/templates/index.html @@ -0,0 +1,150 @@ + + + + + + + Irrigation System + + + + +
+
+ Featured +
+
+
Irrigate ur Plant
+

Irrigate ur plant with the click of a button

+ Go somewhere +
+ +
+ +
+
+ +
+

Temperature

+

The actual temperature is: {{ weather["days"][0]["temp"] }} F

+

feelslike: {{ weather["days"][0]["feelslikemax"] }} F

+

feelslike: {{ weather["days"][0]["feelslikemin"] }} F

+

description: {{ weather["days"][0]["description"] }}

+ +

Precipitation

+

Precipiation cover: {{weather["days"][0]["precipcover"]}}

+

Wind speed

+

Average speed: {{weather["days"][0]["windspeed"]}} km/hr

+

Gust Speed: {{weather["days"][0]["windgust"]}} km/hr

+

Water concentraion in soil

+

water concentration

+

Solar Radiation

+

Solar Radiation: {{ weather["days"][0]["solarradiation"] }}

+
+
+
+
+
+ + +
Enter a valid interval here.
+
+
+ + +
+
+ + +
+ +
+
+
+ + + \ No newline at end of file