Hexlet / hexlet-cv

Stackoverflow for Resume
https://cv.hexlet.io
GNU Affero General Public License v3.0
96 stars 108 forks source link
hacktoberfest

Hexlet CV

Maintainability Test Coverage Main

About

The purpose of Hexlet CV is to provide a community platform where you get resume recommendations from community members and professional HR.

Interactions on Hexlet CV are based on resumes and resume recommendations. On a particular resume, each community member provides only one recommendation.

Join the community, post resumes and leave recommendations for other members. Tell your colleagues and friends about the site!

The project uses Ruby on Rails.

Tasks can be discussed in the Telegram community.

System requirements

Setup

make setup

# or for Apple silicon machine if setup fails with unsupported arch

make setup-arm64

make test # run tests
make start # run server http://localhost:3000

make fixtures-load # sometimes, when fixtures were changed

Setup in Docker

make compose-setup # setup app
make app-test # run tests
make compose # run server http://localhost:3000

make app-ci-check # run ci

Debug in Docker

docker container ls # watch container
docker attach [container_id]

or

make app-debug

and insert debugger in controller

Setup in Podman

Dependencies: podman, podman-compose

If you have installed podman-docker, you can use, directly, make compose-* commands (except make app-debug)

Or explicitly use the make podman-compose-* commands.

make podman-compose-setup # setup app
make podman-compose-app-test # run tests
make podman-compose # run server http://localhost:3000

make podman-compose-app-ci-check

Debug in Podman

podman container ls # watch container
podman attach [container_id]

or

make podman-compose-app-debug

and insert debugger in controller

Deploy

Add database:

heroku addons:create heroku-postgresql:hobby-dev

Prepare environment variables:

heroku config:set SECRET_KEY_BASE=$(rake secret)
heroku config:set HOST=$(heroku info -s | grep web_url | cut -d= -f2) # https://cv.hexlet.io for production
heroku config:set RACK_ENV=production
heroku config:set RAILS_ENV=production
heroku config:set RAILS_LOG_TO_STDOUT=enabled
heroku config:set EMAIL_FROM=support@hexlet.io

Deploy to render.com

INFO IS HERE * Go to https://dashboard.render.com * Add New PostgreSQL with YOUR_CUSTOM_NAME_PG and select Region * Add New Web Service with link to your repo clone\ select: * YOUR_CUSTOM_NAME_CV * same Region * Runtime: Ruby * Build Command - `./bin/render-build.sh` * Start Command - `./bin/render-start.sh` or `bundle exec puma -C config/puma.rb` * Go to YOUR_CUSTOM_NAME_PG PostgreSQL -> Info and copy `Internal Database URL` * Go to YOUR_CUSTOM_NAME_CV app -> Environment * Environment Variables, by one\ or * Secret Files .env with your settings, based on .env.example and add this variables: * HOST ```shell echo "HOST=your-app-name.onrender.com" >> .env ``` * EMAIL_SPECIAL_USER ```shell echo "EMAIL_SPECIAL_USER=any_existing_email@in_database" >> .env ``` * DATABASE_URL ```shell echo "DATABASE_URL=Internal Database URL" >> .env ``` * RACK_ENV and RAILS_ENV ```shell echo "RACK_ENV=staging" >> .env echo "RAILS_ENV=staging" >> .env ``` * RENDER_LOAD_FIXTURES to load fixtures ```shell echo "RENDER_LOAD_FIXTURES=1" >> .env ``` Generate new master.key if the original is missing * RAILS_MASTER_KEY ```shell export RAILS_MASTER_KEY="$(ruby -r securerandom -e 'print SecureRandom.hex(16)')" echo $RAILS_MASTER_KEY printf $RAILS_MASTER_KEY > config/master.key echo "RAILS_MASTER_KEY=$RAILS_MASTER_KEY" >> .env rm config/credentials.yml.enc EDITOR=vim bin/rails credentials:edit # to update config/credentials.yml.enc # press :wq+Enter ``` * CREDENTIALS_ENC ```shell echo "CREDENTIALS_ENC=$(cat config/credentials.yml.enc)" >> .env ``` * You can deploy app

Configure reCAPTCHA for production:

Configure reCAPTCHA for development:

# test key for recapcha https://github.com/MTG/freesound/issues/879
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
Label: <app_name>.herokuapp.com
Type reCAPTCHA: reCAPTCHA v2 (Checkbox "I'm not a robot")
Domains: <app_name>.herokuapp.com (localhost or/and 0.0.0.0 for development env)

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.

See most active contributors on hexlet-friends.