Skip to content
Matej Plavevski edited this page Dec 13, 2018 · 5 revisions

The Web App is based on the Flask Framework and is divided into multiple folders for Simplicity.

The Web App offers the following routes:

<url>/ - Home Page

  • Currently Returns Hello World

<url>/channels

  • Currently returns an HTML template that renders all the channels into a table and from it you can edit, delete, update other Channels

<url>/api/channels

  • Currently Returns the Channels in JSON format

<url>/jobs

  • Currently returns an HTML template that renders all jobs into a table and from it you can add or delete other Jobs

<url>/api/jobs

  • Currently Returns All Jobs in a JSON format

<url>/delete/channel/<id>

  • Deletes the Channel based on a Given ID

<url>/delete/job/<id>

  • Deletes the Job based on a Given ID

<url>/add/job

  • Adds a Job

<url>/add/Channel

  • Adds a Channel

<url>/update/Channel

  • Updates a Given Channel

Filesystem:

webServer.py -> The Python Program that starts the Web App.

info_panel/__init__.py -> This is where we initialize Flask, SQLAlchemy, etc...

info_panel/static -> All Static Resources, JS files, CSS Files, you name it

info_panel/templates -> Where all the HTML templates are stored

info_panel/main -> Where most of the routes are living

info_panel/main/forms.py -> All the Forms used by Flask

info_panel/main/views.py -> The Routes and it's handlers


Testing

Testing the Web App can be done by running py.test

The Tests are written in tests_web

The Setup For testing the flask Application is in base.py and the tests for the codebase is in test_main/test_main.py


Running the Web App

The Web App is run by visiting the web directory and setting up the FLASK_APP enviorment variable to be equal to webServer.py. Once you do that run it with flask run