Skip to content

Backend Documentation (backend)

karkir0003 edited this page Jul 21, 2022 · 15 revisions

About

This page contains documentation for the files in the /backend directory of the Github repo. This page is regularly updated when new changes are added to these files.

Sub-directories

/aws_helpers/dynamo_db_utils
/common
/dl
/ml

Driver (/backend/driver.py)

This file is a very important file in the backend. It essentially acts as the point of entry into the backend

Functions

  • ml_drive(): Endpoint that trains classical ML model based on user specifications
  • dl_drive(): Endpoint that trains classical DL model based on user specifications
  • root(): Flask Route to send files from one directory to another
  • train_and_output(): Flask Route that right now trains DL model (frontend will hit this endpoint to run dl_drive() and JSONified output is sent back)
  • send_email_route(): Endpoint to send email notification to user about their model + training result attachments. This function acts as a wrapper to an AWS API Gateway endpoint that invokes a lambda to send email notification (via AWS SES) through the send_email() function. TLDR, the flow is send_email_route() -> send_email() -> API Gateway -> AWS Lambda -> AWS SES

Running the backend: Make sure that your terminal is at ~/Deep-Learning-Playground and run python -m backend.driver. The -m is a tag to "run as module"

Note that we run the app on host 0.0.0.0 to allow for backend and frontend to be served on the same port. It's crucial for our app to work properly in production.

Clone this wiki locally