Skip to content

Conversation

@shawnpetros
Copy link
Contributor

@shawnpetros shawnpetros commented Dec 12, 2025

this is missing the data package details with Athena and whatnot which I'm sure are documented in that repo

#125 address the doc update
#22 backend doc
#23 frontend doc
#72 update repo doc
#73 Batch document issue

Copilot AI review requested due to automatic review settings December 12, 2025 17:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures and significantly improves the WindWatts project documentation by creating a centralized documentation hub with organized guides for different audiences (developers, data scientists, DevOps). The changes transform a monolithic README into a well-organized documentation structure with dedicated guides for quickstart, backend development, frontend development, data science, and deployment.

Key Changes

  • Created a new docs/ directory with 6 comprehensive markdown files covering different aspects of the project
  • Simplified the main README to provide a high-level overview with links to detailed documentation
  • Added a CONTRIBUTING.md guide with clear contribution guidelines and standards
  • Updated component-level READMEs to reference centralized documentation

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
README.md Significantly simplified to provide high-level overview and quick links to detailed documentation
CONTRIBUTING.md New file establishing contribution guidelines, branch naming conventions, and coding standards
docs/README.md New documentation hub with table of contents linking to all documentation sections
docs/01-overview.md New file documenting system architecture, tech stack, and component relationships
docs/02-quickstart.md New comprehensive quickstart guide with Docker and native setup instructions
docs/03-backend.md New backend development guide covering FastAPI setup, database configuration, and testing
docs/04-frontend.md New frontend development guide for React/Vite setup and development workflow
docs/05-data-science.md New data science guide covering dw_tap package, ERA5 data details, and scientific background
docs/06-deployment.md New deployment guide for containerized and production deployments
windwatts-ui/README.md Updated to reference centralized frontend documentation
windwatts-api/README.md Updated to reference centralized backend documentation
.gitignore Added entries to ignore Cursor thoughts directory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

### Build

```shell
docker build -t tap-api:latest .
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The example references 'tap-api' as the image name, but the project is called 'WindWatts'. Consider using a more consistent naming convention like 'windwatts-api' to match the project structure.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +22 to +26
```bash
# Example for installing the wheel manually (check Dockerfile for exact URL/version)
curl -O https://windwatts-era5.s3.us-west-2.amazonaws.com/windwatts_data-1.0.4-py3-none-any.whl
pip install windwatts_data-1.0.4-py3-none-any.whl
```
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The instructions here download and install the windwatts_data wheel directly from an S3 URL using curl and pip install without any integrity verification. If an attacker can modify the S3 object or the URL ever points to a compromised file, developers following these steps could unknowingly execute arbitrary code in their environment. Consider publishing a checksum or signature for the wheel and documenting how to verify it before installation, or distributing the package via a channel that provides built-in integrity verification (e.g., a private PyPI index or signed artifacts).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Collaborator

@RLiNREL RLiNREL left a comment

Choose a reason for hiding this comment

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

Overall, good documentations! It seems some of the outdated files were picked up, such as, dw_tap and api.py. Those contents should be removed and updated to match the current implementations.

README.md Outdated
*Development* is the default mode (run if no flag is specified). In contrast, you can run the endpoint in the *Production* mode using: `python api.py --production` or `python api.py -p` -- this is what is used in the container deployment described above (to see the details, check the end of `Dockerfile`).

To see how these production and development modes are configured, refer to `config.json` and see what `host` and `port` values are specified.
WindWatts is a distributed wind resource assessment tool developed by NREL. It provides processed wind speed data, energy production estimates, and visualizations for locations across the United States.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"developed by NLR (formerly NREL)"

docs/README.md Outdated
2. [Quickstart](02-quickstart.md) - Get the app running in < 15 minutes.
3. [Backend Guide](03-backend.md) - API development.
4. [Frontend Guide](04-frontend.md) - UI development.
5. [Data Science](05-data-science.md) - Core logic and ERA5 data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

similarly, remove the Data Science part

Copy link
Collaborator

Choose a reason for hiding this comment

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

the deployment instruction should be updated as we are moving to docker compose from single docker container for the old app

Copy link
Collaborator

Choose a reason for hiding this comment

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

here is draft for the current set up using docker compose, the docker build command for Flask app is outdated.

# Deployment Guide

## Local Development Deployment

Uses Docker Compose to run all services (API, UI, database, reverse proxy).

### Prerequisites

1. Docker and Docker Compose installed
2. AWS credentials with access to WindWatts data
3. Google Maps API key and Map ID

### Configuration

**Root `.env`:**
```plaintext
WINDWATTS_DATA_URL=<s3-url-for-windwatts-data-package>
AWS_ACCESS_KEY_ID=<your-access-key>
AWS_SECRET_ACCESS_KEY=<your-secret-key>
AWS_SESSION_TOKEN=<your-session-token>
WINDWATTS_DATA_CONFIG_SECRETS_ARN=<your-secrets-arn>

