• Compete
  • Learn
  • Community
ico-magnifying_glass
    ico-arrow-big-left

    SunShot - Bright Harvest NodeJS API-UI Integration

    PRIZES

    1st

    $2,500

    2nd

    $1,200

    Register
    Submit
    The challenge is finished.
    Show Deadlinesicon-arrow-up

    Challenge Overview

    Bright Harvest web app will provide our clients with flexible residential solar designs, faster turnaround, time and lower cost of delivering our innovative precision remote PV design services.

    You are provided with AngularJS HTML UI prototype and REST API backend, in this challenge you will hook them up and produce a full functional web application.

    Challenge Requirements

    NodeJS REST API

    • - Gitlab link : https://gitlab.com/tc-sunshot-r2/ss2-bright-harvest

    • - Check forums to get access to the gitlab repo.

    • - Prototype is under ‘angularjs’ folder.

    • - Deployment guide (contains verification steps as well) under docs/30051616-DeploymentGuide.pdf

    • - We have Postman collection with all API calls under postman folder : sunshot-bright-harvest.json.postman_collection, use it to test and play with the API, it contains all the API calls you need with sample calls.

    • - If there is any mapping that is not clear between the REST API tables/models and UI page please ask in the challenge forums.

    • - Few changes to do the API : Add /api prefix to all api endpoints.

    • - Any required fixes or additional backend implementation to support the UI integration are in scope of this challenge.

    File upload

    • - In the angularjs, file upload should start automatically when user select or drag a file.

    • - Use a loading indicator spinner to indicate file upload progress.

    • - Prevent the action that depends on the uploading process until files are uploaded, i.e. save project or save model .. etc.

    • - You need to create DELETE /files/:id endpoint.

    Navigation

    • - The UI prototype navigation is clear, it show how to navigate between pages, if there is anything not clear please ask in forums.

    Pages Requirements

    1. - Login Page

      • - Page : #/login

      • - API Endpoint to use : POST /login

        • - Fix endpoint to return fullName in the response.

        • - Use the returned fullName to render user full name in header.

      • - “Login with Google” :

        • - Will make call to : GET /login/google

        • - This does not register new user if user with google account email does not exist.

      • - On successful login :

        • - If client then navigate to /#/clientProjectList

        • - If admin then navigate to /#/adminProjectList

      • - Implement Logout endpoint to logout user, will be used by header “Logout” option.

    2. - Register Popup

      • - Page : #/login

      • - Click on “Register” button to open the register form.

      • - API Endpoint to use : POST /users

      • - On successful register take user to login form.

    3. - Forgot Password Page

      • - Page : /#/forgot

      • - API Endpoint : POST /forgotpassword

      • - On successful call, Display a message “Check your email to reset the password”.

    4. - Reset Password Page

      • - Page : we don’t have a page for this, so you need to create a page :

        • - Similar to /#/forgot page

        • - It will have two fields, for providing password and confirming a password

      • - API to use : POST /resetpassword

    5. - Client Project List Page

      • - Page : #/clientProjectList

      • - API to retrieve table items : GET /projects

        • - Fix endpoint to return pagination information in responses :

          • - total

          • - offset

          • - size

        • - Also add summary aggregation fields to response to render summary section above the table :

          • - Use the query to get total records and each project status total records.

      • - API to do the search : GET /projects/search

        • - Fix this endpoint to return only id, name and address, this endpoint is used for autocomplete.

        • - Clicking on a result from the search will take user to Project Details page.

      • - Pagination and sorting will be done server side using the above two endpoints.

      • - Click Reset in header will reset table by calling GET /projects with default parameters

      • - To cancel project use :

        • - Use PUT /projects/:id to change project status to “Cancelled”.

        • - Use POST /notes to create new note in the project with text “CANCELED”, if user entered the optional reason text then append the text to the note. i.e. if reason is “No longer needed”, then note text will be CANCELED, no longer needed”.

    6. - Client New Project Page

      • - Page /#/clientNewProject

      • - To populate company dropdown use : GET /companies

      • - When user drag or select a file an auto upload should be started :

        • - Use PUT /files endpoint.

        • - Show spinner loading indicator in the file image to indicate uploading.

        • - Use GET /files/:id as link for file after uploaded.

      • - Use this endpoint to create the project : POST /projects

        • - Update this endpoint to accept the inserted note and insert it in notes table.

      • - When removing a file use “DELETE /files/:id” to remove the file from backend

        • - This endpoint should be implemented.

    7. - Client Edit Project Page

      • - Page : /#/clientEditProject

      • - Populate content using GET /projects/:id

      • - The page functionality is same as New Project Page

      • - To save edited project use endpoint : PUT /projects/:id

    8. - Client Project Details Page

      • - Page : #/clientProjectDetails

      • - Use GET /projects/:id to get project name and address.

      • - Use GET /projects/:id/siteModels to render Site Models table.

        • - siteModels with ‘hidden’ flag should be hidden from table, clicking “Show Hidden” button will show these hidden rows.

      • - Clicking (+) button of siteModel will load associated layouts :

        • - To load layouts call : GET /siteModels/:id/layouts

        • - Hidden/Show Hidden behavior should be same as in SiteModels

          • - Use PUT /layouts/:id to update the hidden flag.

        • - Duplicate button will add new row and make call to ‘POST /layouts” to save the layout

      • - Clicking “hide selected” will hide the row and make call to backend “PUT /siteModels/:id” to set ‘hidden’ field to true.

      • - To get notes use “GET /projects/:id/notes”

      • - To get attachments associated with the project use “/projects/:id/files”.

      • - To add new note use “POST /notes“ then refresh the notes section.

      • - When adding file it should auto upload, use “POST /files” and show spinner loading indicator

        • - Update this endpoint to accept project_id to associate the files with.

      • - When removing a file use “DELETE /files/:id” to remove the file from backend

        • - This endpoint should be implemented.

      • - Clicking “Request Revision” button

        • - Call PUT /projects/:id with status “Request revision”

          • - Update the endpoint to accept the note as parameter and store it as new note, and associate it with project.

    9. - Admin Project Listing

      • - Page : #/adminProjectList

      • - Same functionality as in Client Project Listing in addition to the below admin functionality/features

      • - Filter Icon :

        • - This will filter the project by clientStatus field.

        • - Use GET /projects to filter the projects list.

          • - Update the backend to support filtering using multiple statuses

      • - Admin user can update the following fields from the table :

        • - Client Status

          • - Use PUT /projects/:id to update this value.

          • - Possible values : Payment pending, Hold, In queue, In progress, Delivered, Revision requested, Canceled

        • - BHS Status :

          • - Use PUT /projects/:id to update this value.

          • - Possible values : Not started, Modeling, Ready for PV, Adding PV, In review, QA revision, Updated, Approved, Delivered, Canceled

        • - Initials : This display initial of assignedUserId if set.

          • - The drop down lists all Initials of users with role = Admin.

          • - Use PUT /projects/:id to update project#assignedUserId value.

    10. - Admin New Project

      • - Page : #/adminNewProject

      • - Same functionality as Client New Project Page

    11. - Admin Edit Project

      • - Page : /#/adminEditProject

      • - Same functionality as Client Edit Project Page

    12. - Admin Project Details

      • - Page : #/adminProjectDetails

      • - Same functionality as Client Project Details in addition to the following features/functionality

      • - “Upload Model” popup :

        • - Use POST /files to attach the file

          • - Prevent creating the Model until file is uploads.

          • - Show upload loading  indicator spinner during upload.

        • - Use POST /siteModels to create new model

        • - Table should be refreshed with uploaded model.

      • - “Edit Selected” popup :

        • - Use POST /files to attach new file when user drag a file.

        • - Use DELETE /files to remove associated file when user delete it.

        • - Use PUT /siteModels/:id to create new model

        • - Table should be refreshed with uploaded model.

      • - “Delete Selected” button :

        • - For site model : DELETE /siteModels/:id endpoint to delete the selected model.

        • - For layout : DELETE /layouts/:id to delete the selected layout.

      • - “Internal Notes” section :

        • - Use GET /projects/:id/notes to get internal notes :

          • - Update endpoint to accept “internalNote=yes” flag to return only internal notes.

      • - “Client Notes” section :

        • - Use GET /projects/:id/notes to get non-internal notes (client notes) :

          • - Use same flag “internalNotes” with value = false to get client notes.

      • - Note actions in Internal Note or Client note :

        • - Use POST /notes to create note with proper parameters.

        • - Use PUT /notes/:id to update note with proper parameters.

        • - Use DELETE /notes/:id to delete note.

    13. - Manage Users and Companies Page

      • - Page : /#/adminManageUser

      • - To populate users table use GET /users endpoint

        • - Update endpoint to return pagination and sorting information

          • - total

          • - offset

          • - size

          • - sortOrder

          • - sortBy

        • - Update the endpoint to return count of users and BHS admins to populate the users summary

          • - totalAdmins

          • - totalUsers

      • - Edit User popup

        • - Use GET /users/:id to populate the popup

        • - Use PUT /users/:id to update user

      • - Delete user action

        • - Use DELETE /users/:id to delete a user.

      • - Add new user

        • - Use POST /users to save the new user.

      • - To populate companies table use GET /companies endpoint

        • - Update endpoint to return pagination and sorting information

          • - total

          • - offset

          • - size

          • - sortOrder

          • - sortBy

      • - Add/Edit Company Popup

        • - USE GET /companies/:id to populate popup

        • - Use POST /files to upload new file

        • - Use DELETE /files to remove attached file.

        • - Implement new endpoint to implement user drop down feature :

          • - Endpoint : GET /users/search

          • - It will return response :

            • - username

            • - fullName

            • - email

            • - id

        • - In Update company, the member array will override existing member array.

      • - Delete company action :

        • - Use DELETE /companies/:id to delete the company when clicking on (x) icon.

    Test Data

    • - Provide a script that insert admin user

    • - Provide sample test data.

    Hosting

    It is preferred if you provide scripts and steps to deploy the application in google cloud platform

    https://cloud.google.com/nodejs/

    Documentation

    Provide a detailed README documentation for how to setup and configure the application.

    Configurations

    You are expected to use environment variables to store sensitive information and environment-specific configurations.    

    General Note

    • - The angularjs is responsive, your solution should work in responsive views.

    • - Truncate any json field value that does not fit the target UI element.

     

    Final Submission Guidelines

    Deliverable

    • - All source code that implement the requirement.

    • - README in markup language

    • - Verification document contains steps to verify your solution.

    • - Sample input file.

    Reliability Rating and Bonus

    For challenges that have a reliability bonus, the bonus depends on the reliability rating at the moment of registration for that project. A participant with no previous projects is considered to have no reliability rating, and therefore gets no bonus. Reliability bonus does not apply to Digital Run winnings. Since reliability rating is based on the past 15 projects, it can only have 15 discrete values.
    Read more.

    ELIGIBLE EVENTS:

    2016 TopCoder(R) Open

    REVIEW STYLE:

    Final Review:

    Community Review Board
    ?

    Approval:

    User Sign-Off
    ?

    CHALLENGE LINKS:

    Review Scorecard