Sunday 24 March 2019

[Question] How do I structure my application?

Hey everyone, working on my first "real" web application (my own idea, not following a tutorial) and I am having trouble figuring out how to structure/encapsulate my business logic, specifically for the user's initial login.The high-level steps I need to take are as follows:fetch data from an external serviceformat and save said data in my own Postrgres databaseretrieve saved data from Postgres, format as ndjson and save in an Elasticsearch indexfetch documents for a given query from ElasticsearchSteps 1-3 would be done via my Node/Express server and step 4 client-side (a React app). The main problem I'm facing is not knowing how to write this code in a succinct manner. I know how to accomplish each step programmatically, however, I don't know if all of this logic should be done in a single controller or broken up in many functions. How would something like this be done in the real world?Been stuck on this for a week now and would really like to get this ironed out. Of course, the above steps might not be the best way to go about the initial user login process so any advice on how to better design that would also be appreciated. Thanks in advance!

Submitted March 24, 2019 at 11:52PM by Cedricium

No comments:

Post a Comment