Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
68 changes: 39 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,68 @@
<img width="3188" height="1202" alt="frame (3)" src="https://github.com/user-attachments/assets/517ad8e9-ad22-457d-9538-a9e62d137cd7" />


# [Project Name] 🎯
# [Oru Vazha Calculation!] 🎯


## Basic Details
### Team Name: [Name]
### Team Name: techNOLOGIC


### Team Members
- Team Lead: [Name] - [College]
- Member 2: [Name] - [College]
- Member 3: [Name] - [College]
- Team Lead: Sofiya B - College of Engineering, Attingal
- Member 2: Niranjan S - College of Engineering, Attingal

### Project Description
[2-3 lines about what your project does]
Our parents always say "Oru vaazha vechal mathi aayirunnu.." We usually laugh and ignore it..But what if it was another timeline? What if our parents planted a vaazha instead.? We took that question seriously and worked for the solution..


### The Problem (that doesn't exist)
[What ridiculous problem are you solving?]
-Many of us often reflect on life choices and wonder, “What if things were different?”.
In a lighthearted context, we questioned: What if parents invested in something simple and sustainable, like planting a plantain tree on the day their child was born?
How much profit could that decision have generated today?
=======

### The Solution (that nobody asked for)
[How are you solving it? Keep it fun!]
-"Born or Grown...what's more profitable?"
Oru vazha is a fun web app that humorously estimates how much profit your parents could have earned if they had planted a plaintain tree on the day you born.Our "oru vazha calculation" is an interactive and humorous web application that:

Collects user details (Name, Date of Birth, Place, and Tea/Coffee preference).

Simulates analysis with witty loading messages (“Regressing… Regretting… Questioning life choices…”).

Delivers a fun, nostalgic profit estimation of what a single plantain tree could have earned.


This solution turns a simple “what if” scenario into an engaging experience that blends humor, user interaction, and awareness of long-term investments and sustainability.

## Technical Details
### Technologies/Components Used
For Software:
- [Languages used]
- [Frameworks used]
- [Libraries used]
- [Tools used]
- Python,HTML
- Flask,CORS
- pandas

For Hardware:
- [List main components]
- [List specifications]
- [List tools required]
NIL

### Implementation
For Software:
For Software:VS code,GitHub
# Installation
[commands]
-CORS
-pip

# Run
[commands]
-website hosting

### Project Documentation
For Software:

# Screenshots (Add at least 3)
![Screenshot1](Add screenshot 1 here with proper name)
*Add caption explaining what this shows*
<img src="Screenshot 2025-08-02 160801.png" />

![Screenshot2](Add screenshot 2 here with proper name)
*Add caption explaining what this shows*
<img src="Screenshot 2025-08-02 163913.png">

![Screenshot3](Add screenshot 3 here with proper name)
*Add caption explaining what this shows*
<img src="Screenshot 2025-08-02 164959.png">

# Diagrams
![Workflow](Add your workflow/architecture diagram here)
Expand All @@ -81,16 +89,18 @@ For Hardware:

### Project Demo
# Video
[Add your demo video link here]
*Explain what the video demonstrates*
<video controls>
<source src="Recording 2025-08-02 163504.mp4" type="video/mp4">
</video>



# Additional Demos
[Add any extra demo materials/links]

## Team Contributions
- [Name 1]: [Specific contributions]
- [Name 2]: [Specific contributions]
- [Name 3]: [Specific contributions]
- [Sofiya B]: [Frontend,Documentation,Motivation]
- [Niranjan S]: [backend,Project Idea,data collection]

---
Made with ❤️ at TinkerHub Useless Projects
Expand Down
Binary file added Recording 2025-08-02 163504.mp4
Binary file not shown.
Binary file added Screenshot 2025-08-02 160801.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 Screenshot 2025-08-02 163913.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 Screenshot 2025-08-02 164959.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions Simulation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import pandas as pd
from datetime import datetime, timedelta

SAPLING_COST = 50
FERTILIZER_COST_PER_KG = 0.5
CYCLE_MONTHS = 12

# Load your data once
DATA = pd.read_csv('C:/Users/Niranjan S/Useless Projects/Data Models/banana_growth_kerala_updated.csv')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace hardcoded file path with configurable path.

Same issue as in simulation2.py - hardcoded absolute paths make the code non-portable.

-DATA = pd.read_csv('C:/Users/Niranjan S/Useless Projects/Data Models/banana_growth_kerala_updated.csv')
+import os
+
+DATA_DIR = os.getenv('DATA_DIR', 'data')
+DATA = pd.read_csv(os.path.join(DATA_DIR, 'banana_growth_kerala_updated.csv'))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DATA = pd.read_csv('C:/Users/Niranjan S/Useless Projects/Data Models/banana_growth_kerala_updated.csv')
import os
DATA_DIR = os.getenv('DATA_DIR', 'data')
DATA = pd.read_csv(os.path.join(DATA_DIR, 'banana_growth_kerala_updated.csv'))
🤖 Prompt for AI Agents
In Simulation.py at line 9, the file path for reading the CSV is hardcoded as an
absolute path, which reduces portability. Modify the code to accept the file
path as a configurable parameter, such as a function argument, environment
variable, or configuration file entry, instead of hardcoding it. This will allow
the path to be set dynamically depending on the environment where the code runs.


def simulate_growth(start_date_str):
current_date = datetime.today()
planting_date = datetime.strptime(start_date_str, "%Y-%m-%d")

