Search code examples
javascriptweb-applicationslocal-storagelocal

How to distribute a web application to be run locally?


I would like to make a choose-your-own-adventure type of game, and since the game consists only of formatted text with images, I think it makes sense to make it with HTML/CSS and Javascript. However I don't want to maintain a web server, what I'd like to do is give the game to the users for them to run locally.

I don't have much (if any) experience in web development, so this is probably a naive question, but I couldn't find how to do it (search results were polluted with something called "serverless" which --- if I understand correctly --- is a web development paradigm that relies on the use of many servers).

The difficulty is in saving the player's progression which poses the following problems:

  • it seems that the user has to run a local web server for local storage to work. When I play local web games (e.g. Twine games) I usually run python -m http.server in the game's folder, but I'd rather not assume all users know how to do that.
  • I don't know how to make the stored data specific to my application: local storage is tied to the domain, so if the app is served on localhost:8888 for instance, there is a risk that other apps served on the same port could access it and overwrite it by accident.

Solution

  • You can use ElectronJs https://www.electronjs.org/ for example. (Read this https://www.reddit.com/r/incremental_games/comments/6zfs4z/electronbased_games/ for more informations). And good luck in your Game creator journey !