elitexpro / Qualifier.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

Setup postgres

  • Create postgres user qualifier. Give it superuser.
    • Create databases qualifier_development and qualifier_test, having given grant all privileges to the qualifier user
  • Unless you provide your own DATABASE_URL and TEST_DATABASE_URL, you need the server running at 5433

clamav

  • install clamav (update freshclam db, create directories (chmod 777) and make your user the owner of directories
  • run clamd

Redis and seed

  • Set up redis
  • rails db:seed

Testing

Run full test suite: bundle exec rails test

Adding images

Tests will fail when adding new images. In webpacker.yml, change test.compile to true for one run to compile the manifest, then change it back to false for faster testing.

Development

Log in in development:

http://localhost:3000/session/log_in_in_development

New funnel user (registration):

http://localhost:3000/session/new_funnel_user

Important modules

  • CRM - nightly (most often) harvesting of CRM:s
  • DataImport - this modules handles incoming scraped data. Normalization of data and creation of necessary records
    • DataImport::ImportProspect - Creates the necessary Prospects, Companys, BotsProspects etc. Calls FindEmailAddresses if necessary
  • FindEmailAddresses - Uses a variety of ways and sources to generate, validate and create EmailAddresses for prospects.
  • Inbox - crawls our users' inboxes for responses and bounces, marking them accordingly
  • Reachable - determines whether a prospect is contactable (for a first email, or a follow-up) depending
  • SendEmails - handles application of templates, creation of email bodies and in the end the actual sending of the emails

Services used

Production

  • DB (10.63.0.205) - Google Cloud SQL - Postgres
  • Sidekiq persistent Redis (10.0.0.36) - Google Memorystore
  • App (35.204.88.17) - Google Compute Engine (puma and cache redis)
  • Sidekiq (35.214.238.12) - Google Compute Engine (sidekiq)

App server (35.204.88.17)

On the app server, we run puma and a redis instance for caching

Sidekiq dashboard: https://qualifier.ai/sidekiq

Shortcuts

  • qf - navigate to the current production folder
  • rc - start a production rails console (doesn't require being in the right folder)

Logs

/var/www/qualifier/shared/log contains rails and puma logs

nginx

  • etc: /etc/nginx/
  • logs: /var/log/nginx

Upgrading Ruby version

  • Install locally ex rbenv install 3.2.0
  • Update in Gemfile
  • Update in .ruby-version
  • Update in config/deploy.rb
  • Update in .circleci/config.yml
  • Install on Sidekiq and app server:
    • rbenv global 3.2-jemalloc
    • sudo apt install fullstaq-ruby-3.2-jemalloc

About


Languages

Language:Ruby 88.5%Language:JavaScript 5.2%Language:HTML 4.8%Language:TypeScript 0.7%Language:SCSS 0.6%Language:CSS 0.1%Language:Makefile 0.0%Language:Dockerfile 0.0%Language:Shell 0.0%Language:Procfile 0.0%