Challenge Overview

Many residential solar owners have small, undetected maintenance problems that are leading to massive downtime for their solar panels.

Using classification algorithms that detect different types of problems, Solar Doctor provides an automated alert to customers whenever there's a problem. We also provide a detailed description of the maintenance needed and offer a referral service.

Solar Doctor customers opt-in to give Solar Doctor access to their Enphase inverters through the Enphase API. Solar Doctor runs a nightly job to grab the latest solar production data, check for problems indicated by the latest data, and send automated HTML email alerts when a problem is detected.

The goal of this challenge is to build a web application that allow customers to register new account, connect their Enphase accounts, pull their Enphase data, and store it in database.

Challenge Requirements

You will address the following in this challenge :

UI Requirements

We don’t have a UI prototype or a design, you will build simple website UI :

  • - Use default bootstrap UI theme for the look and feel.

  • - The UI should look good.

  • - Use AngularJS as frontend JS framework.

User Model

  • - User model will have following fields:

    • - Email

    • - Password (Hashed and salted)

    • - Date of registration

    • - Ephase User ID

Required Pages

  • - Landing Page

    • - It will contain a login form, user logins using a valid email and password.

    • - Forgot password link should be available in the page.

      • - Clicking the link will flip the form to show Forgot password form

      • - Form will require a valid email address.

      • - On successful form submission, the form will flip to login page, and message appear asking user to check their email for reset password link.

    • - Register link should be available in the page.

      • - Clicking the link will flip the form to show registration form

      • - The form will ask for valid email address and password.

      • - On successful registration, the form will flip to show login form.

    • - On successful login  the user will be redirected to dashboard page.

  • - Dashboard Page

    • - Page will contain a welcome message.

    • - Page will display Enphase User Id if connected, otherwise, it should display “Connect Enphase” button.

    • - When clicking on “Connect Enphase”

      • - It will take user to Enphase authorization page to authorize user.

      • - On successful authorization the page should display a successful message, and the Enphase User Id

Backend Functionality

Required backend :

  • - You will create two database tables:

    • - EnphaseEnergyLifeTime :

      • - System id

      • - User Id (corresponds to User model)

      • - Start Date

      • - Last Update Date

    • - EnphaseEnergyLifeTimeReadings

      • - EnphaseEnergyLifeTimeId (Reference EnphaseEnergyLifeTime table)

      • - Reading_Date

      • - Porduction_enwh

      • - Production_unit (daily, hourly) : in this challenge it will be daily always but we need this for future implementation.

  • - User controller that handles login, register, forgot password, and reset password functionality.

    • - For sending emails use you can use SendGrid, Mailgun, or Mandrill, etc.

  • - Enphase controller that handles the following:

    • - Connecting user Enphase account.

      • - Refer to this page for Authorizing user a Web Application.

      • - You will set up your own account, and use demo user for testing purpose.

      • - Enphase app ID, and authorization url should be configurable.

      • - On successful user connection call RefreshUserData (see below) to pull user data.

    • - (RefreshUserData) Persist user life time Enphase data information and store it in database.

      • - The method will accept User id as input

      • - Pull user systems using this api https://developer.enphase.com/docs#index

      • - Insert new EnphaseEnergyLifeTime record for each new system that not exist in database.

      • - Pull EnphaseEnergyLifeTime records of the provided user id.

      • - Use this API https://developer.enphase.com/docs#energy_lifetime  to pull system data.

        • - For each EnphaseEnergyLifeTime record, read Last Update Date and use it as start date in the api, if not set then don’t set start_date

      • - When done pulling data set Last Update Date to the last date of pulled data.

  • - Job Scheduler

    • - Write a python script that runs as standalone script.

    • - The script logic:

      • - Iterate through all User records.

      • - For each entry, call enphase controller function RefreshUserData to update user data.

    • - The purpose of this script is to run as job schedular out of the box.

General Note

  • - Logging, validation, error handling must be properly implemented.

  • - All sensitive information, and environment specific information should be configurable.

Hosting

It is preferred if you host your solution in Heroku.

Python Web Framework

Use Django framework. Follow best practices for folder structure as recommended in this framework.

Technology

  • - Python version 3.x running on Ubuntu

  • - Postgres 9.4

  • - Django 1.8.x

  • - AngularJS

  • - Bootstrap

  • - Enphase API

Abstracting and Design Patterns

Please make sure to create helper/interface to include the common code/functionality.

Also please make sure your design is flexible, use facade design pattern and adapter design pattern (and any other proper design pattern) to enable future extensibility of the solution.

Coding Standard

Follow python coding best practices : PEP 8 for the main text, and PEP 257 for docstring conventions

Documentation

Your solution must be well documented.

Readme

Provide a detailed readme file using Markdown language with following information :

  • Overview

  • Setup Prerequisites

  • How to run the app with sample usage of the job schedular

  • Reference to Enphase API Documentation

  • Reference this Python Documentation

  • Any details about any limitations of your solution.

Please note, we're judging this competition not just on the code, but also on the quality of the documentation, and ease of use.



Final Submission Guidelines

Deliverable

- All files that implements the above requirements including README.

- Database scripts, and seed file.

- Deployment Document with verification steps.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30051644