ryansurf / cli-surf

Get surf and ocean data from the command line interface
MIT License
18 stars 31 forks source link

Refactor index.html rendering and variable passing #19

Closed K-dash closed 6 months ago

K-dash commented 6 months ago

The main changes include:

Refactoring

In this commit, the query_to_args_list function and its associated test code, which were added in #14 , have been removed due to the migration to Flask. These are no longer needed.


What I'd like to discuss

Moving index.html to the templates folder has blurred the boundary between backend and frontend. (With this modification, the frontend folder only contains script.js) If we plan to continue using Flask's template engine, I think it would be better to unify the frontend and backend directories as follows.

Specifically

Fixes #15

ryansurf commented 6 months ago

This is awesome. Good call on centralizing the vars in .env. it felt redundant to make the config.json file

Your changes make the code more simple/easy to read. I'm not very familiar with flask(probably obvious lol) or Jinja2, but it looks like the right move.

As for the proposed changes, they make sense to me. I think it would also be useful to create separate files for each kind of test case, like test_api.py', 'test_server.py, etc. instead of consolidating them all in test_code.py. Edit: Just saw you proposed this in the test cases issue. Beat me to it!

Looks great, thank you for the detailed writeup. Merging now

K-dash commented 6 months ago

@ryansurf Thank you for merging the PR! Also, thank you for accepting the proposal to change the directory structure. I will address this in a separate PR shortly.