.env.development:

VITE_API_BASE_URL=http://windwatts-proxy:80
VITE_MAP_API_KEY=<your-map-api-key>
VITE_MAP_ID=<your-map-id>

windwatts_data_config.json:

Configure AWS Athena settings and data sources:

{
  "region_name": "us-west-2",
  "output_location": "s3://your-athena-results-bucket/",
  "output_bucket": "your-athena-results-bucket",
  "database": "your-glue-database",
  "athena_workgroup": "your-athena-workgroup",
  "sources": {
    "wtk": {
      "bucket_name": "your-wtk-bucket",
      "athena_table_name": "wtk_table",
      "alt_athena_table_name": "",
      "capabilities": { "avg_types": ["all", "annual", "monthly", "hourly"] }
    },
    "era5": {
      "bucket_name": "your-era5-bucket",
      "athena_table_name": "era5_table",
      "alt_athena_table_name": "",
      "capabilities": { "avg_types": ["all", "annual"] }
    }
  }
}

Deploy

docker compose up --build

Access at http://localhost:5173

Clean up:

docker compose down --volumes --remove-orphans

Production Deployment

Build Individual Services

API:

cd windwatts-api && docker build -t windwatts-api:latest .

UI:

cd windwatts-ui && docker build -t windwatts-ui:latest .

AWS Configuration

  • RDS PostgreSQL: Configure DATABASE_URL for production database
  • Secrets Manager: Store WINDWATTS_DATA_CONFIG_SECRET_ARN with data source configuration
  • Environment Variables: Set production AWS credentials and endpoints
  • Load Balancer: Route traffic to containerized services

API runs on port 8000 using Gunicorn with Uvicorn workers.


Or using the wrapper:
```bash
python api.py -d
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't have api.py any more.

### 1. Clone the Repository

```shell
git clone https://github.com/NREL/dw-tap-api.git
Copy link
Collaborator

Choose a reason for hiding this comment

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

the repo name is changed to windwatts from dw-tap-api

Create a `.env` file in the root:

