0

Sorry if some of these questions are a bit amateurish, I'm an aspiring developer with a few decent projects under my belt. If you could help answer a couple of these questions it would be incredibly helpful.

I'm trying to tackle a pretty ambitious project for my skill level and I need to help figuring out the design patterns I should be using. I'm building this project specifically for a presentation I have to do for a company that I'm currently in the interview process for. Like I said in the title, the tech stack I want to use will be:

React,
Redux,
Flask/Python,
PostgreSQL,

And I want to host it on Heroku.

I've built a React/Redux based app before, but I basically used localstorage and Redux as a pseudo-database/backend. My goal now is to build a full stack, single page application, but I want to make sure I make the correct design decisions early to make my code as professional looking as possible.

I want to build a simple issue tracker. For now I just want to build a project where you can log in, create a project(which is just a collection of tickets), create tickets, and be able to update those projects/tickets. For now there won't be any interactions between users i.e. users can only see and interact with the projects and tickets that they themselves have created, but eventually I want it to be possible for users to collaborate, assign each other tickets, invite each other to work on the same project, etc.

One thing I'm having trouble with is conceptualizing how a Single Page application fits into the classic MVC architecture. It seems to me like single page apps don't really follow MVC architecture at all. Most of the flask tutorials I can find build simple web servers that serve up an HTML page every time a new HTTP request is made. However, this doesn't make sense with a single page app, right? The whole point is that the entire app loads at the same time so you don't have to keep requesting new web pages.

How does routing work then? I used React Router in my first project, but that doesn't communicate with the backend, it simply renders a new component based on the URL. So when that happens, should the Redux store make an http request for the data it needs? If so, doesn't that defeat the purpose of a single-page app, which is limiting the number of requests to the backend? Should I just make one HTTP request at the beginning for all of the data and store it in the Redux store?

I've read that some single page Apps aren't truly single-page, but are actually split up into a few smaller chunks. Is this an advisable approach? Shouldn't I strive to make a truly single page app for the purposes of impressing future interviewers?

Does it make sense to use PostgreSQL? I really only decided on PostgreSQL because that's the database used in most of the Heroku tutorials, but it's possible to use mysql

Sorry again for the vague, general, and amateurish nature of some of these questions, but I really want to make this project great.

1 Answers1

3

The Flask tutorials you've seen use the templating engine that comes with it (Jinja) because they don't have a separate frontend framework. In your case, Flask should only be used as an API that only returns JSON to the frontend, and lets it decide how to render the data, instead of rendering the HTML pages itself.

PostgreSQL makes sense to use, as MySQL does. They are similar, and if you use an ORM (like SQLAlchemy which is often used in Flask), you will be using the same statements for both of them. However, If I'm not mistaken Heroku has a special addon for Postgres which will make integration with it easier than MySQL. Not sure though.

Yano KX
  • 47
  • 7