okaufmann / laravel-web-money-manager-ex

5 stars 1 forks source link

Webhosting requirements #90

Open gabriele-v opened 6 years ago

gabriele-v commented 6 years ago

Hi @okaufmann, I'm reviewing your fork of web money manager ex: unfortunately I hadn't time to install and test it yet, but few question on webserver requirements:

I would like to keep it as simple as possible, to let users (also without many web hosting knowledge) install and use it. Obviously it will be different if we can offer a hosted multi-tenant version of web app, but actually it's not planned yet.

okaufmann commented 6 years ago

is it possible to make it compatible with older versions of PHP? At least PHP 5.6 will be nice

I rewrote it to be able to benefit of the Laravel community and all its packages. Also, I am not a fan of supporting old versions. Even PHP v7.0 security updates support will be dropped this december (http://php.net/supported-versions.php). I think about adding support bots, as asked in https://github.com/moneymanagerex/moneymanagerex/issues/1453 and with Laravel this will be a lot easier 😁. The version of Laravel used, has LTS till next summer. So no, it is not possible to support PHP 5.6. Rather support of PHP 7.0 will be dropped at the latest this december...

is it possible to switch database to sqlite instead of MySql? Cheapest hosting doesn't have MySql available but Sqlite it's still usable. It will be easier to setup too because no credentials are needed

Sure, As Laravel supports sqlite, mysql and more it is possible to use all DB systems Laravel supports (https://laravel.com/docs/5.5/database).

is it possible to have a "zip package" that can be uploaded and then immediately usable?

If more people want to use my rewirte, I can setup automatic CI/CD Pipeline with regular zipped releases to be uploaded to a webhosting. (note that the hosting must target the public folder and not the root of this project)

Obviously it will be different if we can offer a hosted multi-tenant version of web app, but actually it's not planned yet.

This is already supported! I've implemented it with multiuser and use it with my colleagues already. A public version will not be accepted, I think there are not much people want to have their financial transactions on a foreign hosting... If you know a hosting-sponsor, we can discuss this further.

Let me know if you think about accepting a PR :)

gabriele-v commented 6 years ago

Thank you for the replies, agree on PHP 7.0, I was remembering 2019 as end of support, but if it's this year, it's ok to drop it.

Regarding Sqlite I think that should be the default choice, than documentation will explain how to use MySql if user want to use it.

For Zip packages I think it's enough to have them ready here on GitHub, than users can download them and upload via FTPon their hosting. Composer it's nice but majority of shared hosting doesn't allow it.

Regarding multi-tenant I agree for privacy, but if everything it's already ready we could give it a try.

I'll test it soon (work permitting), keep in touch!

okaufmann commented 6 years ago

For Zip packages I think it's enough to have them ready here on GitHub, than users can download them and upload via FTPon their hosting. Composer it's nice but majority of shared hosting doesn't allow it.

Yes, thats why I think about to add a release job that installs composer deps and pack it into a zip and add it to the release on github. Then it would be possible to get the latest zip and just upload it (of course with sqlite as the default DB driver ;))

I'm looking forward to your feedback.

gabriele-v commented 6 years ago

I've installed it with composer, set up DB and I'm able to see login screen but CSS files are unreachable because I've put WebApp in a subfolder (IE: http://mydomain.com/WebApp). I've tried to set 'url' => env('APP_URL', 'http://localhost/WebApp/'), but still not working.

I haven't so much experience with Laravel, is anything else that I need to do in order to make it working?

Thanks

okaufmann commented 6 years ago

Hi,

You could find some tips here: https://laravel-news.com/subfolder-install

I'm never running Laravel in a Subfolder, since its not recommended (There was a Post with arguments about this I couldn't find right now, sorry you have to trust me ;)).

To run it locally I always use https://laravel.com/docs/5.6/valet. If you are on Windows there is a port: https://github.com/cretueusebiu/valet-windows

hope this helps :)

Regards

gabriele-v commented 6 years ago

This is a reason why I haven't used a framework: a simple task like put it in a subfolder, becomes a pain. Considering that "public/hosted" version won't be preferred, installation and configuration should be stupid simple.

Also, seems that with Laravel you need to expose on the webserver only the public folder, this generally isn't possible with shared hostings where you can just put everything in public_html folder.. We should provide a valid .htaccess file for them

gabriele-v commented 6 years ago

Seems that problem is related to how CSS/JS file links.

They should be css/app.css instead they are /css/app.css

I've solved it replacing all mix with assets in resources/views/layouts/app.blade.php but I don't know if it has some others side effects.

<link href="{{mix('css/vendor.css')}}" rel="stylesheet">
<link href="{{asset('css/vendor.css')}}" rel="stylesheet">
gabriele-v commented 6 years ago

Do I need to manually create DB? I have error Table 'MMEX_WebApp.users' doesn't exist

okaufmann commented 6 years ago

You just habe to create the db file under database/database.sqlite.

After that you can run php artisan migrate --seed to create the Database structure.

Sorry for my late response.

okaufmann commented 6 years ago

I am aware that the use of Laravel brings a little more complexity. Nevertheless, I am convinced that extensions will ultimately be easier and faster to implement. I think that the installation only needs to be well documented to ensure an easy start on a shared hoster.