Coder Social home page Coder Social logo

vidcant's Introduction

VidCant

It was supposed to be vidcan(covid canada) but I decided to make it can't :)

I built this simple project using rails and react specially for Samsung ads interview using part of their stack.

There is a task that wakes up every day at 2 am and fetches Canada's official covid-19 stats from this file https://health-infobase.canada.ca/src/data/covidLive/covid19.csv and updates the database.

Note

This project was built in a few hours and needs a lot of polishing.

Versions

  • Ruby version 2.7.1p83

  • Rails version 6.0.3.2

How to start

bundle install
yarn
rails db:create
rails db:migrate
redis-server
sidekiq
rails s

The task will be scheduled automatically to start as 2 am. if you want to fetch the data manually, use bundle exec rake fetch_data:update OR click on enque now in http://localhost:3000/sidekiq/cron

GraphQl

To test end points use http://localhost:3000/graphiql

Queries

Canada stats in the last 10 days.

{
  canada {
    id
    pruid
    prname
    date
    numconf
    numtotal
    numrecover
    numdeaths   
  }
}

The stats of the biggest 3 provinces last day.

{
  radar {
    name
    numconf
    ratetotal
    numdeaths
    percentdeath
    ratetested
    numactive
  }
}

Todo

  • Making ProvinceUpdater class singeltone
  • Automated testing.
  • The domain of the radar axes are hard coded.
  • Learn more about apollo.js

vidcant's People

Contributors

amronrails avatar

Watchers

James Cloos 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.