```plaintext
WINDWATTS_DATA_URL=https://windwatts-era5.s3.us-west-2.amazonaws.com/
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sameersk2k this data package is currently an internal package, is it? I am not sure whether we should include the actual URL here? but on the other hand, can others make this app running without the data package (should we release the .whl file publicly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should probably release the data package honestly, since it is the bulk of the app (the data part), or, build this out as an sdk client that connects to NLR's deployed Athena/S3 data...it's a product decision

WindWatts is a monorepo consisting of:
- **Frontend**: React application (`windwatts-ui`)
- **Backend**: Python FastAPI application (`windwatts-api`)
- **Core Library**: Data processing logic (`dw_tap`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

dw_tap is not in use, part of the related functionalities is integrated to the backend utilities/core functions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 19, 2025

@shawnpetros I've opened a new pull request, #182, to work on those changes. Once the pull request is ready, I'll request review from you.

shawnpetros and others added 7 commits December 19, 2025 09:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 23, 2025

@shawnpetros I've opened a new pull request, #185, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 49 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to +13
.PHONY: openapi
openapi:
. .venv/bin/activate; PYTHONPATH=. SKIP_DATA_INIT=1 python scripts/generate_openapi.py

Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The openapi target in the Makefile references scripts/generate_openapi.py, which was deleted in this PR. This will cause the make openapi command to fail. Either remove this target from the Makefile or restore the script.

Suggested change
.PHONY: openapi
openapi:
. .venv/bin/activate; PYTHONPATH=. SKIP_DATA_INIT=1 python scripts/generate_openapi.py

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 21
### Setup

```bash
conda env create -f dw_tap/environment.yml
conda activate dw_tap
cd dw_tap
python setup.py install
```
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The documentation references a dw_tap directory and package, but based on the PR description and context, this appears to be outdated naming. The codebase has been renamed to windwatts. Update references from dw_tap to the correct package/directory name.

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +89
# def plot(self):
# fig = px.line(
# y=self.powercurve_intrp(self.interp_x),
# x=self.interp_x,
# labels={"x": "Windspeed (m/s)", "y": "Power (kW)"},
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

This comment appears to contain commented-out code.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@RLiNREL RLiNREL left a comment

Choose a reason for hiding this comment

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

The docs/05-deployment.md need to be updated, a draft was suggested.

- **UI**: http://localhost:5173/
- **API**: http://localhost:8080

## Option 2: Native Setup (Without Docker)
Copy link
Collaborator

Choose a reason for hiding this comment

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

the native setup is not working anymore as the api.py for Flask app was removed

Copy link
Collaborator

Choose a reason for hiding this comment

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

here is draft for the current set up using docker compose, the docker build command for Flask app is outdated.

# Deployment Guide

## Local Development Deployment

Uses Docker Compose to run all services (API, UI, database, reverse proxy).

### Prerequisites

1. Docker and Docker Compose installed
2. AWS credentials with access to WindWatts data
3. Google Maps API key and Map ID

### Configuration

**Root `.env`:**
```plaintext
WINDWATTS_DATA_URL=<s3-url-for-windwatts-data-package>
AWS_ACCESS_KEY_ID=<your-access-key>
AWS_SECRET_ACCESS_KEY=<your-secret-key>
AWS_SESSION_TOKEN=<your-session-token>
WINDWATTS_DATA_CONFIG_SECRETS_ARN=<your-secrets-arn>

.env.development:

VITE_API_BASE_URL=http://windwatts-proxy:80
VITE_MAP_API_KEY=<your-map-api-key>
VITE_MAP_ID=<your-map-id>

windwatts_data_config.json:

Configure AWS Athena settings and data sources:

{
  "region_name": "us-west-2",
  "output_location": "s3://your-athena-results-bucket/",
  "output_bucket": "your-athena-results-bucket",
  "database": "your-glue-database",
  "athena_workgroup": "your-athena-workgroup",
  "sources": {
    "wtk": {
      "bucket_name": "your-wtk-bucket",
      "athena_table_name": "wtk_table",
      "alt_athena_table_name": "",
      "capabilities": { "avg_types": ["all", "annual", "monthly", "hourly"] }
    },
    "era5": {
      "bucket_name": "your-era5-bucket",
      "athena_table_name": "era5_table",
      "alt_athena_table_name": "",
      "capabilities": { "avg_types": ["all", "annual"] }
    }
  }
}

Deploy

docker compose up --build

Access at http://localhost:5173

Clean up:

docker compose down --volumes --remove-orphans

Production Deployment

Build Individual Services

API:

cd windwatts-api && docker build -t windwatts-api:latest .

UI:

cd windwatts-ui && docker build -t windwatts-ui:latest .

AWS Configuration

  • RDS PostgreSQL: Configure DATABASE_URL for production database
  • Secrets Manager: Store WINDWATTS_DATA_CONFIG_SECRET_ARN with data source configuration
  • Environment Variables: Set production AWS credentials and endpoints
  • Load Balancer: Route traffic to containerized services

API runs on port 8000 using Gunicorn with Uvicorn workers.

shawnpetros and others added 4 commits December 29, 2025 08:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 'feat/docs' of github.com:NREL/windwatts:
  Apply suggestion from @Copilot
Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably shouldn't delete this file...not sure why the linter did this

RLiNREL
RLiNREL previously approved these changes Dec 31, 2025
@RLiNREL RLiNREL merged commit 97ce051 into develop Dec 31, 2025
@RLiNREL RLiNREL deleted the feat/docs branch December 31, 2025 21:27
@RLiNREL RLiNREL mentioned this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants