HomeArticlesInterview with Marko Aleksendrić

Interview with Marko Aleksendrić

Marko Aleksendrić is the author of Full Stack FastAPI, React, and MongoDB, we got the chance to sit down and find out more about his experience of writing with Packt.

Q: What are your specialist tech areas?

Marko: I have a PhD in Control Engineering which is a pretty math-heavy area, but I just happen to love mathematics, analytics, statistics and systems theory. Over the last twenty years I fell in love with data visualizations, analytics and web development and tried to learn voraciously everything that could help me create interesting projects. I began with Python and it is still my main environment of choice since it encompasses so many different areas, but when it comes to web development, it really shines combined with JavaScript, allowing us to build virtually anything – from simple websites or CRUD applications to complex dashboards, machine learning deployments or reporting solutions. So, if I had to say – Python and JavaScript and various tools.

Q: How did you become an author for Packt? Tell us about your journey. What was your motivation for writing this book?

Marko: I have been an avid reader of tech and science books, especially Packt books, and in a way I developed a “taste” or preference if you will for certain authors and the way tech books should be written. Some were easy to follow and illustrative, others were more contrived and less instructive, some others included pages or chapters that are not strictly focused on the subject matter and so on. So I already had some ideas of what kind of book I would like to write, had I been given the opportunity. Since I firmly believe that there are thousands of “us” out there – people and professionals from all walks of life that haven’t had a formal CS education but are, for some reason, driven into the field of development, web development, desktop application development and so on – I wanted to try and make a book that would appeal to them, written with a particular reader or audience in mind: myself. I have reached out to Packt – the top publishing company in tech and more importantly a publisher that is able to strike a fine balance between modern and cutting-edge technologies and an overall thorough approach. Let’s face it – tech and programming books have a pretty short shelf-life, we’re not buying books that describe how to lay out websites using tables. After a while I was called back by their very agile and friendly team and we started talking.

The result of these conversations is the book – a blend of a couple of technologies that are, in my opinion, quite mature and widespread and, at the same time, shouldn’t cease to exist in the next couple of years. React is everywhere and it is arguably the most popular front-end library in the world, but even if a new version should come up, or they invent some new superhooks or should you choose to use Svelte or Vue.js, the same or very similar principles of state management or UI composition should apply. No knowledge should go to waste. The same goes for FastAPI which is a really popular and well documented framework – it is appealing because it is relatively simple to use, it follows good practices, it has excellent documentation and follows the REST API principles. I believe that once a developer learns how to achieve certain goals with FastAPI, he will be able to easily apply the same solid principles using some other tools: Django REST Framework, or Starlite or even Node.js – based frameworks, like Express.js or Fastify.

Q: What kind of research did you do, and how long did you spend researching before beginning the book?

Marko: There was quite a bit of research – of course. When writing, one always has to stay within some kind of limits and boundaries or the material, be it a book or a course, can easily go out of hand and become a mess. I felt like my PhD and MSc research work helped me quite a bit – you have to choose a topic, highlight the components and subtopics as much as the main topic needs them, explain why you made the choices that you made, and leave some open ends for the reader to explore after having finished the book. React itself is a huge topic in its own right and I really tried to extract or distill the absolute minimum needed for getting simple apps off the ground. Of course you are not expected to learn React from this book – that is not the point, so I tried, where possible, to suggest books or online sources that have helped me personally or that I found particularly useful. The same goes for FastAPI, probably the least famous of the three main characters of the book. Researching doesn’t involve only the part where you choose what to cover and how to cover it – maybe the most important part is deciding what to omit or defer to the reader.

Q: Did you face any challenges during the writing process? How did you overcome them?

Marko: Of course, there were many challenges – the first and most obvious one being the fact that I have never written a book and that I haven’t done much writing in English. The Packt team, especially my editor and now friend Aamir Ahmed, has done a tremendous job easing me into the process, providing useful feedback and, as the work progressed, we were getting better and better with each chapter, at least in my opinion. In the beginning I was really a rookie, making rookie mistakes, to use some basketball lingo, but by the end I felt like we were a playoff team, firing on all cylinders. Another challenge was scheduling – juggling between the job, family, kids going to school, and just everyday life. After a while it all kind of worked out, thanks to my wonderful wife Tanja and some improvisation and juggling that makes life interesting.

Q: What’s your take on the technologies discussed in the book? Where do you see these technologies heading in the future?

