Linux challenges with the Flutter game

The architecture of this is all Flutter and Dart running on a Ubuntu Linux box. There are two pure Dart programs- one to create the game setup and one to do the processing. The first is run manually, the second by crontab. Then there’s the Flutter web app.
The Flutter web app has to read and write files from the file system which of course it can’t do directly. I’ve created a backend of sorts using PHP. There’s an API; it works but not without issues. If you’re calling a PHP script from a Flutter app, what is the URL? It depends.
Say the URL is /file?params where I’ve modified .htaccess to pass /file urls onto a PHP script.
If I want to test this on the box in a browser I have to call localhost/file?params but in a Dart program running on the box it just calls /file?params.
The next problem is where are the game files stored. The setup program doesn’t really care. Any location will do so long as it doesn’t need to run elevated. But the web app is limited to /var/www/html – it’s running under Apache on a linux box. In the end I created a folder under /var/www/game and each game is stored under there. PHP can read mostly anywhere, not just in /var/www/html and this provide a little extra security.
However there’s the not-so slight issue of permissions. The setup program runs under my login – call it user. So files are created owned by user user. The web app runs under www-data so to keep things simple, I’ve set permissions to user:www-data so both can access it. It’s a bit of a faff.
Here’s a tip. If you are developing a Flutter web app, develop it on Linux and do development as a Linux app. It’s far quicker building and launching a Linux app than it is the web app.
I run Ubuntu in a hyper-V session. It works very well and handy for getting screenshots. I’ve been using a 24.04 LTS for a while and decided I needed another one to test CyberPanel. i already have Webmin on my main one so wanted a clean Ubuntu so as not to mess Webmin. It took ten minutes to setup then another 20 minutes to install 300+ updates.
This is the 

When I first started with VS Code on Linux, I found the C/C++ configuration somewhat confusing. I blundered through, wasted a bit of time and got there in the end. After a gap of a couple of years I did the same again recently on Raspberry Pi. It’s clearer in my mind now so I thought I’d explain it here. This works for Ubuntu, Raspberry Pi OS and should for most other Linuxes. (Not that I’ve tried them all…)
Now look in that folder and you’ll see c_cpp_properties.json.




I’ve been a Windows developer since the late 1990s and I got into Linux about 2008. I’m still a Windows developer but now that .NET applications can run on Mac and Linux as well as Windows, it makes it easier to write software in C# that runs on Linux. Using a Linux VPS is probably the cheapest way to do that.
Thanks to suggestions in the Reddit CSharp subreddit (you can view the entire thread
So I’ve been doing some .NET programming. First on Windows because I can debug it there then “Publish it” which puts all the files (compiled in release) needed, including any dlls into one folder and upload it to a VPS using WinSCP. I’ve also got a terminal session connected by Putty. I use Serilog for logging and SkiaSharp for graphics.