Home > database >  What's an appropriate tech stack for a web app and a blog with a Python backend?
What's an appropriate tech stack for a web app and a blog with a Python backend?

Time:01-20

I'm a data scientist who's built a prediction model that I'd like to deploy to a live website. I'd also like this website to have a blog that I can optimize for SEO in order to generate traffic to the site.

If it was just a blog, I know WordPress is good for SEO. If it was just a web app, I have Flask endpoints on an AWS server that I can call via a get request.

What's the best way to combine the two? Is there an option in WordPress where I can ping my endpoints and display the predictions on the page? Someone else recommended I use React for the front end.

I'm very new to web development and just trying to figure out what the different components I'll need to create a web app that displays my machine learning predictions along with a blog. So far I have a domain name and Flask endpoints set up on AWS for getting predictions.

CodePudding user response:

If I understand you are looking for a right webapp platform for your blog so that it can call your AWS Sagemaker inference end point. Note that all modern/java script frameworks can invoke REST endpoints in this case your AWS prediction/inference end point.

Wordpress is a php based CMS application. Using its admin page you can add new pages. See here for details steps :https://www.tutorialspoint.com/wordpress/wordpress_add_pages.htm

CodePudding user response:

I don't know if what you are trying to do is possible with WordPress. However, a solution could be to create a blog with Next.js by Vercel, a free and open-source framework based on the React library.

Of course, with this solution, you will have to acquire some new knowledge but I have the intuition that even if you're very new to web development it is doable because there are many tutorials and templates. The goal would be to create and deploy a blog with Next.js where the content of blog posts comes from .MDX files and where you can send some requests to your API endpoints written with Python.

To keep it simple, .MDX files are like Markdown files (like README.md) where it is possible to import React components written in javascript inside to make the blog posts dynamic (more accurate information about MDX here). For example, some input fields and buttons could make requests to your API endpoints and display the response the way you want.

This solution could take a bit of effort to set up, but maintenance should be simple and website performance should be great. Adding a new post should be a matter of creating a new markdown .MDX file. Some resources I found that could be a great start for that is the blog post from the WebStorm Blog "Building a Blog With Next.js and MDX" by Don Ebenezer or the YouTube video "Building A Blog With MDX" from Lee Robinson being the Head of Developer Relations at Vercel.

  •  Tags:  
  • Related