Challenge Overview

Challenge Objectives

  • New Node.js web app with existing UI
  • Build out the functionality of the web app to import XLSX to a PosgresSQL database and display it in the app

Project Background

We are building a Smart Investment Advisor platform that empowers users of financial/brokerage sites to back-test, find new ideas for, optimize and trade their portfolios, based on proven theories pioneered by Nobel Prize-winning economists. Traditional financial/brokerage sites only allow users to see price charts and other data of individual stocks, but do not provide a holistic view of the portfolio.

This challenge will be part of the platform, implementing the internal admin app that will be used.

Technology Stack

For this challenge we will target Angular and Node.js.  The existing prototype that we will be filling in is already done in Angular.  You will need to save details in PostgresSQL.  You can use the free PostgresSQL option on Heroku.

The app will need to integrate with Cognito for user authentication and will be hosted for testing on Heroku.

Code access

A link to the current prototype, in Gitlab, will be provided in the forum.  For this challenge, we can take the existing UI and build off of it, but the submission will be a new project, not a patch to the existing prototype.  Future changes will be done on the integrated, working app, not the prototype.

Individual requirements

1. Login with Cognito (Major requirement)

The first page in the prototype is the login screen.  This screen allows a user to login with an email address and password, but currently it does no validation or actual authentication.
In this challenge, we want to use AWS Cognito to handle the user authentication and authorization.  The email and password should be sent to Cognito for verification / login, and the token returned will be used for user authorization in all subsequent web and API calls.

There are available NPMs for dealing with Cognito that may be used here (although they aren't required):
2.  Forgot password

Next to the "Log In" button on the login screne, we want to add a "Forgot Password" button that allows a user to enter their email / username and reset their password through a Cognito code generated.  Please ensure that a user can reset their password via the app, using Cognito APIs.

3.  XLSX upload (Major requirement)

The main focus of the admin application is to handle the upload and display of the settings for the app.  The client wants to do this through XLSX files that will be uploaded to the site.  A sample is provided in the forum that you can fill out for testing.

The  requirements from the client can be find here:

https://gitlab.com/contrendian/admin-ui/-/wikis/home

On the admin-template page there's an "Add a template" button that will be used to upload a new XLSX file.  On upload, we want to:
  • Read the XLSX
  • Validate the XLSX to ensure that all options are filled in for all sites
  • Save the details to a database (PostgresSQL).  Each new upload will increment the version associated with the upload.
  • Make the details available in the UI
You are responsible for the functionality described, in addition to the database schema to save the individual settings

Validation should be done before saving to the database.  If a field is missing or an incorrect value, please ensure it's reported to the user in the UI so they can adjust the XLSX file.

4.  XLSX format

You can assume that the XLSX format will exactly match what's given as the example (minus the ReadMe tab).  Each tab will contain the settings for "Master" or individual sub-sites.  The sites will not be named "Site 1" or "Site 2" in the "real" files.  Please make sure that the names are dynamic and read from the tabs available in the file.

The image names will just need to be names of images that are available in the web app static resources.  Feel free to add a few for testing.

4.  Deployed version

Once the XLSX has been uploaded, parsed, and saved, a new version will show on the admin-template page.  Automatically, this should be the currently deployed version, but the admin has the option of selecting a different version to make the deployed version.  This flag will affect the Settings API functionality described below.

5.  Settings display

In the list of admin templates, the user can click a row to go to the admin-template/detail page.  This page will display the information from the XLSX (read from the database) for viewing.  This page is read-only!  If the user wants to update to a new template, they would need to edit the XLSX and re-upload it.  This is the client's requested workflow.

6.  Settings API

The settings in the app will be pulled by a mobile app, separate to the admin app.  Please build a REST endpoint that can retrieve all the settings for a provided site (Either "Master" or a site name that matches a tab in the XLSX).  The response should be a JSON array of all the various settings, read from the database.  The mobile app will use this in it's UI and calculations.  The settings API should return the configuration details from the admin template that is marked in the UI as the currently deployed version.

7.  User authorization (major requirement)

All REST API calls and admin pages (other than the settings API above) should have authorization implemented to ensure the user is properly logged in via Cognito, with a valid token.  API calls should return a 401 / unauthorized status code if the token is invalid.  

8.  Heroku deployment

Please ensure your webapp can be deployed to Heroku.  All necessary configuration should be able to be done via env variables on Heroku (heroku config:set ....)

9.  Postman collection

Please provide a Postman collection that covers all relevant APIs being added in the admin app, including the settings API and anything used by the app itself.

Deployment guide and validation document


Make sure to require two separate documents for validation.

A README.md that covers:

  • Deployment of the app and installation of the dependencies.
  • Configuration values and how those should be set
  • Information required for setting up the Cognito user pool

A Validation.md that covers:

  • For each numbered requirement, there should be a matching numbered validation item in the Validation.md file that describes how the requirement can be validated by reviewers.

Validation video / screencast

This is optional, but can be quite helpful for review and validation.  
 

What to submit:

  • The code for the updated webapp
  • README.md
  • Validation.md
  • Postman collection for the REST APIs


Final Submission Guidelines

Please see above

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30111938