many-realities-studio / realityflow-old

GNU Affero General Public License v3.0
2 stars 1 forks source link

Pull request fixes from previous repository - Implement dashboard to tail server logs #1

Closed Iminance closed 3 years ago

Iminance commented 3 years ago

Small server.ts fixes for JSON stringification Update types/node dependency to fix tsc error Add database/prod.db to .gitignore

Instructions for launching/testing the dashboard:

  1. Open a bash terminal in the root realityflow_2 directory.
  2. cd into the Server folder.
  3. Run npm i to install the dashboard dependencies.
  4. Run tsc to compile the server.ts file into a .js file.
    • If attempting to run tsc does not work, make sure typescript is installed globally. If not, run npm install -g typescript
  5. cd .. back out into root directory.
  6. cd into the dashboard folder.
  7. Run npm i to install the dashboard dependencies.
  8. If you have a node_modules folder in the root directory, delete it.
  9. cd .. back out into root directory.
  10. To run the server, first check if any pm2 instances are already running with pm2 status. If so, use pm2 delete <id> to delete the process.
    • If attempting step 10 caused an output of pm2 command not found, install pm2 globally by running npm i -g pm2 and try again.
  11. Run pm2 start ecosystem.config.js and then run pm2 log 0. If successful, you should see something like the following in your terminal: image
  12. cd into the dashboard folder again and run npm start to start one instance of the dashboard. You should now see the following in the browser: image
  13. Open a new terminal and cd into the dashboard folder again. Run npm start again to start a second instance of the dashboard for testing purposes. The terminal will ask you to run it on another port since the first dashboard is already running. Type Y and hit enter to start the second dashboard app. You should now see this output on the first dashboard browser tab: image If you see the above image in your browser for the first instance of the dashboard, the dashboard is properly tailing the server's logs.