Giter VIP home page Giter VIP logo

stat_board's Introduction

StatBoard

Code Climate

A simple dashboard of records created this week, this month, and all time, mountable as a Rails Engine.

Basic Configuration

  1. Add gem to Gemfile:

     gem 'stat_board'
    
  2. Add initializer and route:

     rails g stat_board:install
    
  3. Configure models (in config/initializers/stat_board.rb):

     StatBoard.models = [User, Post, Comment]
    

Models can also be listed as strings if you encounter any loading order issues.

Routing

You can access StatBoard like this:

stat_board.root_url

Additonal Configuration

In config/initializers/stat_board.rb:

  1. Title

     StatBoard.title = "YourApp Stats"
    
  2. Basic Authentication

     StatBoard.username = "user"
     StatBoard.password = "pass"
    
  3. Displaying Data Graphically (true by default)

     StatBoard.display_graph = true
    
  4. You may provide your own reports, just place they into lib/stat_board/reports. Name of report should be *_report.rb. For example:

     # lib/stat_board/reports/day_report.rb
     module StatBoard
       module Reports
         class DayReport < Report
           def name(original_date = nil)
             "Last day"
           end
    
           def scope(model)
             super.where(["created_at > ?", 1.day.ago])
           end
         end
       end
     end
    

Issues

  • Models can be specified as strings rather than constants if you encounter loading order issues.
  • If you're using the Asset Pipeline, you'll need to add stat_board/bootstrap.css to your precompile paths.
  • If you have config.assets.initialize_on_precompile set to false, then you will need to add stat_board/highcharts.js to your precompile paths.

Contributing

Happily accepting contributions to improve StatBoard. To contribute, fork, add your thing, add some specs, and send a pleasantly worded pull request.

In order to setup the databases locally, you'll need to: bundle exec rake db:migrate app:db:test:prepare


StatBoard is released under the MIT License. See MIT-LICENSE for further details.

stat_board's People

Contributors

dce avatar brianjlandau avatar zporter avatar accessd avatar

Watchers

James Cloos avatar Lawson Jaglom-Kurtz 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.