Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions farmfolio resp/farmfolio resp/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
return 'Welcome to my website!'

@app.route('/about')
def about():
return 'This is the about page.'

@app.route('/contact')
def contact():
return 'Contact us at example@example.com'

@app.route('/blog')
def blog():
return 'Check out our latest blog posts.'

@app.route('/product/<int:product_id>')
def product(product_id):
return f'This is product {product_id} page.'

@app.route('/category/<category_name>')
def category(category_name):
return f'You are viewing category: {category_name}'

@app.route('/user/<username>')
def user(username):
return f'Hello, {username}!'

@app.route('/services')
def services():
return 'We offer a variety of services.'

@app.route('/portfolio')
def portfolio():
return 'Explore our portfolio.'

@app.route('/faq')
def faq():
return 'Frequently Asked Questions'

if __name__ == '__main__':
app.run(debug=True)
11 changes: 11 additions & 0 deletions farmfolio resp/farmfolio resp/farmfolio db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE DATABASE IF NOT EXISTS farmfolio_db;

USE farmfolio_db;

CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL
);

INSERT INTO users (username, password) VALUES ('sonu', '$2b$12$EaEZ1U16tR9M.DxgWGThl.yX3rXN5b1Em.nILpdWBp3kg1Ae8N2.y'), ('bhumi', '$2b$12$EaEZ1U16tR9M.DxgWGThl.yX3rXN5b1Em.nILpdWBp3kg1Ae8N2.y');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/amanSignW.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/bio.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/bioFer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added farmfolio resp/farmfolio resp/image/img 1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/img 9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/logoB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added farmfolio resp/farmfolio resp/image/logoG.png
Binary file added farmfolio resp/farmfolio resp/image/logoW.png
1 change: 1 addition & 0 deletions farmfolio resp/farmfolio resp/image/srchIcon.svg
Binary file added farmfolio resp/farmfolio resp/image/tree.jpg
Binary file added farmfolio resp/farmfolio resp/image/wheat.jpg
160 changes: 160 additions & 0 deletions farmfolio resp/farmfolio resp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Farmfolio</title>
<link rel="shortcut icon" href="./image/favicon.ico" type="image/x-icon">

<link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css" rel="stylesheet">


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

<link rel="stylesheet" href="styles.css">
</head>
<body>


<nav>
<div class="main">


<div class="logo"><img src="./image/logoW.png" alt="Logo"></div>


<div class="srchIcon"><i class="material-icons" id="searchIcon">search</i></div>

<div id="search"> <input type="search" name="" id="srch" placeholder="Search something on farmfolio"></div>

<div id="language"> <a href="#"><i class="material-icons" id="lang">translate</i> <div id="lngtxt">Language</div></a> </div>


<div id="notification"> <a href="#"><i class="material-icons" id="noti">notifications</i> <div id="notitxt">Notification</div></a> </div>


<button id="login"> Login</button>






<div class="threeLine" onclick="toggleMenu()">
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</div>
</nav>

<section class="hero">
<div class="slider">
<img src="./image/img 1.jpg" alt="Slide 1">
<img src="./image/img 2.png" alt="Slide 2">
<img src="./image/img 3.jpg" alt="Slide 3">
<img src="./image/img 4.jpg" alt="Slide 4">
<img src="./image/img 5.jpg" alt="Slide 5">
</div>
</section>



<div class="bioFertilizer">
<div id="image1"></div>

<div class="artical">

<h3>Organic Farming Guide </h3>

<p>
<br> <br>
Biofertilizers are natural supplements containing living microorganisms, which when applied to soil or plants, enhance nutrient availability and uptake, ultimately promoting plant growth and health. <br> <br> </p>
<a href="#" target="_blank" id="bioFert">Learn more</a>
</div>
</div>

<div class="bioFertilizer">
<div id="image2"></div>


<div class="artical">

<h3> Smart Farming </h3>

<p>
<br> <br>
Explore the frontier of agriculture with Smart Farming, where technology meets tradition to revolutionize crop management and increase efficiency. Discover how data-driven insights, automation, and IoT are reshaping farming practices for a sustainable and prosperous future. <br> <br> </p>
<a href="#" target="_blank">Learn more</a>
</div>
</div>

<div class="bioFertilizer">
<div id="image3"></div>

<div class="artical">

<h3>Healthy Farming </h3>

<p>
<br> <br>
Nurture thriving crops sustainably with Healthy Farming. Explore innovative techniques for a healthier harvest and a greener planet. Join us in cultivating a brighter, healthier future. <br> <br> </p>
<a href="#" target="_blank">Learn more</a>
</div>
</div>

<div class="bioFertilizer">
<img src="./image/bio.jpg" alt="">

<div class="artical">

<h3>Quality Assurance Systems </h3>

