Use Flask for a one-page web app, or something else?
September 19, 2019 11:45 PM Subscribe
Let's say I wanted to make a relatively simple one-page web app, but it should use a REST API and have user login functionality.
I was thinking about doing it all in Flask, but I wonder if there are better and easier options for a framework?
I was thinking about doing it all in Flask, but I wonder if there are better and easier options for a framework?
I think it kinda depends on why your first inclination was Flask. Are you set on using Python on the back-end, or was that just happenstance?
If you're already going to be doing JS on the front end, Vue plus Bootstrap is pretty quick and easy, and at that point it's not a big leap to also handle APIs using something like Express.
Vue has a "vue-cli" component that makes scaffolding projects (including a basic server to front it) pretty easy.
posted by tocts at 4:53 AM on September 20, 2019 [1 favorite]
If you're already going to be doing JS on the front end, Vue plus Bootstrap is pretty quick and easy, and at that point it's not a big leap to also handle APIs using something like Express.
Vue has a "vue-cli" component that makes scaffolding projects (including a basic server to front it) pretty easy.
posted by tocts at 4:53 AM on September 20, 2019 [1 favorite]
Response by poster: I like Python, but I'd be happy to do it all in Javascript if that's going to make things easier in the long run.
Especially if there's some popular tech stack that's commonly enough in use that I can find a bunch of tutorials on how to set things up.
posted by Umami Dearest at 8:12 AM on September 20, 2019
Especially if there's some popular tech stack that's commonly enough in use that I can find a bunch of tutorials on how to set things up.
posted by Umami Dearest at 8:12 AM on September 20, 2019
A question I asked earlier this year.
posted by ShooBoo at 8:27 AM on September 20, 2019 [1 favorite]
posted by ShooBoo at 8:27 AM on September 20, 2019 [1 favorite]
Express is very similar to Flask, except it runs on Nodejs.
posted by neckro23 at 9:16 AM on September 20, 2019 [1 favorite]
posted by neckro23 at 9:16 AM on September 20, 2019 [1 favorite]
Especially if there's some popular tech stack that's commonly enough in use that I can find a bunch of tutorials on how to set things up.
There's a lot of good tutorials on Vue, such as this one which I found helpful earlier this year (I have nodejs experience but hadn't done Vue). Using vue-cli will scaffold you both the web app and a basic nodejs service that can serve your app for development purposes. Longer term you may want to do more customization of how the service (via Express or other tech) works but it gets you started real fast and may do all you need more or less out of the box.
posted by tocts at 9:44 AM on September 20, 2019 [1 favorite]
There's a lot of good tutorials on Vue, such as this one which I found helpful earlier this year (I have nodejs experience but hadn't done Vue). Using vue-cli will scaffold you both the web app and a basic nodejs service that can serve your app for development purposes. Longer term you may want to do more customization of how the service (via Express or other tech) works but it gets you started real fast and may do all you need more or less out of the box.
posted by tocts at 9:44 AM on September 20, 2019 [1 favorite]
Response by poster: Thanks for all the advice. I decided on Flask for the back end, mostly because I wanted to learn how to use it, and Vue.js for the front end, which I'm still working on.
So far, so good, except that most of the online Vue tutorials are just a little more complicated than I wish, using stuff like Vuex, Vue-cli and so on that I (think I) really don't need for this simple project. But I will keep looking - the basic Vue.js official documentation seems pretty good.
posted by Umami Dearest at 9:41 PM on September 27, 2019
So far, so good, except that most of the online Vue tutorials are just a little more complicated than I wish, using stuff like Vuex, Vue-cli and so on that I (think I) really don't need for this simple project. But I will keep looking - the basic Vue.js official documentation seems pretty good.
posted by Umami Dearest at 9:41 PM on September 27, 2019
« Older What happened to the Lord Of The Rings merchandise... | Why won't Syma apps from the app store work with a... Newer »
This thread is closed to new comments.
posted by benzenedream at 12:43 AM on September 20, 2019 [2 favorites]