Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
16620ca
ooof...lot of changes here, whole new app even!
shawnpetros Oct 2, 2025
b45aa9d
fix deps
shawnpetros Oct 3, 2025
4d6230b
cleanup
shawnpetros Oct 28, 2025
02e6234
feat(ssr): scaffold Next.js App Router app with MUI SSR wiring, clien…
shawnpetros Oct 28, 2025
6d9a970
feat(ssr): add Next.js SSR app scaffolding with MUI SSR, providers, d…
shawnpetros Oct 28, 2025
1b5b7d7
feat(ssr): add Settings context/provider, wire into app providers; ad…
shawnpetros Oct 28, 2025
616d870
chore(ssr): route API calls through in-network nginx (http://nginx/ap…
shawnpetros Oct 28, 2025
4d7b6c4
feat(ssr): add centralized API helper; refactor health/denver; add /w…
shawnpetros Oct 28, 2025
1735b7d
first phase
shawnpetros Oct 28, 2025
957fea6
feat(ssr): consolidate to single main route reading searchParams; der…
shawnpetros Oct 28, 2025
9ad6b82
fix(ssr): request energy production with time_period=all to match API…
shawnpetros Oct 28, 2025
48f6cc7
feat(ssr): normalize and preserve full query params; build URL with a…
shawnpetros Oct 28, 2025
6847327
chore(eslint): disallow spaces in single-line blocks via block-spacin…
shawnpetros Oct 28, 2025
3de61f5
run eslint and prettier
shawnpetros Oct 28, 2025
a9e76b5
feat(ssr): consolidate to single route; add URL-bound Controls and Wi…
shawnpetros Oct 28, 2025
fcf67f9
feat(ssr): add client-only Google Map synced to URL; split layout wit…
shawnpetros Oct 28, 2025
4f9a020
chore(dev): disable Remix POC in compose; serve Next SSR on 5174; pas…
shawnpetros Oct 28, 2025
1cba7d3
feat(ui): add route-level loading UI and inline pending state in resu…
shawnpetros Oct 28, 2025
0d025df
feat(ui): add SummaryBar; fetch available power curves server-side an…
shawnpetros Oct 28, 2025
f352eba
feat(ui): begin port of original results UI; add SummaryBar, API-driv…
shawnpetros Oct 28, 2025
27e3d82
feat(ui): add app header; port wind speed card, production details ta…
shawnpetros Oct 28, 2025
64913ff
feat(ui): add Google Places search bar; update layout to include sear…
shawnpetros Oct 28, 2025
dac9e43
feat(seo/assets): add manifest and icon; expand metadata; centralize …
shawnpetros Oct 30, 2025
c1f9e6c
feat(ui): port ProductionDataTable and align results pane with origin…
shawnpetros Oct 30, 2025
9d7eaed
feat(ui): port original header bar (AppBar color, title link, NREL logo)
shawnpetros Oct 30, 2025
a6441e3
chore(assets): add NREL reversed logo to public and wire in header
shawnpetros Oct 31, 2025
511fd9a
settings migrated and hooked up
shawnpetros Oct 31, 2025
8d6d9cb
feat(ui): port original desktop sidebar and cards (SSR-adapted), pres…
shawnpetros Nov 13, 2025
1ea0914
stopping point
shawnpetros Dec 12, 2025
244e2e7
docs
shawnpetros Dec 23, 2025
d64b5b4
updated docs
shawnpetros Dec 29, 2025
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
1,778 changes: 1,778 additions & 0 deletions .cursor/plans/WINDWATTS_SSR_MIGRATION_SPEC.plan.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ windwatts-ui/env-vars.sh
windwatts-api/env-vars.sh
node_modules/
update-env-credentials.sh
manage-aws-parameters.sh
manage-aws-parameters.sh
.next/
170 changes: 170 additions & 0 deletions REMIX_MIGRATION_ESTIMATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# WindWatts Remix SSR Migration - Timeline Estimate

## 🎯 Executive Summary

**Total Estimated Time: 7-10 business days**
**Confidence Level: High** (POC validates 90% of technical risks)

---

## ✅ **What's Already Done** (POC Complete - 2 days)

- ✅ Remix app skeleton with Docker integration
- ✅ Server-side data fetching & API integration
- ✅ Google Maps client-side rendering (SSR-safe)
- ✅ URL parameter handling ("launch in context")
- ✅ Loss assumption calculations (matching original)
- ✅ Basic layout & styling patterns established
- ✅ Parallel testing environment (ports 5173/5174)

---

## 📋 **Remaining Work Breakdown**

### **Phase 1: Core Components Migration** (2-3 days)

**What:** Migrate all UI components with proper SSR patterns

- Search bar with Google Places autocomplete (client-only boundary)
- Settings modal with all controls (hub height, model, power curve, units, loss assumption)
- Results cards (wind speed, wind resource, production with charts)
- Production data table with yearly/monthly breakdowns
- Out-of-bounds warning component
- Loading states & error boundaries

**Approach:** AI-assisted component conversion, existing logic mostly reusable
**Testing:** 4 hours for cross-browser validation

---

### **Phase 2: Mobile Responsive Layout** (1.5-2 days)

**What:** Implement mobile-specific components

- Mobile bottom sheet drawer
- Touch-optimized map interactions
- Mobile search bar overlay
- Responsive breakpoint handling (already in POC)
- Mobile-specific settings modal

**Approach:** Adapt existing mobile components, Remix handles SSR automatically
**Testing:** 3 hours for device testing (iOS/Android/tablets)

---

### **Phase 3: State Management & Data Fetching** (1-1.5 days)

**What:** Replace client-side state with Remix patterns

- Convert `useLocalStorage` to cookie-based preferences
- Migrate SWR hooks to Remix loaders/actions
- Implement optimistic UI updates
- Handle bias correction toggle & data refetch
- Units conversion (metric/imperial)

**Approach:** Leverage Remix's built-in data patterns, minimal custom code
**Testing:** 2 hours for state persistence scenarios

---

### **Phase 4: Polish & Production Readiness** (1-1.5 days)

**What:** Production-grade finishing

- NREL branding footer integration
- Accessibility audit (WCAG 2.1 AA)
- SEO meta tags & Open Graph tags
- Analytics integration (if needed)
- Error tracking setup
- Performance optimization (code splitting already handled by Remix)

**Approach:** Systematic checklist, automated testing tools
**Testing:** 3 hours for accessibility & performance audits

---

### **Phase 5: Testing & QA** (1-2 days)

**What:** Comprehensive validation

- Automated E2E tests for critical paths (Playwright)
- Manual QA across all features
- Cross-browser testing (Chrome, Safari, Firefox, Edge)
- Mobile device testing
- API failure scenarios
- Out-of-bounds edge cases
- Side-by-side comparison with original UI

**Approach:** Parallel testing against original (both apps running)
**Deliverable:** Test report with screenshots

---

## ⚡ **Risk Mitigation**

- **Risk:** Google Maps SSR issues → ✅ Already solved in POC
- **Risk:** Complex state management → ✅ Remix patterns are simpler than current setup
- **Risk:** Mobile UX degradation → Mitigation: Early device testing in Phase 2
- **Risk:** API integration issues → ✅ Already validated in POC with real backend

---

## 🚀 **Why This Timeline is Realistic**

1. **POC validates all major technical risks** (SSR, maps, API, URL params)
2. **90% AI-driven implementation** with proven patterns from POC
3. **Existing components are well-structured** and easy to adapt
4. **Remix simplifies state/routing** (less code than current React Router + SWR setup)
5. **Parallel testing environment** allows continuous validation

---

## 📦 **Deliverables**

- ✅ Fully functional Remix SSR app (feature parity with original)
- ✅ Docker deployment (production-ready)
- ✅ Migration documentation
- ✅ Test coverage report
- ✅ Performance comparison report
- ✅ Rollback plan (original app stays intact)

---

## 💰 **Value Proposition**

- **Better SEO:** Server-rendered pages = better search rankings
- **Faster initial load:** Streamed HTML vs. client-only rendering
- **Better UX:** Progressive enhancement, works without JS
- **Simpler codebase:** ~30% less code (Remix handles routing, data, forms)
- **Modern foundation:** Future-proof architecture
- **"Launch in context" URLs:** Shareable pre-configured links (already working!)

---

## 📅 **Proposed Schedule**

```
Week 1 (Days 1-5):
Mon-Wed: Phase 1 (Core Components)
Thu-Fri: Phase 2 (Mobile)

Week 2 (Days 6-10):
Mon: Phase 3 (State Management)
Tue: Phase 4 (Polish)
Wed-Thu: Phase 5 (Testing)
Fri: Buffer/Documentation
```

---

## 🎯 **Success Criteria**

✅ Feature parity with original UI
✅ All tests passing (E2E + manual)
✅ Performance metrics >= original
✅ Accessibility score 90+
✅ Zero critical bugs in production rollout

---

**Bottom Line:** With the POC complete and technical risks validated, we can confidently deliver a production-ready Remix SSR app in **7-10 business days** with AI-assisted development and systematic testing.
10 changes: 10 additions & 0 deletions check-format.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/bin/bash
set -e

echo "Checking format for windwatts-ui..."
cd windwatts-ui

echo "Running ESLint..."
yarn lint --fix

echo "Running Prettier check..."
yarn format -w

echo "Checking format for windwatts-ui-ssr..."
cd ../windwatts-ui-ssr

echo "Running ESLint..."
yarn lint --fix

echo "Running Prettier check..."
yarn format -w
39 changes: 38 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,41 @@ services:
volumes:
- ./windwatts-ui:/app
- node_modules:/app/node_modules
depends_on:
- windwatts-api

# windwatts-ssr:
# build:
# context: ./windwatts-ssr
# dockerfile: Dockerfile.dev
# container_name: windwatts-ssr
# env_file:
# - ./windwatts-ssr/.env.development
# ports:
# - "5174:5174"
# volumes:
# - ./windwatts-ssr:/app
# - ssr_node_modules:/app/node_modules
# depends_on:
# - windwatts-api

windwatts-ui-ssr:
build:
context: ./windwatts-ui-ssr
dockerfile: Dockerfile.dev
args:
WINDWATTS_API_BASE: http://nginx/api
container_name: windwatts-ui-ssr
env_file:
- ./windwatts-ui-ssr/.env.development
ports:
- "5174:5174"
volumes:
- ./windwatts-ui-ssr:/app
- ui_ssr_node_modules:/app/node_modules
depends_on:
- windwatts-api
- nginx

nginx:
image: nginx:alpine
Expand All @@ -57,4 +92,6 @@ services:

volumes:
node_modules:
postgres_data:
postgres_data:
ssr_node_modules:
ui_ssr_node_modules:
Loading