So that the first pancake does not come out lumpy. Tips for a novice service developer

Good afternoon, dear readers! This article is intended for all data scientists who decide to write their first web application. In this publication, I will not post code listings. On the Internet, there are many practical examples of building services written in different frameworks. But there are very few theoretical articles on the logic of the process, the architecture of the solution, and, most importantly, the difficulties that a specialist will first encounter. I decided to fill this niche and describe my personal experience, which may be useful to someone.





 Especially for the article, I prepared two identical examples in Flask and Dash and posted them on GitHub. They illustrate the calculation and output of unit economics indicators for an abstract IT market called Habr (and why not, because now all companies have begun to engage in e-commerce :).





I propose to build the conversation in the form of a step-by-step summary of the attached material, in the process I will focus your attention on those moments that I personally found the most difficult or interesting. And, of course, we will definitely focus on those mistakes that I made as a backend developer.





"OPP: if you do not know how - do not take it!" When it comes to OPP, for some reason I automatically think of Django with its classes. But if you look at the work of budding data scientists or data analysts, we see a completely different picture. Classes are used for the sake of the classes themselves. All the code is simply merged into this structure of the language. What is this β€œmonster” responsible for? For all! How to search for errors or rewrite the code is not clear. Personally, I have such an opinion on this matter. If you do not know when, how and why to use OPP, then it is better to use a procedural-functional style for small developments.





β€œLet it be disgraceful, but uniformity. Even if you are working alone, develop a uniform namespace formation system. This, firstly, will improve the readability of the code, and, secondly, it will speed up its writing, since there is no need to remember exactly how the function is named on another page.





"We commit, even if we don't push." Even if you don't have a GitHub account, get yourself a practice using a version control system. This is really convenient, since it allows you to carry out experiments in auxiliary branches without creating additional sheets for testing hypotheses. I often neglect this recommendation, but in vain.





β€œ .” ? , . , PHP, Ruby, C#:





  • Flask – HTML+CSS





  • Django – HTML+CSS





  • Flask Rest API/FastAPI/Django Rest Framework – HTML+CSS+ Javascript (Vue, React, Angular)





  • Dash ( Flask) – Dask ( React)





, .





  • , , – Dash





  • . , - – Flask





  • , . , , - – FastAPI – Vue.js





Flask Dash .





, , 6 -, -. , . , .





Flask , , html css . Bootstrap4 , , .





Dash , app.py. , . . asset. - . , , .





β€œ .” . . , , , . . . etl- .





β€œ .” . - . etl-, , . , . , , .





β€œ SQL- , .” . sql. . . . SQLite.





β€œPandas , .” , , . Python.





β€œ , YAML-.” yaml - data scientist- Youtube. . .





β€œ Docker.β€œ . Windows, Docker. Windows 10 , Docker Toolbox. , - Docker GitHub. Windows 8.1, , . , . Debian 10. , . , Apache Airflow, .





. , . , . . , Linux. . , Dash docker-, . , , , .





β€œ , .” . , , . , , , , .





. Dash, . . , app.py 127.0.0.1, 0.0.0.0.





. . .





That's all. All health, good luck and professional success!








All Articles