Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Zachary Hudson
PLUS
Zachary Hudson
Courses Plus Student 12,154 Points

Scalable AJAX. Combining server-side code with client-side effectively?

I've been building a "learning" project for some time based on what I've learned from TeamTreehouse and other online resources. As I'm getting more and more into it, I'm really struggling to progress forward beyond the basics. So far I have a Flask application with a bootstrap based front-end. I have a basic REST API setup as well.

Now here comes the question: I'm beginning to realize I want to do far more with the user interface than just redirect/render templates. I want there to be a dynamic element and the ability to filter and move data around on the pages without reloading. When I first started looking into this, it appeared that using a technique called AJAX was the way to go.

But as I went down that rabbit hole, I became aware that merely plastering my Jinja templates with raw JQuery/Javascript was terrible and not scalable as I continued to add more and more elements on the project. Not to mention I barely understood what I was doing trying to pass JSON back and forth between the two elements or how to properly validate/secure the data flowing between them. That led me to look into frameworks like Backbone, Ember, React.js, and Angular to give my project some structure on the frontend (and perhaps some better tutorials on the subject).

At this point, I'm stuck because I can't make a decision. There aren't enough resources out there about integrating Flask and AJAX/JS together. How do I setup my project for success and learn the things necessary to create a dynamic application, while merging my server side code with client side? Every single major website out there seems to incorporate these strategies, but I can't seem to figure out how to merge the two together effectively. I know that every website/web-stack is different, but I don't even know where to begin!

Please, any advice/resources would be super helpful.