xlsx_parsing-:.xlsx 文档解析器 (Sinatra + Roo) 和仪表板 (Chartkick)

  • y9_984831
    了解作者
  • 2.4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-02 17:25
    上传日期
连锁店销售仪表盘 这是一个简单的 Web 应用程序,它一次使用 .xlsx 销售报告,并将所有报告的汇总数据可视化。 它是用 Ruby 构建的,包含 OOP 元素——并且它有一个功能正常、几乎响应式的 HTML/CSS/JS 前端。 查看正在运行的应用程序的屏幕截图 (/screenshots) 和视频文件 (/screenshots/chain_stores_demo.gif) 守则的结构 服务器:Ruby with Sinatra(开源 DSL,依赖 Rack 服务器接口) 数据库:PostgreSQL Ruby Gems:* PG - 用于 PostgreSQL * ActiveRecord - CRUD 数据库的建模工具 * Roo(和依赖电子表格) - 将 .xlsx 处理为可访问的接口/ JSON * Chartkick - 用于图表数据 CSS 的不太可定制的 D3:使用 r
xlsx_parsing--master.zip
  • xlsx_parsing--master
  • server.rb
    2.7KB
  • sample_data
  • MonthlySalesReport_MAY.xlsx
    12KB
  • MonthlySalesReport_JUNE.xlsx
    12.2KB
  • db
  • schema.sql
    431B
  • active_record_init.rb
    190B
  • .DS_Store
    6KB
  • connection.rb
    363B
  • screenshots
  • Screen Shot 2015-03-25 at 10.28.56 AM.png
    299.4KB
  • Screen Shot 2015-03-25 at 10.28.31 AM.png
    281.8KB
  • Screen Shot 2015-03-25 at 10.28.47 AM.png
    307.7KB
  • Screen Shot 2015-03-25 at 10.29.14 AM.png
    162.3KB
  • Screen Shot 2015-03-25 at 10.29.21 AM.png
    272.2KB
  • .DS_Store
    6KB
  • chain_stores_demo.gif
    1.5MB
  • .DS_Store
    6KB
  • Gemfile
    174B
  • views
  • upload.erb
    609B
  • index.erb
    3.4KB
  • lib
  • .DS_Store
    6KB
  • public
  • javascripts
  • scripts.js
    104B
  • chartkick.js
    22.3KB
  • ruby_classes
  • report.rb
    5.2KB
  • .DS_Store
    6KB
  • stylesheets
  • upload.css
    574B
  • .DS_Store
    6KB
  • reset.css
    1.1KB
  • style.css
    1.8KB
  • README.md
    2.9KB
  • config.ru
    46B