Marko: As I stated before, one of the reasons that I covered these particular technologies is the fact that I really believe that they are here to stay and that they are, each in their own domain, excellent products that promote good practices and are just great for learning purposes. React is living another life with the advent of hooks and the Context API and frameworks like Next.js or Gatsby.js are thriving. React Remix is a new and heavily backed new framework that looks very interesting and promising.

The entire community seems to be very active and vibrant, and I really do not see React going away anytime soon, while the solutions for UI problems that it is able to offer are excellent and, in my view, greatly simplified. MongoDB is arguably still the most popular and universal NoSQL solution that lends itself to so many use-cases that it is well worth learning, even if it’s just for prototyping. The speed and flexibility, coupled with the ability to handle disparate sets of data, but maybe most importantly, the ability to mimic exactly the data flow of your web or mobile application is just appealing to me. Finally, the MongoDB querying language, that is essentially JavaScript, translates in a beautiful way into Python, through the drivers that are covered in the book, and makes development and prototyping a pleasant experience. Python always had interesting web frameworks to offer, besides the ever-popular Django. I remember making small apps with CherryPy and Bottle (check them out, they still rock!) and then Flask filled the void of a microframework that’s just right, that hits the sweet spot between usability and complexity, that enables the developers to speak the language of the Web, be it through Jinja HTML templates or REST endpoints. FastAPI seems to be “that” framework nowadays – it supports async requests, it is modular, building routers and more complex apps is intuitive and logical, its dependency injection system is simple and powerful and its performance rivals Node.js. I believe we will see many more big and small companies choosing FastAPI as their weapon of choice, but I also see numerous small projects being based on it – maybe internal tools or data analytics, data processing, and visualization apps.

Apart from the three technologies mentioned in the title, I have covered quite a few online services as I believe that there are great products out there that can help us push our app to the public, however small it might be. I covered a couple of deployment solutions since that was an often-overlooked aspect in many web-development books that I came across. I decided to describe basic deployments on Netlify and Vercel since they are easy to use, provide a free tier and are just awesome services that you are bound to use at a certain point. I also included a Cloudinary image-hosting setup since it handles so many details for us and outsources a big problem – hosting images and media. The book also has a couple of Heroku deployment examples (they are still great, although they seem to have dropped the free tier that made them so popular), a full Linux-based hosting setup on DigitalOcean. These are all, in my opinion, useful skills to have under the belt as deployments today are part of the lifecycle of an app and you just might have to do it all by yourself.

Q: Why should readers choose this book over others already on the market? How would you differentiate your book from its competition?

Marko: To be quite honest, there have been some excellent books on the market covering one technology – I have to mention Voron’s excellent book on FastAPI that is more focused on the aspect of deploying machine learning systems, but also covers the framework in great detail and is very well written. Obviously, there are great books and courses on React and MongoDB as these are mature technologies that have been around for some time. However, there hasn’t been a book focused on web development with FastAPI – a book that would connect the dots for an entire full-stack web application – from the data models with Pydantic, to endpoints, from the frontend to the CSS framework (in the book I used Tailwind CSS as I feel it is great for busy developers). I have tried to include brief explanations of the inner workings of the HTTP protocol and how FastAPI handles it, as well as the connections of the frontend with the backend through the use of React Hooks or more complex solutions like the Vercel SWR library, Redis caching and so on. You get a rather complete and self-contained web development manual for the FARM stack, that’s something that I would like to have when beginning with a new stack.

Q: What are the key takeaways you want readers to come away with from the book?

Marko: I firmly believe that every tech book should leave you with some knowledge, practical and theoretical and it should leave the reader wanting for more – motivate the reader to play with the technology, build stuff, simple or complex, smart or stupid apps, and than make the reader look further and solve practical problems on the fly, googling, stackoverflowing or trying out different solutions. The key takeaway would be to add a pretty universal and open-ended stack to your toolbelt – there are really many domains where the FARM stack could shine and improve the coding and production speed, provide security, app speed and just add the power of combining Python into your web apps – from simple brochure or blog-like websites to complex machine-learning or data processing services, microservices-based web applications and so on.

Q. What advice would you give to readers learning tech? Do you have any top tips?

Marko:

Every learner is unique – some people prefer paper books, some – probably the younger ones – are perfectly fine with electronic formats and reading books on screens, others might prefer video courses and Youtube or Udemy or Packt videos – it’s a very individual thing.

