Installation Guide for Windows
Setting Up the Database - MongoDB Setup
Step 1: Download the MongoDB Community Server from here:
https://www.mongodb.com/download-center/community. Select 'ZIP' from 'Package' option.
Step 2: Once downloaded, extract the folder to somewhere permanent, for example in Local Disk (C:).
Step 3: The name of the folder will be something like this: 'mongodb-win32-x86_64-2012plus-4.2.6'. Rename it to something similar like 'mongodb'.
Step 4: Now create a new folder in the same location where you have extracted folder in previous step (Not inside previous folder but in the exact location i.e. Local Disk (C:). This folder will be used to save database so name it something like 'mongodb-data'.
Step 5: Now head over to your command prompt. Run this command:
C:/mongodb/bin/mongod.exe --dbpath=/mongodb-data
Note that the command starts with the location of your folder followed by folder name and then /bin/mongod.exe command. Then provide space for --dbpath flag. Don't provide space after '=' and your database path should start immediately after equals to. You don't have to mention root folder i.e. C:\ in dbpath. So if your database folder is in Users folder which is located in C:\ then your dbpath shall be: --dbpath=/Users/mongodb-data.
Step 6: Console will output lots of data once you but somewhere 8-9 lines from bottom, you will see this output:
If you see this command then your database has been setup accurately and you are ready to run your dice script now.
Dice Script Setup
Step 1: Open new command prompt window. Don't stop the function in first window or close the first window else mongodb running on your system will stop.
Step 2: If git is installed on your system then run this command in second window:
git clone https://github.com/web-tricks/dice
Else head to
https://github.com/web-tricks/dice and download the code in ZIP format and extract where ever you want.
Step 3: Once github is done cloning or you have extracted folder on your computer, open folder in your command prompt. If you clone using command above, you simply have to write 'cd dice' to enter dice folder.
Step 4: Once you enter the dice folder, run 'npm install' command to install all packages needed for the script to run.
Step 5: Once all packages have been installed (it will take 1-2 minutes max), run 'npm run dev' command to run the script locally on your system.
Step 4: If you see the message 'Listening on 3000', it means you have correctly set up the script. The message will be something like this:
Now head to your browser and open:
localhost:3000 and you will see the local implementation of your script. Any other doubt, do ask in this thread. Thanks!