<p>
<br> <br>
Discover the backbone of agricultural excellence with Quality Assurance Systems. From rigorous inspections to meticulous record-keeping, these systems ensure that every step of the farming process meets stringent quality standards. Learn how farmers uphold integrity, safety, and consumer trust through effective quality control measures. <br> <br> </p>
<a href="#" target="_blank">Learn more</a>
</div>
</div>



<div class="alert">
<h2>Government Scheme</h2>

<div id="tree"></div>
<p class="aleartmsg"><marquee behavior="scroll" direction="left">we are working on it</marquee></p>
</div>


<footer>

<div class="feedback">
<h3>FEEDBACK</h3>

<label for="nameInFeedbox" name="" class="nameFeed">Name</label>
<input type="text" name="" id="nameInFeedbox" maxlength="20" required placeholder="Enter your name">

<label for="emailInFeedbox" class="emailFeed">Email</label>
<input type="email" name="" id="emailInFeedbox" maxlength="30" required placeholder="example@xyz.com">

<label for="feedMsg" class="msg">message</label>
<textarea name="feedmessage" id="feedMsg" required maxlength="300" placeholder="Give your suggestion under 300 words"></textarea>


<label class="terms" for="agree"> <input type="radio" name="agree" id="agreeBtn" class="radio"> I have read and agree to the<a href="#" target="_blank">Terms and Conditions</a></label>

<input type="submit" value="submit" id="submit">
</div>





</footer>

<script src="scripts.js" defer></script>
</body>
</html>


44 changes: 44 additions & 0 deletions farmfolio resp/farmfolio resp/login/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from flask import Flask, render_template, request, jsonify, redirect, url_for
from flask_mysqldb import MySQL
import bcrypt

app = Flask(__name__)


app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'your_username'
app.config['MYSQL_PASSWORD'] = 'your_password'
app.config['MYSQL_DB'] = 'farmfolio_db'
app.config['MYSQL_CURSORCLASS'] = 'DictCursor'

mysql = MySQL(app)

@app.route('/')
def index():
return render_template('login.html')

@app.route('/login', methods=['POST'])
def login():
username = request.form['username']
password = request.form['password']

cur = mysql.connection.cursor()
cur.execute("SELECT * FROM users WHERE username = %s", (username,))
user = cur.fetchone()
cur.close()

if user:
stored_password = user['password'].encode('utf-8')
if bcrypt.checkpw(password.encode('utf-8'), stored_password):

return jsonify({'redirect_url': url_for('home')})

return jsonify({'message': 'Invalid username or password'})

@app.route('/home')
def home():

return render_template('index.html')

if __name__ == '__main__':
app.run(debug=True)
73 changes: 73 additions & 0 deletions farmfolio resp/farmfolio resp/login/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

body, html {
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, sans-serif;
}

.bg-image {
background: linear-gradient(to bottom, #85D860, #4CAF50);
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}

.container {
width: 300px;
position: absolute;
top: 25%;
left: 40%;
text-align: center;
padding: 20px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 10px;
}

input[type="text"], input[type="password"] {
width: 250px;
padding: 10px;
margin: 10px;
border-radius: 5px;
border: 1px solid #ccc;
font-size: 16px;
}
input:focus {
outline: none;
}

#submit{

width: 100px;
padding: 8px;
margin: 1px;
border-radius: 5px;
border: none;
background-color: #4CAF50;
color: white;
font-size: 15px;
cursor: pointer;

}


a {
color: blue;
text-decoration: none;
}

.altrnativ:hover {
text-decoration: underline;
}

.social-login {
margin-top: 20px;
}

.social-icon {
width: 25px;
margin: 0 5px;
cursor: pointer;
}
32 changes: 32 additions & 0 deletions farmfolio resp/farmfolio resp/login/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="login.css">
</head>
<body>
<div class="bg-image">
<div class="container">
<h2>Login</h2>
<form id="loginForm">
<input type="text" id="username" placeholder="Username"><br>
<input type="password" id="password" placeholder="Password"><br>
<input type="submit" value="submit" id="submit">


</form>
<p><a href="#" id="createAccount" class="altrnativ">Create a new account</a></p>
<p><a href="#" id="forgotPassword" class="altrnativ">Forgot password?</a></p>
<div class="social-login">
<p>Sign up with:</p>
<img src="image\googleLogo1.png" alt="Google" class="social-icon">
<img src="image\fbLogo1.png" alt="Facebook" class="social-icon">
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions farmfolio resp/farmfolio resp/login/newAcc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="container">
<h2>Register</h2>
<form id="registerForm">
<input type="text" id="newUsername" placeholder="New Username"><br>
<input type="password" id="newPassword" placeholder="New Password"><br>
<button type="submit">Register</button>
</form>
</div>
<script src="newAccount.js"></script>
</body>
</html>
Loading