内容介绍
# Sales Dashboard for Chain Stores This is a simple web application that consumes .xlsx sales reports, one at a time, and visualizes the aggregate data for all of the reports. It's built with Ruby and includes elements of OOP - and it has a functioning, nearly responsive HTML/ CSS/ JS front end. Check out the screenshots (/screenshots) and video file of the app in action (/screenshots/chain_stores_demo.gif) ## Structure of the Code Server: Ruby with Sinatra (open-source DSL, dependent on Rack server interface) Database: PostgreSQL Ruby Gems: * PG - for PostgreSQL * ActiveRecord - Modeling tool for CRUD'ing database * Roo (and dependency spreadsheet) - Processes .xlsx into accessible interface/ JSON * Chartkick - a less-customizable D3 for charting data CSS: used reset.css to reduce browswer inconsistencies ## To install and run locally * Save files locally * Install PostgreSQL and run schema.sql file * Change the connection.rb username value to your own PSQL username * Install Ruby Gems https://rubygems.org/pages/download if you haven't already * Bundle gems or individually install gems.. "gem install <gem>" * Type "ruby server.rb" from parent directory * Navigate to port :4567 * Start by uploading a sales_report using the top-right button on the web interface ## File upload restriction occurs if: * file is not .xlsx * File is not formatted correctly (not built in yet!) ## Next Features * Upload multiple files at one time * Include a database table to store files saved and check to see if files have already been uploaded before allowing users to upload duplicate sales report * Verify structure of xlsx report before allowing upload * Delete incorrect sales reports * Update parser to allow for more dynamic file structure * Easily see worst performing products * Split and minify CSS documents; clean up successful upload page and look to move upload workflow into a modal so users remain on the same screen * Responsiveness (especially on the top-right table view) ## Notes on my process and design * I usually prefer to employ a testing engine like Minitest for Ruby projects, but I was under a bit of a time crunch and didn't have the bandwidth to allow for proper testing design. * I explored 3-4 other .xlsx parsers. This gave me the best interface and it made the File.io process nearly seamless * Check out the Report class in /public/ruby_classes/report.rb -> Much refactoring left to do but it's pretty powerful * I'd like to spend more time refactoring the server file, and hopefully creating more classes (before I build out more features!) to handle data transfer/ calculation on the server side * It's always tough to balance clean server logic with presenting a great front end. I ended up spending my final few hours focusing on the presentation of the platform -- and there's still much more I hope to do (advanced filtering, D3 instead for better tooltips, etc.)
评论
    相关推荐
    • 使用到json-ruby-v-000
      使用to_json 目标 使用to_json方法将对象呈现为JSON。 说明如何通过同一控制器操作呈现不同的格式。 课 上一次超时时,我们创建了一个PostSerializer并用它来将Post序列化为JSON。 它的工作效果很好,但是进行所有...
    • jsonapi-serializers:JSON的纯Ruby只读序列化器
      JSONAPI :: Serializers是一个简单的库,用于将Ruby对象及其之间的关系序列化为。 该库是最新的v1 JSON API最终版本规范。 根链接 根错误 根jsonapi对象 明确的序列化程序发现 命名空间序列化器 稀疏字段集 人际...
    • akchabar-ruby:用于 akchabar.kg JSON API 的 Ruby 客户端
      阿克恰巴尔 用法 > Akchabar.rates => {"date"=>"28.03.2015", "rates"=>{"usd"=>"63.8956", "euro"=>"69.1446", "ruble"=>"1.1068", "tenge"=>"0.3445", "btc"=>"15580.303104"}, "updated_at"=>1427626744} ...
    • JSON对象展示生成模板boxer-ruby.zip
      boxer 是一款简单的用户自定义模板,用来生成 JSON 对象模型表示。 标签:boxer
    • Ruby-JsonCompare返回两个JSON文件之间的差异
      JsonCompare - 返回两个JSON文件之间的差异
    • json-machine
      以 yajl-ruby 为模型的现代纯 ruby​​ 流式 JSON 解析器/编码器。 我的目的是创建一个纯 ruby​​、类似 SAX 的流式 JSON 解析器,允许调用者在解析发生时构建他们自己的对象。 例如,通过覆盖“found_string(str...
    • jsondiff:Ruby中的JSON补丁生成器
      Ruby中的JSON修补程序生成器,它符合JSON修补程序规范。 要应用补丁,您应该使用 。 安装 gem install jsondiff 用法 require 'jsondiff' JsonDiff . generate ( { foo : :bar } , { foo : :plop } ) =>将导致 ...
    • capybara-json
      测试Ruby:1.9.3、2.0.0、2.1.x、2.2.x; 水豚:0.4.x、1.1.x、2.0.x 关于水豚-json capybara-json 提供了相同的接口来测试 JSON API(本地和远程) Capybara 是一个验收测试框架,它对客户端错误(4xx 响应)不...
    • ruby使用json
      ruby解析jsonruby解析
    • json:RubyJSON实现
      RubyJSON实现 描述 这是根据RFC 7159 的JSON规范的实现。 从版本1.0.0开始,将提供两个变体: 一个纯ruby变体,它依赖于ruby标准库的一部分iconv和stringscan扩展。 本地扩展变体要快得多,它可以用C或Java部分...