Skip to content

Run‐Guide Before Running the Project 🚀

Hagar Usama edited this page Dec 7, 2024 · 1 revision

Before Running the Project 🚀

Project Configuration ⚙️

In order to run the project successfully, some configurations need to be set up first. Follow the steps below to configure the project.

  1. Navigate to the .env file in the project root directory. (if not found, create it)
  2. You should see a configuration that looks similar to the following:
# Tunnel configuration for webhook
TUNNEL_HOST="9657cfb8becc1e051dc626c659d020a7.serveo.net" # replace with your tunnel address
TUNNEL_HOST_IP="138.68.79.95" # replace with your tunnel IP address

# Tito API Configuration
TITO_API_BASE="https://api.tito.io/v3" # leave as-is
TITO_ACCOUNT_SLUG="hagar-usama" # replace with your account slug
TITO_EVENT_SLUG="delta-spectres" # replace with your event slug

# Tito Webhook Configuration
TITO_WEBHOOK_SECRET="susxWOaiWxt4iQcFphPhNa" # replace with your webhook secret
TITO_TOKEN="secret_test_yMie7JQ74JNcmyyRjfKj" # replace with your token secret

# Mailer Configuration for email verification
MAILER_EMAIL="example@gmail.com" # replace with your mail (should be gmail)
GMAIL_APP_KEY="pelo ugrc yrwu qsig" # replace with your gmail app key

# Postgres Configuration
QUICKET_DATABASE_NAME="quicket_development" # leave as-is
QUICKET_DATABASE_USERNAME="postgres" # leave as-is
QUICKET_DATABASE_PASSWORD="password123" # leave as-is

Tunnel Configuration for Webhook ⚓

To establish a connection with Tito's webhook, you will need a public address instead of using localhost. You can use ngrok or another suitable service. In this guide, we are using serveo.net.

Steps to Set Up Tunnel Configuration:

  1. Generate the Tunnel Address:

    • Refer to the Tunneling Guide to generate the forwarding address using serveo.net.
  2. Assign the Tunnel Address:

    • Once you have the address, assign it to the TUNNEL_HOST variable in the .env file.
    • Note: Make sure to remove the https:// prefix from the address.

    Example:

    TUNNEL_HOST="9657cfb8becc1e051dc626c659d020a7.serveo.net"
  3. Get the Tunnel IP Address:

    • Open your terminal and run the following command to find the IP address of your tunnel:
      nslookup <TUNNEL_HOST>
    • Replace <TUNNEL_HOST> with the actual tunnel host you generated.
    • Copy the resulting IP address and assign it to the TUNNEL_HOST_IP variable in the .env file.

    Example:

    TUNNEL_HOST_IP="138.68.79.95"

Tito API Configuration 🎟️

Note: You can skip this configuration step for now, as the necessary configuration and credentials will be provided to you.

Steps to Set Up Your Tito Account and Event:

  1. Create a Tito Account:

    • If you don't already have a Tito account, create one here.
    • During account creation, you will be asked to select an account name. This will be your TITO_ACCOUNT_SLUG, so make sure to choose it carefully.
  2. Create an Event:

    • Once your account is set up, you can create an event on Tito.
    • Assign the event's name to the TITO_EVENT_SLUG in your .env file.
  3. Event Configuration:

    • After creating the event, make sure to configure it as needed for your project.
    • Ensure that all tickets are marked as free and test data is enabled, allowing you to test the event thoroughly before going live.
  4. Reference Documentation:


Tito Webhook Configuration ⚓

To configure the Tito webhook, follow these steps:

  1. Go to the Tito Webhook Settings:

    • Visit the following URL to access your webhook settings:
      https://dashboard.tito.io/<account-slug>/<event-slug>/settings/webhook_endpoints/
      
  2. Copy the Security Token:

    • On the page, you’ll see a section titled "Your security token is ...".
    • Copy the security token and assign it to the TITO_WEBHOOK_SECRET in your .env file.
  3. Create or Edit a Webhook:

    • To add a new webhook, click the New Webhook button.
    • Alternatively, if the TUNNEL_HOST has changed, you can edit an existing webhook.
  4. Set the Webhook URL:

    • In the URL field, set it to https://<tunneling-url>/webhooks/tito (replace <tunneling-url> with the one provided by your tunneling service).
  5. Select the Trigger Events:

    • Choose the following trigger events:
      • ticket.created
      • ticket.updated
  6. Save Your Changes.

Webhook Endpoint Creation in Tito

Mailer Configuration for Email Verification 📧

This configuration allows the app to send confirmation emails for newly registered users. Follow the steps below to set it up:

  1. Assign Your Gmail for Email Confirmation:

    • In the .env file, assign the Gmail address you want to use for sending confirmation emails to the MAILER_EMAIL variable.
      MAILER_EMAIL="example@gmail.com" # replace with your Gmail
  2. Create a Gmail App Password:

    • To securely connect the app to Gmail, you need to generate an App Password for the Gmail account you assigned to MAILER_EMAIL.
    • Note: Two-Factor Authentication (2FA) must be enabled on your Google account in order to generate an app password. If 2FA is not enabled, you will not be able to proceed.
    • Once 2FA is enabled, follow these steps:
      • Visit Google App Passwords.
      • Sign in with your Gmail account.
      • Select App and choose Other (Custom name) from the dropdown.
      • Enter a name (e.g., Quicket) and click Generate.
      • You will receive a 16-character app password.
  3. Assign the Generated App Password:

    • Copy the generated app password and assign it to the GMAIL_APP_KEY variable in your .env file.
      GMAIL_APP_KEY="pelo ugrc yrwu qsig" # replace with your Gmail app password

Now, All Configurations Are Done! 🎉🎉