current_trees = 1
total_profit = 0
history = []

date = planting_date
while date <= current_date:
year = date.year
month = date.month

row = DATA[(DATA["Year"] == year) & (DATA["Month"] == month)]
if row.empty:
break

row = row.iloc[0]
yield_per_tree = row["Yield_per_Tree_kg"]
market_price = row["Market_Price_per_kg"]
fertilizer_kg = row["Fertilizer_Used_kg"]
suckers_per_tree = row["Suckers_per_Tree"]

income = current_trees * yield_per_tree * market_price
fertilizer_cost = fertilizer_kg * current_trees * FERTILIZER_COST_PER_KG
profit = income - fertilizer_cost

suckers_generated = int(current_trees * suckers_per_tree)
saplings_from_profit = int(profit // SAPLING_COST)

new_trees = suckers_generated + saplings_from_profit
total_profit += profit

history.append({
"Cycle": date.strftime("%Y-%m"),
"Trees": current_trees,
"Income": round(income),
"Profit": round(profit),
"Total_Profit": round(total_profit),
"New_Trees": new_trees
})

current_trees = new_trees
date += timedelta(days=30 * CYCLE_MONTHS)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use accurate date arithmetic.

Same issue as simulation2.py - inaccurate month calculation.

-        date += timedelta(days=30 * CYCLE_MONTHS)
+        # Use proper month arithmetic
+        from dateutil.relativedelta import relativedelta
+        date += relativedelta(months=1)

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In Simulation.py at line 54, the current date arithmetic adds 30 days multiplied
by CYCLE_MONTHS, which inaccurately represents months. Replace this with a more
precise method to add months to the date, such as using a date utility or
library function that correctly handles varying month lengths and leap years.


return {
"profit": round(total_profit),
"history": history
}

Binary file added __pycache__/Simulation.cpython-312.pyc
Binary file not shown.
Binary file added __pycache__/simulation2.cpython-312.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
from Simulation import simulate_growth
import traceback # Add this

app = Flask(__name__)
CORS(app)

@app.route("/")
def home():
return "✅ Banana Simulation API is running. Use /simulate?date=YYYY-MM-DD"

@app.route("/simulate", methods=["GET"])
def simulate_route():
start_date = request.args.get('date')
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400

Comment on lines +16 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add the same input validation as in app2.py.

Consider adding date format validation for consistency with app2.py.

 def simulate():
     start_date = request.args.get('date')
     if not start_date:
         return jsonify({"error": "Missing date parameter"}), 400
+    
+    try:
+        from datetime import datetime
+        datetime.strptime(start_date, "%Y-%m-%d")
+    except ValueError:
+        return jsonify({"error": "Invalid date format. Use YYYY-MM-DD"}), 400
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400
def simulate():
start_date = request.args.get('date')
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400
try:
from datetime import datetime
datetime.strptime(start_date, "%Y-%m-%d")
except ValueError:
return jsonify({"error": "Invalid date format. Use YYYY-MM-DD"}), 400
# …rest of simulate()…
🤖 Prompt for AI Agents
In app.py around lines 15 to 17, the code checks for the presence of start_date
but lacks validation for the date format. To fix this, add input validation that
verifies the start_date matches the expected date format, similar to the
validation implemented in app2.py. This ensures consistent handling of date
inputs and prevents invalid date formats from proceeding.

try:
result = simulate_growth(start_date)
return jsonify(result)
except Exception as e:
traceback.print_exc() # 🔍 This shows the actual error in the console
return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5000)

27 changes: 27 additions & 0 deletions app2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
from simulation2 import simulate_growth
import traceback

app = Flask(__name__)
CORS(app)

@app.route("/")
def home():
return "✅ Banana & Child Simulation API is running. Use /simulate?date=YYYY-MM-DD"

@app.route("/simulate", methods=["GET"])
def simulate_route():
start_date = request.args.get('date')
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400
Comment on lines +15 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add input validation for date parameter.

Currently only checks if the date parameter exists. Consider validating the date format to provide better error messages.

 def simulate_route():
     start_date = request.args.get('date')
     if not start_date:
         return jsonify({"error": "Missing date parameter"}), 400
+    
+    # Validate date format
+    try:
+        datetime.strptime(start_date, "%Y-%m-%d")
+    except ValueError:
+        return jsonify({"error": "Invalid date format. Use YYYY-MM-DD"}), 400
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
start_date = request.args.get('date')
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400
def simulate_route():
start_date = request.args.get('date')
if not start_date:
return jsonify({"error": "Missing date parameter"}), 400
# Validate date format
try:
datetime.strptime(start_date, "%Y-%m-%d")
except ValueError:
return jsonify({"error": "Invalid date format. Use YYYY-MM-DD"}), 400
# …rest of simulate_route…
🤖 Prompt for AI Agents
In app2.py around lines 15 to 17, the code only checks for the presence of the
'date' parameter but does not validate its format. Add validation to ensure the
'date' parameter matches the expected date format (e.g., YYYY-MM-DD). If the
format is invalid, return a clear error message with a 400 status code. Use a
date parsing method or regex to validate the format before proceeding.


try:
result = simulate_growth(start_date)
return jsonify(result)
except Exception as e:
traceback.print_exc()
return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5000)
2 changes: 2 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[LocalizedFileNames]
Screenshot 2025-08-02 164959.png=@Screenshot 2025-08-02 164959,0
Loading