Skip to content

ShruAgarwal/Sharkbite

Repository files navigation

🦈 Sharkbite - Clean Energy Finance Engine

Take a bite out of high electric bills!

βš™ Setup and Running the Application

Follow these steps to get the Sharkbite MVP running on your local machine!

⚑ Prerequisites

  • Git installed on your system.
  • Miniconda or Anaconda installed on your system.

1. Clone the Repository

Open your git bash and run the following command to clone the project files:

git clone https://github.com/ShruAgarwal/Sharkbite.git

2. Create and Activate Conda Environment

It is generally recommended to use a Conda environment so as to manage project dependencies and ensure compatibility.

  • Open up the Conda terminal and create a new Conda environment named sharkbite_env (or your preferred name) with Python 3.11 (within the main repo):
conda create -n sharkbite_env python=3.11
  • Activate the newly created environment:
conda activate sharkbite_env

3. Install Dependencies

The necessary Python packages are listed in the requirements.txt file. Install them using pip:

pip install -r requirements.txt

4. Configure API Keys and Secrets

πŸ“Œ Replace the placeholder key values with your actual credentials within the secrets.toml file below as follows:

  # .streamlit/secrets.toml
  NREL_API_KEY = "YOUR_API_KEY_HERE"

  # AWS Credentials for accessing Amazon Bedrock model are required to power the AI features.
  AWS_ACCESS_KEY_ID = "YOUR_AWS_ACCESS_KEY_ID_HERE"
  AWS_SECRET_ACCESS_KEY = "YOUR_AWS_SECRET_ACCESS_KEY_HERE"
  AWS_REGION = "us-west-2"  # e.g., Use the region where you have LLM model access -- us-east-1, us-west-1

Do not commit this file with your actual key to a public repository.

5. Run the Streamlit App

Once the environment is set up and the API key is configured, run the following command in your terminal:

streamlit run sharkbite_app.py

This will start the Streamlit development server, and the application should open automatically in your default web browser. If not, the terminal will provide a local URL: http://localhost:8501 that you can open manually.

🚩 App Flowchart

The flowchart (Mermaid) shows how a user is guided from a simple project idea to a complete, compliant, and investor-ready financial package, with integrated backend processes and optional AI analysis features at each key step.

Sharkbite Mermaid Diagram

🧰 Tech Stack

Streamlit Pandas NumPy Matplotlib Plotly Bedrock fpdf2 Pytest

πŸ“ Project Structure

Sharkbite/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── main.yml                 # GitHub CI/CD Actions
β”œβ”€β”€ .streamlit/
β”‚   └── config.toml                  # Main App Theme
β”‚   └── secrets.toml                 # API keys and other secrets
β”œβ”€β”€ assets/
β”‚   └── custom_style.css             # Custom CSS file
β”‚   └── logo.png                     # App logo
β”œβ”€β”€ static/
β”‚   └── BebasNeue-Regular.ttf        # Custom font family for headers in the app
β”œβ”€β”€ sharkbite_engine/                # Core logic and utilities
β”‚   β”œβ”€β”€ solar_calculator_logic.py    # Calculation functions for sizing, dispatch, and simplified financials
β”‚   └── incentive_definitions.py     # Structured definitions for all grant and incentive programs
β”‚   └── claude_service.py            # Manages all interactions with the Claude LLM Model on AWS Bedrock
β”‚   β”œβ”€β”€ pdf_generator.py             # Logic for creating the final PDF report
β”‚   └── ui_login_screen.py           # Streamlit main login screen function
β”‚   └── ui_unified_intake_screen.py  # Streamlit screen 1 rendering functions
β”‚   └── ui_calculator_screen.py      # Streamlit screen 2 rendering functions
β”‚   └── ui_ppa_analyzer_screen.py    # Renders the optional PPA vs. Ownership analysis screen for homeowners
β”‚   └── ui_reap_flow_screens.py      # Streamlit screens 3-7 rendering functions
β”‚   └── utils.py                     # Contains shared constants, helper functions, and the final calculator
β”œβ”€β”€ tests/                           # Automated tests for the application
β”‚   β”œβ”€β”€ test_e2e_ppa_flow.py                 # E2E test for conditional PPA button rendering
β”‚   β”œβ”€β”€ test_integration_claude_service.py   # Integration tests for AI service functions
β”‚   β”œβ”€β”€ test_login.py                        # Test for the login functionality
β”‚   β”œβ”€β”€ test_unit_calculator_logic.py        # Unit tests for core financial & dispatch logic
β”‚   └── test_unit_utils.py                   # Unit tests for helper functions (REAP, etc.)
β”œβ”€β”€ sharkbite_mvp v1.0/              # Older App Version
β”œβ”€β”€ sharkbite_app.py                 # Streamlit App
β”œβ”€β”€ requirements.txt                 # Project dependencies
β”œβ”€β”€ .gitignore                       # Files/dependencies to ignore
└── README.md                        # About the project & general instructions

About

🦈 Take a bite out of high electric bills!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published