Deploying Your Project

Scenario: You’ve developed a trackjs/javascript-gameshow project and are now ready to make it accessible to others. In this guide, we’ll walk you through the process of deploying your project using the run deploy command as described in the project documentation.

First, ensure that you have the necessary prerequisites installed:

  1. Node.js and npm: Download and install Node.js and npm from https://nodejs.org/en/download/.
  2. Firebase CLI: Install Firebase CLI by running npm install -g firebase-tools in your terminal.

Now, navigate to your project directory:

cd audience-app

Next, verify that your package.json file includes the following scripts:

"scripts": {
"deploy": "npm run use:project && firebase deploy"
}

The deploy script consists of two parts:

  1. npm run use:project: This command is used to prepare the project for deployment by using the firebase command and applying the javascript-gameshow target.
  2. firebase deploy: This command deploys the project to Firebase Hosting.

To deploy your project, simply run the following command:

npm run deploy

This command will execute the deploy script, which in turn will run npm run use:project followed by firebase deploy. The firebase deploy command will prompt you to log in to your Firebase account if you’re not already logged in. Once logged in, it will deploy your project to Firebase Hosting.

You can verify the deployment by visiting the URL provided in the terminal output after the deployment is complete.

Tests:

  1. Run npm run deploy and verify that the project is deployed successfully.
  2. Visit the deployed URL and ensure that the project is accessible and functioning correctly.
  3. Make changes to the project and repeat the deployment process to verify that the changes are reflected in the deployed version.