uri-planetarium / interactive-planetarium-ERAU

0 stars 0 forks source link

Interactive Planetarium Project ERAU
- Player Side -

The goal of this project is to make an interactive web application for the ERAU Prescott Campus Planetarium

The application will be hosted on the cloud and will support up to 50 audience members participating in an interactive activity


- How to use -

Border


For Development

1. Clone the Github Repo

  git clone https://github.com/uri-planetarium/interactive-planetarium-ERAU.git

2. Install npm dependencies

Be sure to do this in the root directory and the player_client folder.

  npm install

3. Setup Postgres

Setup Postgres if you haven't already. Here's a link that might be helpful for this process.

  sudo apt install postgresql postgresql-contrib

Then create the database and tables. These commands can be found in database.sql in the root folder. Be sure to create the database first then create the tables within it.

4. Declare your environment variables

The .env file should be placed in the root directory.

  PG_USER = your_username
  PG_PASSWORD = your_password
  PG_HOST = localhost
  PG_DATABASE = planetarium_uri_db
  PG_PORT = 5432

5. (Optional) Install nodemon

This allows you to write code for the server and have it automatically refresh each time.

  npm install -g nodemon

6. Start the App

In the root directory...

  npm start

The above can be replaced with nodemon index.js if you installed that.

In the player_client folder...

  npm start

React's default start script automatically updates when you make changes.


For Production

1. Install Heroku

First install snap.

  sudo apt install snapd

Then install and login to Heroku's CLI. Here's Heroku's initial setup page for reference.

  sudo snap install --classic heroku

  heroku login

heroku login opens up a login webpage. If working in a virualbox, heroku login -i will allow you to sign in through the terminal.

- The below is no longer necessary - 
- Recent Changes have allowed pushing to the main branch to automatically deploy changes to Heroku -

2. Git remote the Heroku Github Repository

  heroku git:remote -a erau-interplanet-player

3. Sync the pushes to both Github Repositories

Syncing the pushes between this Github repository and the Heroku one allows you to push your code once and update both repositories.

  git remote add both https://github.com/uri-planetarium/interactive-planetarium-ERAU.git
  git remote set-url --add --push both https://github.com/uri-planetarium/interactive-planetarium-ERAU.git
  git remote set-url --add --push both https://git.heroku.com/erau-interplanet-player.git

When pushing changes, git push both will push committed changes to both repositories.


- Diagrams -

Border

Web UI-API Interactions (Subject to change)


Socket.io Room Connections (Subject to change)


Postgres Table Relationships (Subject to change)