naturalcrit / homebrewery

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

[Documentation] Readme update #2617

Closed 5e-Cleric closed 1 year ago

5e-Cleric commented 1 year ago

Your idea:

I installed the local version of HB, and had a hard time doing so, even following the set of steps on the readme, for that reason i'm going to review those steps, see where programs have changed, and add beter explanations when i can, this is related to the issue #1896.

Anyone who wants to help is invited to do so.

5e-Cleric commented 1 year ago

Right now the readme instructions look as follows:

Quick Start

The easiest way to get started using The Homebrewery is to use it on our website. The code is open source, so feel free to clone it and tinker with it. If you want to make changes to the code, you can run your own local version for testing by following the installation instructions below.

Installation

First, install three programs that The Homebrewery requires to run and retrieve updates:

  1. install node

  2. install mongodb (Community version)

    For the easiest installation, follow these steps:

    i. In the installer, uncheck the option to run as a service. ii. You can install MongoDB Compass if you want a GUI to view your database documents. iii. Go to the C:\ drive and create a folder called "data". iv. Inside the "data" folder, create a new folder called "db". v. Open a command prompt or other terminal and navigate to your MongoDB install folder (C:\Program Files\Mongo\Server\4.4\bin). vi. In the command prompt, run "mongod", which will start up your local database server. vii. While MongoD is running, open a second command prompt and navigate to the MongoDB install folder. viii. In the second command prompt, run "mongo", which allows you to edit the database. ix. Type use homebrewery to create The Homebrewery database. You should see switched to db homebrewery. x. Type db.brews.insert({"title":"test"}) to create a blank document. You should see WriteResult({ "nInserted" : 1 }). xi. Search in Windows for "Advanced system settings" and open it. xii. Click "Environment variables", find the "path" variable, and double-click to open it. xiii. Click "New" and paste in the path to the MongoDB "bin" folder. xiv. Click "OK" three times to close all the windows.

  3. install git (select the option that allows Git to run from the command prompt).

Checkout the repo (documentation):

git clone https://github.com/naturalcrit/homebrewery.git

Second, you will need to add the environment variable NODE_ENV=local to allow the project to run locally.

You can set this temporarily in your shell of choice:

Third, you will need to install the Node dependencies, compile the app, and run it using the two commands:

  1. npm install
  2. npm start

You should now be able to go to http://localhost:8000/ in your browser and use The Homebrewery offline.

5e-Cleric commented 1 year ago

For starters, i ran into more than 5 different errors just by configurating mongodb, so i'll list a few resources that were useful, even though they may be old:

5e-Cleric commented 1 year ago

Then, in order to fix these errors one of the things i had to do was to move steps xi to xiv before step viii

There is also not explained how to set Node_env=local permanently, which i think should be.

5e-Cleric commented 1 year ago

With those fixes:

Quick Start

The easiest way to get started using The Homebrewery is to use it on our website. The code is open source, so feel free to clone it and tinker with it. If you want to make changes to the code, you can run your own local version for testing by following the installation instructions below.

Installation

First, install three programs that The Homebrewery requires to run and retrieve updates:

  1. install node, any version is supported.

  2. install mongodb (Community version)

    For the easiest installation, follow these steps:

    1. In the installer, uncheck the option to run as a service.
    2. You can install MongoDB Compass if you want a GUI to view your database documents.
    3. If you install any version over 6.0, you will have to install MongoDB Shell.
    4. Go to the C:\ drive and create a folder called "data".
    5. Inside the "data" folder, create a new folder called "db".
    6. Open a command prompt or other terminal and navigate to your MongoDB install folder (C:\Program Files\Mongo\Server\6.0\bin).
    7. In the command prompt, run "mongod", which will start up your local database server.
    8. While MongoD is running, open a second command prompt and navigate to the MongoDB install folder.
    9. Search in Windows for "Advanced system settings" and open it.
    10. Click "Environment variables", find the "path" variable, and double-click to open it.
    11. Click "New" and paste in the path to the MongoDB "bin" folder.
    12. Click "OK" three times to close all the windows.
    13. In the second command prompt, run "mongo", which allows you to edit the database.
    14. Type use homebrewery to create The Homebrewery database. You should see switched to db homebrewery.
    15. Type db.brews.insert({"title":"test"}) to create a blank document. You should see WriteResult({ "nInserted" : 1 }).
    16. If you use any version older than 6.0, use db.brews.insertOne({"title":"test"}) instead. You should see { acknowledged: true, insertedId: ObjectId("63c2fce9e5ac5a94fe2410cf") }
  3. install git (select the option that allows Git to run from the command prompt).

Checkout the repo (documentation):

git clone https://github.com/naturalcrit/homebrewery.git

Second, you will need to add the environment variable NODE_ENV=local to allow the project to run locally.

You can set this temporarily in your shell of choice:

If you want to add this variable permanently the steps are as follows:

  1. Search in Windows for "Advanced system settings" and open it.
  2. Click "Environment variables".
  3. In System Variables, click "New"
  4. Click "New" and write NODE_ENV as a name and local as the value.
  5. Click "OK" three times to close all the windows. This can be undone at any time if needed.

Third, you will need to install the Node dependencies, compile the app, and run it using the two commands:

  1. npm install
  2. npm start

You should now be able to go to http://localhost:8000 in your browser and use The Homebrewery offline.

If you had any issue at all, here are some links that may be useful:

If you still have problems, post in Our Subreddit and we will help you.

G-Ambatte commented 1 year ago

While it would add an extra application to the process, using Chocolatey could potentially greatly reduce the difficulty of installing Homebrewery on a Windows machine - potentially making it as simple and scriptable as Ubuntu/Debian.

5e-Cleric commented 1 year ago

While it would add an extra application to the process, using Chocolatey could potentially greatly reduce the difficulty of installing Homebrewery on a Windows machine - potentially making it as simple and scriptable as Ubuntu/Debian.

I ended up using docker and made the process way easier.