workout-lol / workout-lol

A simple way to create a workout plan
https://workout.lol
MIT License
1.3k stars 90 forks source link

Make it a progressive web app #11

Closed Vincenius closed 1 year ago

Vincenius commented 1 year ago

It would be nice if people could install it to their phones as a progressive web app. (probably using https://www.npmjs.com/package/next-pwa)

A native app would also be an option, but I don't know if it's worth the effort - probably more of a future topic once we consider the website done / feature complete

Snouzy commented 1 year ago

Yeah, good idea. Native include some work as you said. How would you like to handle this app in the future? Going for a SaaS? I know only react-native & capacitor for apps. And you ? Btw, Maybe the project we'll have some more person ! 💪

Vincenius commented 1 year ago

Oh, I didn't know about Capacitor - looks interesting. What would you prefer? I once did a small app with react-native as well and it went alright :)

I didn't think of turning it into a SaaS 🤔 I thought of keeping it free and relying on donations if it gets bigger. What's your opinion on this? Do you have an idea on how to turn it into a SaaS?

Snouzy commented 1 year ago

I Never used capacitor with next.js but i guess it could be ok - and it's easy to learn => Capacitor is a lot of configuration, but we'll don't need to write the app for a 2nd time. Practically it's just a wrapper around the webapp => ReactNative more code, less configuration

Yeah I guess donations could work in this field too, because people are grateful when they realized that it was a great workout. But I don't know how much they can thank u

Maybe we could try both... donation first btw ahah, because SaaS include some extra devs : Here are my ideas to turning it into a SaaS :

Vincenius commented 1 year ago

Capacitor sounds interesting - I'll check it out!

Another idea I just had: we could also show ads or affiliate links for workout equipment and offer a "supporter" membership without ads. It could be a small, fixed price or a pay-what-you-want model

Snouzy commented 1 year ago

Yeah, keep me posted

😲 very nice idea i love it.

Vincenius commented 1 year ago

I will! Btw, I'd also share the profit if there will be any, bc you're also putting in quite some work 😄 but I guess there won't be any anytime soon

Snouzy commented 1 year ago

oh, yeah, didn't initially joined for this but yeah that encourage me for sure, who don't love money.

Appreciate it a lot 💪😇

Vincenius commented 1 year ago

I just quickly looked into Capacitor and it looks really nice! I think this is a good option. It can't call the nextjs api routes so we need to find a way to configure it to use the prod domain for the api. But it already looked good after the initial setup

Screenshot 2023-06-14 at 15 20 54

Snouzy commented 1 year ago

Waw, that's beautiful ! GJ 😍

mh, i see, this thread seems to be interessant.. https://github.com/mlynch/nextjs-tailwind-ionic-capacitor-starter/issues/4

Snouzy commented 1 year ago

just thinking, had a similiar issue, android simulator couldn't fetch my symfony localhost backend in a react native project.

I finally figured out that was because the simulator is completly isolated and has his own localhost, so i should use the 10.0.2.2 when launching on android This is a special alias which point to localhost

=> Did you try to say the server url of capacitor config to 10.0.2.2:3000 ?

Vincenius commented 1 year ago

The problem was that capacitor uses the static nextjs export which doesn't export the API routes. I could solve it by calling the production API (workout.lol/api/...) and adding CORS to the endpoints. Still some work to do but it looks good already :)

https://github.com/Vincenius/workout-lol/assets/43953403/ca36ea09-2475-4c2e-843e-79e235fa33a5

Vincenius commented 1 year ago

I am closing this and will open two other tickets - one for a native app and one for a pwa