Sunscore - See Live


What it does?
The tool takes in an address and solar asset information to provide potential energy output for the asset.
Annual Outputs
- Annual AC system output. (kWhac)
- Annual solar radiation values. (kWh/m2/day)
- The ratio of the system’s predicted electrical output in the first year of operation to the nameplate output, which is equivalent to the quantity of energy the system would generate if it operated at its nameplate capacity for every hour of the year. (AC-to-DC)
Monthly Outputs
- Monthly plane of array irradiance values. (kWh/m2)
- Monthly AC system output. (kWhac)
- Monthly solar radiation values. (kWh/m2/day)
- Monthly DC system output. (kWhdc)
How it’s built
We rely on NREL (National Renewable & Energy Laboratory) and their apis to get the solar output data. We use Google’s Geolocation API to convert an address into latitude & longitude values.
The application is built using RedwoodJS. Redwood is a full-stack React Meta Framework stitching together Typescript & React, Prisma, & Graphql to build robust full-stack web apps.
The creation of assets and generation of reports is hidden behind simple authentication that comes out of the box with Redwood.
The fields describing each asset as well as the output is stored in a Postgres database.
The app is running in a docker container on a vps and the database is running in a separate container.
The containers are built and deployed using Caprover (read more about Caprover and how I am using it here).
Hard Parts/What I Learned
Graphql - Redwood relies on some code gen to generate sdl & mutation mapping files based on our Prisma models. While it can speed up development - making tweaks in functionality (especially looping in our data coming from the api) can required re-generating or updating the auto-generated type definition files.
Docker - Redwood was initially geared towards JamStack development so it’s had to adapt to adopt Docker deployments effectively. Caprover also doesn’t support docker-compose files out of the box. So getting the container to run both the web and api sides from a single Dockerfile as well as connect the separate db container gave me a lot of cool experience getting Docker going on a VPS.