diff --git a/README.md b/README.md index 5c3d5311..96821520 100644 --- a/README.md +++ b/README.md @@ -205,14 +205,16 @@ It is also available on [YouTube](https://www.youtube.com/watch?v=NAZ2VeiN1N8) ## Running the dashboard locally Start the API first (port 8000): -`cd backend` +`cd api` `python main.py` Start the frontend (port 5137): -`cd frontend` +`cd dashboards/dashboard_1` `npm install` `npm run dev` +There is also a steamlit dashboard in `dashboards/dashboard_2` that can be used. + ## Contribution We welcome other models. diff --git a/backend/app/__init__.py b/api/app/__init__.py similarity index 100% rename from backend/app/__init__.py rename to api/app/__init__.py diff --git a/backend/app/api.py b/api/app/api.py similarity index 100% rename from backend/app/api.py rename to api/app/api.py diff --git a/backend/main.py b/api/main.py similarity index 100% rename from backend/main.py rename to api/main.py diff --git a/frontend/.eslintrc.cjs b/dashboards/dashboard_1/.eslintrc.cjs similarity index 100% rename from frontend/.eslintrc.cjs rename to dashboards/dashboard_1/.eslintrc.cjs diff --git a/frontend/.gitignore b/dashboards/dashboard_1/.gitignore similarity index 100% rename from frontend/.gitignore rename to dashboards/dashboard_1/.gitignore diff --git a/frontend/README.md b/dashboards/dashboard_1/README.md similarity index 100% rename from frontend/README.md rename to dashboards/dashboard_1/README.md diff --git a/frontend/components.json b/dashboards/dashboard_1/components.json similarity index 100% rename from frontend/components.json rename to dashboards/dashboard_1/components.json diff --git a/frontend/index.html b/dashboards/dashboard_1/index.html similarity index 100% rename from frontend/index.html rename to dashboards/dashboard_1/index.html diff --git a/frontend/package-lock.json b/dashboards/dashboard_1/package-lock.json similarity index 100% rename from frontend/package-lock.json rename to dashboards/dashboard_1/package-lock.json diff --git a/frontend/package.json b/dashboards/dashboard_1/package.json similarity index 100% rename from frontend/package.json rename to dashboards/dashboard_1/package.json diff --git a/frontend/postcss.config.js b/dashboards/dashboard_1/postcss.config.js similarity index 100% rename from frontend/postcss.config.js rename to dashboards/dashboard_1/postcss.config.js diff --git a/frontend/public/vite.svg b/dashboards/dashboard_1/public/vite.svg similarity index 100% rename from frontend/public/vite.svg rename to dashboards/dashboard_1/public/vite.svg diff --git a/frontend/src/App.tsx b/dashboards/dashboard_1/src/App.tsx similarity index 100% rename from frontend/src/App.tsx rename to dashboards/dashboard_1/src/App.tsx diff --git a/frontend/src/assets/react.svg b/dashboards/dashboard_1/src/assets/react.svg similarity index 100% rename from frontend/src/assets/react.svg rename to dashboards/dashboard_1/src/assets/react.svg diff --git a/frontend/src/components/PVForecastForm.tsx b/dashboards/dashboard_1/src/components/PVForecastForm.tsx similarity index 100% rename from frontend/src/components/PVForecastForm.tsx rename to dashboards/dashboard_1/src/components/PVForecastForm.tsx diff --git a/frontend/src/components/PredicitionChart.tsx b/dashboards/dashboard_1/src/components/PredicitionChart.tsx similarity index 100% rename from frontend/src/components/PredicitionChart.tsx rename to dashboards/dashboard_1/src/components/PredicitionChart.tsx diff --git a/frontend/src/components/PredictionTable.tsx b/dashboards/dashboard_1/src/components/PredictionTable.tsx similarity index 100% rename from frontend/src/components/PredictionTable.tsx rename to dashboards/dashboard_1/src/components/PredictionTable.tsx diff --git a/frontend/src/components/ui/button.tsx b/dashboards/dashboard_1/src/components/ui/button.tsx similarity index 100% rename from frontend/src/components/ui/button.tsx rename to dashboards/dashboard_1/src/components/ui/button.tsx diff --git a/frontend/src/components/ui/calendar.tsx b/dashboards/dashboard_1/src/components/ui/calendar.tsx similarity index 100% rename from frontend/src/components/ui/calendar.tsx rename to dashboards/dashboard_1/src/components/ui/calendar.tsx diff --git a/frontend/src/components/ui/card.tsx b/dashboards/dashboard_1/src/components/ui/card.tsx similarity index 100% rename from frontend/src/components/ui/card.tsx rename to dashboards/dashboard_1/src/components/ui/card.tsx diff --git a/frontend/src/components/ui/chart.tsx b/dashboards/dashboard_1/src/components/ui/chart.tsx similarity index 100% rename from frontend/src/components/ui/chart.tsx rename to dashboards/dashboard_1/src/components/ui/chart.tsx diff --git a/frontend/src/components/ui/form.tsx b/dashboards/dashboard_1/src/components/ui/form.tsx similarity index 100% rename from frontend/src/components/ui/form.tsx rename to dashboards/dashboard_1/src/components/ui/form.tsx diff --git a/frontend/src/components/ui/input.tsx b/dashboards/dashboard_1/src/components/ui/input.tsx similarity index 100% rename from frontend/src/components/ui/input.tsx rename to dashboards/dashboard_1/src/components/ui/input.tsx diff --git a/frontend/src/components/ui/label.tsx b/dashboards/dashboard_1/src/components/ui/label.tsx similarity index 100% rename from frontend/src/components/ui/label.tsx rename to dashboards/dashboard_1/src/components/ui/label.tsx diff --git a/frontend/src/components/ui/popover.tsx b/dashboards/dashboard_1/src/components/ui/popover.tsx similarity index 100% rename from frontend/src/components/ui/popover.tsx rename to dashboards/dashboard_1/src/components/ui/popover.tsx diff --git a/frontend/src/components/ui/separator.tsx b/dashboards/dashboard_1/src/components/ui/separator.tsx similarity index 100% rename from frontend/src/components/ui/separator.tsx rename to dashboards/dashboard_1/src/components/ui/separator.tsx diff --git a/frontend/src/components/ui/table.tsx b/dashboards/dashboard_1/src/components/ui/table.tsx similarity index 100% rename from frontend/src/components/ui/table.tsx rename to dashboards/dashboard_1/src/components/ui/table.tsx diff --git a/frontend/src/index.css b/dashboards/dashboard_1/src/index.css similarity index 100% rename from frontend/src/index.css rename to dashboards/dashboard_1/src/index.css diff --git a/frontend/src/lib/utils.ts b/dashboards/dashboard_1/src/lib/utils.ts similarity index 100% rename from frontend/src/lib/utils.ts rename to dashboards/dashboard_1/src/lib/utils.ts diff --git a/frontend/src/main.tsx b/dashboards/dashboard_1/src/main.tsx similarity index 100% rename from frontend/src/main.tsx rename to dashboards/dashboard_1/src/main.tsx diff --git a/frontend/src/vite-env.d.ts b/dashboards/dashboard_1/src/vite-env.d.ts similarity index 100% rename from frontend/src/vite-env.d.ts rename to dashboards/dashboard_1/src/vite-env.d.ts diff --git a/frontend/tailwind.config.js b/dashboards/dashboard_1/tailwind.config.js similarity index 100% rename from frontend/tailwind.config.js rename to dashboards/dashboard_1/tailwind.config.js diff --git a/frontend/tsconfig.app.json b/dashboards/dashboard_1/tsconfig.app.json similarity index 100% rename from frontend/tsconfig.app.json rename to dashboards/dashboard_1/tsconfig.app.json diff --git a/frontend/tsconfig.json b/dashboards/dashboard_1/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to dashboards/dashboard_1/tsconfig.json diff --git a/frontend/tsconfig.node.json b/dashboards/dashboard_1/tsconfig.node.json similarity index 100% rename from frontend/tsconfig.node.json rename to dashboards/dashboard_1/tsconfig.node.json diff --git a/frontend/vite.config.ts b/dashboards/dashboard_1/vite.config.ts similarity index 100% rename from frontend/vite.config.ts rename to dashboards/dashboard_1/vite.config.ts diff --git a/dashboards/dashboard_2/README.md b/dashboards/dashboard_2/README.md new file mode 100644 index 00000000..91693420 --- /dev/null +++ b/dashboards/dashboard_2/README.md @@ -0,0 +1,72 @@ +# Streamlit Dashboard for Open Source Quartz Solar Forecast + +This Streamlit Dashboard provides an interactive interface for running and visualizing solar forecasts using the [Open Source Quartz Solar Forecast](https://github.com/openclimatefix/Open-Source-Quartz-Solar-Forecast) model developed by [Open Climate Fix](https://openclimatefix.org/). + + +https://github.com/user-attachments/assets/940ca4a7-65a4-40ea-a602-ea0f65e96746 + + +## Features + +- Configure PV site parameters (latitude, longitude, capacity) +- Select inverter type (No Inverter or Enphase) +- Enphase API authentication flow (if applicable) +- Run solar forecast +- Visualize forecast results with interactive charts +- Compare forecasts with and without recent PV data (if applicable) +- Display raw forecast data and provide an option to download it as CSV + +## How to Run + +1. Clone the repository and install all the dependencies in a virtual environment on a Linux System(or WSL): + `pip install -e .` and `pip install -r requirements.txt` + +2. Set up environment variables (if applicable): + +- Create a `.env` file in your root directory +- Add the following variables: + ``` + ENPHASE_CLIENT_ID=your_client_id + ENPHASE_CLIENT_SECRET=your_client_secret + ENPHASE_API_KEY=your_api_key + ENPHASE_SYSTEM_ID=your_system_id + ``` + +3. Navigate to the `dashboards/dashboard_2` directory. + +4. Run the Streamlit app: `streamlit run app.py` + +5. Open your web browser and go to the URL provided by Streamlit (usually `http://localhost:8501`). + +## Using the App + +1. **Configure PV Site:** + +- Use the sidebar to input latitude, longitude, and capacity of the PV site. +- Alternatively, check "Use Default Values" to use pre-set values. + +2. **Select Inverter Type:** + +- Choose between "No Inverter" and "Enphase" from the dropdown menu. + +3. **Enphase Authorization (if applicable):** + +- If you select Enphase, follow the authorization process: + - Click the provided authorization URL + - Grant permissions on the Enphase website + - Copy the redirect URL and paste it back into the app + +4. **Run Forecast:** + +- Click the "Run Forecast" button to generate predictions. + +5. **View Results:** + +- See current power, total forecasted energy, and peak forecasted power. +- Examine the interactive line chart comparing forecasts with and without recent PV data. +- Review the raw forecast data table and optionally download it as CSV for further processing. + +## Additional Information + +- Forecasts are generated for the next 48 hours in 15-minute intervals. +- The app demonstrates the impact of using recent PV data (from Enphase) on forecast accuracy. diff --git a/examples/streamlit_app/app.py b/dashboards/dashboard_2/app.py similarity index 100% rename from examples/streamlit_app/app.py rename to dashboards/dashboard_2/app.py diff --git a/examples/streamlit_app/logo.png b/dashboards/dashboard_2/logo.png similarity index 100% rename from examples/streamlit_app/logo.png rename to dashboards/dashboard_2/logo.png