Giter Site home page Giter Site logo

teste-back-end's Introduction

README

This App basically register a track of visits of desired webpages that you put the app/assets/javascripts/trackerattor.js on.

It has an Redis at front to receive a huge amount of tracking data leaving the connection free asap and then the Sidekiq will run a Job to persist that data on MongoDB from the queue.

Things you'll need to run on development:

Dependencies:

  • Ruby 2.5.5
  • Redis on port 6379
  • Sidekiq listening to development_default queue (for development)

Or

  • Docker
  • Docker Compose

Without Docker instructions:

This project depends on Ruby described at .ruby-version file, if you dont known Ruby, take a look at this and it is a good idea to use a manager like rvm, take a look here.

With ruby installed,

After you've cloned the project,

cd teste-back-end

gem install bundler

bundle install

docker run -d -p 27017:27017 -e AUTH=no mongo

rake db:create

rake db:mongoid:create_indexes

bundle exec sidekiq -q development_default

And in another terminal: bundle exec rails s

To run tests:

bundle exec rspec

NOTE: if you use docker and some tests fails, its because docker creates some dir owned by root, just run this to fix ownership of the directories to your user:

sudo chown $(whoami) -R .

To run Rubocop (Ruby Style Guide Lint): bundle exec rubocop

Pages of this project that have the tracker:

  • localhost:3000/contacts/new
  • after you submit the form, the show page that you'll be redirected also have the tracker.

Report:

  • localhost:3000/visits/report
  • localhost:3000/visits/report.json

Sidekiq:

  • localhost:3000/sidekiq

Instructions to run with Docker-Compose

Just:

docker-compose up --build

The app will be up and running on localhost:3000 as above

Enjoy!

teste-back-end's People

Contributors

feolea avatar gustaum avatar

Watchers

 avatar  avatar

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.