naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.04k stars 317 forks source link

[LOCAL]: Flat File Structure #1926

Open G-Ambatte opened 2 years ago

G-Ambatte commented 2 years ago

Rather than saving documents to a MongoDB collection, some users in the past have requested that they would prefer to save to a local text file. Some have suggested placing these files in their own separate Git repository/sub-module to allow for versioning of their files, e.g. #346, #808.

I would suggest that we create a save system that will create files locally, but contain this behind a process.env.NODE_ENV == 'local' check so that it only applies to users who are running local installs.

calculuschild commented 2 years ago

I think setting up a local text file save would be fine, especially now that we have metadata embedded into the brews themselves. However we still want local installs that can work with MongoDB for development. So perhaps we could rename the current local environment variable to dev or something, and then local would be just a self-contained to use the local file system?

G-Ambatte commented 2 years ago

One option would be to change the Google icon from a toggle (Mongo/Google) to a dropdown (Mongo/Google/Local).

This dropdown option could also be extended as additional storage options are incorporated. This could be added to the UserInfo framework as an accountwide default setting, once that PR is completed.

G-Ambatte commented 2 years ago

Issue #1101 appears to be a similar request to save to a Github repository, although I suspect that the intent there was to be able to do so from the production website rather than a local install.