Giter Site home page Giter Site logo

hexlet / hexlet-cv Goto Github PK

View Code? Open in Web Editor NEW
95.0 8.0 108.0 4.31 MB

Stackoverflow for Resume

Home Page: https://cv.hexlet.io

License: GNU Affero General Public License v3.0

Makefile 1.03% Ruby 70.76% JavaScript 1.79% HTML 1.23% Shell 0.33% SCSS 0.14% Slim 24.59% Procfile 0.03% Dockerfile 0.11%
hacktoberfest

hexlet-cv's Introduction

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

  • Ruby >= 3.3.0
  • Node.js >= 19.0.0
  • SQLite3
  • Heroku CLI

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 protected]

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
        echo "HOST=your-app-name.onrender.com" >> .env
      • EMAIL_SPECIAL_USER
        echo "EMAIL_SPECIAL_USER=any_existing_email@in_database" >> .env
      • DATABASE_URL
        echo "DATABASE_URL=Internal Database URL" >> .env
      • RACK_ENV and RAILS_ENV
        echo "RACK_ENV=staging" >> .env
        echo "RAILS_ENV=staging" >> .env
      • RENDER_LOAD_FIXTURES to load fixtures
        echo "RENDER_LOAD_FIXTURES=1" >> .env
      Generate new master.key if the original is missing
      • RAILS_MASTER_KEY
        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
        echo "CREDENTIALS_ENC=$(cat config/credentials.yml.enc)" >> .env
  • You can deploy app


Configure reCAPTCHA for production:

  • Follow the link reCAPTCHA
  • Log into Admin Console with your credentials or create a new Google Account in case you don't have one
  • At Admin Console register a new site as shown in example below

Configure reCAPTCHA for development:

  • add test key to .ENV file if they were not generated:
# 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)
  • Accept terms of use and submit
  • Add generated reCAPTCHA SITE KEY and SECRET KEY to environment variables in production
  • To use reCAPTCHA in development simply copy SITE KEY and SECRET KEY to your .env file

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.