bjvta / contact-importer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CONTACT IMPORTER

This project is to upload a csv file and save selecting the column for each row

Prerequisites

Ruby version: 2.7.7 Database: PostgreSQL Node version: v16.14.2

Installing Ruby for Mac

For more information to install the project in Ubuntu or Windows, you can go to gorails.com

    cd
    git clone https://github.com/excid3/asdf.git ~/.asdf
    echo '. "$HOME/.asdf/asdf.sh"' >> ~/.zshrc
    echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.zshrc
    exec $SHELL

Then installing ruby and node

    asdf plugin add ruby
    asdf plugin add nodejs
    asdf install ruby 2.7.7
    asdf global ruby 2.7.7
    asdf install nodejs 16.14.2
    asdf global nodejs 16.14.2

    which node
    #=> /Users/username/.asdf/shims/node
    node -v
    #=> 16.14.2

    # Install yarn for Rails jsbundling/cssbundling or webpacker
    npm install -g yarn

Install the database

brew install postgresql
brew services start postgresql

Install the bundler

    gem install bundler 2.3.8

Then install all gems

bundle install

Make a copy for the env.example to .env and generate a secret key for encrypt

    SecureRandom.hex(32)

When this is done, we can setup the data

rails db:create
rails db:migrate
rails db:seed

Then run the project

rails s
# or 
bundle exec rails s

Dummy users:

email: user_one@yopmail.com  
password: adminadmin

email: user_two@yopmail.com
password: qwertyqwerty

You can use an example file example_file, but for more examples, they are in (tests_files)[spec/fixtures/files]

Testing

rspec spec
# or
bundle exec rspec spec

About


Languages

Language:Ruby 76.5%Language:HTML 17.5%Language:JavaScript 4.1%Language:SCSS 1.2%Language:CSS 0.6%Language:Shell 0.0%