My general preference when learning a new technology would probably be to watch some video material, a couple of introductory courses, and then sink my teeth into the documentation – usually the docs are the best place to start and in the case of this book I have been truly blessed: FastAPI, React and MongoDB all have excellent documentations.

Diving deeper, I tend to prefer books, especially if they are well laid-out. I guess it comes from our backgrounds – I had some engineering books thick as a brick and then I had to chop them with a pen and a marker (Fluid Mechanics, I am looking at you!). I still like to do that with books, draw a hierarchy through colors and highlights and then use it as a reference as I try to build something. The beautiful thing with Web Development is that once you have learned how to find your way around a certain framework, you will easily transfer that knowledge to another environment. Our brains are great at spotting and remembering little differences! Time management and prioritizing are probably the key, especially if your work is not strictly development related.

Q. Do you have a blog that readers can follow?

Marko: I do, I have a website: www.freethrow.rs and I plan to reupload some of my projects and just start writing longer articles. Let me take this opportunity and promise that I will begin posting regularly!

Q. Can you share any blogs, websites and forums to help readers gain a holistic view of the tech they are learning?

Marko: When it comes to the technologies used in the book, they all have excellent documentation and that would probably be a great place to start. I really liked some YouTube videos covering Fast API in the early days of the framework and the author himself – Sebastian Ramirez has been an excellent ambassador for the framework so I recommend watching some of his talks. When it comes to React, depending on your level of proficiency, you can choose between Net Ninja (Shaun Pelling) and Kent C. Dodds, and you cannot go wrong.

Q. How would you describe your author’s journey with Packt? Would you recommend Packt to aspiring authors?

Marko:

I would absolutely recommend it! I really wasn’t sure what to expect as this was quite new for me. The staff was incredibly professional and welcoming, while my editor Aamir guided me through the writing process and effectively taught me how to write a book – I feel like I have taken a course from a Pro for free.

I believe that any aspiring author has their own doubts – will I be able to put my thoughts into words, will I be able to follow a tight schedule, will this be a complete disaster and so on… You can never know if you don’t try and Packt really went out of their way to help. It is a wonderful and rewarding experience that I would wholeheartedly recommend if you had an idea and the desire or willingness to write. The beginning is the hardest part – after a while, it becomes a quite an enjoyable and creative process if you like writing. And I love writing!

Q. Do you belong to any tech community groups?

Marko: No, as a matter of fact – I don’t. My job is not directly related to development, and I am mostly self-taught. I am open for suggestions!

Q. What are your favorite tech journals? How do you keep yourself up to date on tech?

Marko: I read books that I find interesting especially when I am trying new things or just want to see what a product or tech is about. I follow maybe a dozen YouTube channels (I will post them on my blog) and occasionally I see a course from Udemy or Skill Share or Packt or Pluralsight. For learning and fully grasping the really fundamental staff – like data structures and inherent language-specific features – I still prefer a good-ole book, while smaller and more specific problems might be covered and explained better by some youtuber or developer on Medium.

Q. How did you organize, plan, and prioritize your work and write the book?

Marko: I have somehow managed to always be a bit ahead of schedule, yet at the end we were within a day or two of the final schedules – there will always be some delays, unforeseen circumstances or unexpected situations, so plan accordingly. My routine was to try and prepare the code that should showcase the chapter first, make it as illustrative and explanatory as possible, then break the text down into manageable subchapters and then put it all together. After the first couple of chapters, I got the feel for what is a typical Packt book structure should look like, and then it was much easier. Usually, I worked in the evenings and during the quiet weekend mornings, after taking my dog for a walk. You should probably think of a period, during the day or the week, when you will be able to be relaxed, and focused and have some physical space in front of you – at least in my case – I always have tons of papers and books in front of me. Good headphones can also help!

Q. What is that one writing tip that you found most crucial and would like to share with aspiring authors?

Marko: My tip would probably be to try and write a book or chapter or blog post that you would like to read – be your own audience! I know that sounds easier said than done, but I literally started with that idea: so you received a book on FastAPI, react and MongoDB – what would you like to find inside? You should also have a pretty good idea about your audience – are they industry experts, proficient users or beginners, or intermediate users? Do they need to obtain a certificate or build practical stuff for fun and profit? After defining this fictional persona, try to write for him/her.

Q. Would you like to share your social handles? If so, please share.

Marko: Yes, you can find me at https://www.linkedin.com/in/aleksendric/

You can find Marko’s book on Amazon by following this link: Please click here

Full Stack FastAPI, React, and MongoDB is Available on Amazon.com