├── log └── .keep ├── tmp └── .keep ├── app ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ ├── bank.rb │ ├── user.rb │ ├── wage.rb │ ├── snapshot.rb │ └── account.rb ├── assets │ ├── builds │ │ └── .keep │ ├── images │ │ └── .keep │ ├── config │ │ └── manifest.js │ └── stylesheets │ │ └── application.sass ├── controllers │ ├── concerns │ │ └── .keep │ ├── application_controller.rb │ ├── dashboards_controller.rb │ ├── fine_ants_controller.rb │ └── admin │ │ ├── banks_controller.rb │ │ ├── users_controller.rb │ │ ├── wages_controller.rb │ │ ├── accounts_controller.rb │ │ ├── snapshots_controller.rb │ │ └── application_controller.rb ├── javascript │ ├── application.js │ └── snapshot-chart.js ├── lib │ ├── downloads_transactions.rb │ └── account_summaries.rb ├── helpers │ └── application_helper.rb ├── views │ ├── layouts │ │ └── application.html.erb │ ├── admin │ │ ├── application │ │ │ └── _navigation.html.erb │ │ └── users │ │ │ └── show.html.erb │ └── dashboards │ │ └── show.slim └── dashboards │ ├── bank_dashboard.rb │ ├── snapshot_dashboard.rb │ ├── user_dashboard.rb │ ├── wage_dashboard.rb │ └── account_dashboard.rb ├── lib ├── assets │ └── .keep └── tasks │ ├── .keep │ └── demo.rake ├── public ├── favicon.ico ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── bank_test.rb │ ├── user_test.rb │ ├── account_test.rb │ └── snapshot_test.rb ├── controllers │ └── .keep ├── fixtures │ ├── .keep │ ├── snapshots.yml │ ├── banks.yml │ ├── users.yml │ └── accounts.yml ├── integration │ └── .keep └── test_helper.rb ├── .browserslistrc ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── Procfile ├── Procfile.dev ├── .postcssrc.yml ├── bin ├── rake ├── bundle ├── rails ├── dev └── setup ├── config ├── initializers │ ├── assets.rb │ ├── cookies_serializer.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── filter_parameter_logging.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── money.rb ├── boot.rb ├── environment.rb ├── application.rb ├── routes.rb ├── database.yml ├── locales │ └── en.yml ├── secrets.yml └── environments │ ├── test.rb │ ├── development.rb │ └── production.rb ├── config.ru ├── db ├── migrate │ ├── 20160807140737_uniq_accounts.rb │ ├── 20180714162317_disable_user.rb │ ├── 20181013150825_disable_accounts.rb │ ├── 20160807025120_create_banks.rb │ ├── 20181013152718_create_wages.rb.rb │ ├── 20160807025440_create_snapshots.rb │ ├── 20160807025139_create_users.rb │ ├── 20160807025313_create_accounts.rb │ └── 20160807140850_move_user_out_of_accounts.rb ├── seeds.rb └── schema.rb ├── driver.rb ├── Rakefile ├── postcss.config.js ├── webpack.config.js ├── Gemfile ├── package.json ├── .gitignore ├── babel.config.js ├── README.md ├── Gemfile.lock ├── yarn.lock └── LICENSE.txt /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/builds/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/bank.rb: -------------------------------------------------------------------------------- 1 | class Bank < ActiveRecord::Base 2 | end 3 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | # Procfile 2 | web: bin/rails server 3 | js: yarn build --watch 4 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: unset PORT && bin/rails server 2 | js: yarn build --watch 3 | -------------------------------------------------------------------------------- /.postcssrc.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | postcss-smart-import: {} 3 | postcss-cssnext: {} 4 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_directory ../stylesheets css 2 | //= link_tree ../builds 3 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.assets.paths << Rails.root.join("node_modules", "amcharts3") 2 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /test/models/bank_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class BankTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path("../config/environment", __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /test/models/account_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class AccountTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/snapshot_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class SnapshotTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: "_fine_ants_app_session" 4 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | belongs_to :bank 3 | has_and_belongs_to_many :accounts 4 | 5 | def self.active 6 | where.not(disabled: true) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if ! gem list foreman -i --silent; then 4 | echo "Installing foreman..." 5 | gem install foreman 6 | fi 7 | 8 | exec foreman start -f Procfile.dev "$@" 9 | -------------------------------------------------------------------------------- /db/migrate/20160807140737_uniq_accounts.rb: -------------------------------------------------------------------------------- 1 | class UniqAccounts < ActiveRecord::Migration[5.1] 2 | def change 3 | add_index :accounts, [:bank_id, :foreign_id], unique: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /app/javascript/application.js: -------------------------------------------------------------------------------- 1 | import "@hotwired/turbo-rails" 2 | import Rails from '@rails/ujs' 3 | import { Turbo } from '@hotwired/turbo-rails' 4 | import {} from './snapshot-chart' 5 | 6 | Rails.start() 7 | -------------------------------------------------------------------------------- /db/migrate/20180714162317_disable_user.rb: -------------------------------------------------------------------------------- 1 | class DisableUser < ActiveRecord::Migration[5.1] 2 | def change 3 | change_table :users do |t| 4 | t.boolean :disabled, default: false, null: false 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /db/migrate/20181013150825_disable_accounts.rb: -------------------------------------------------------------------------------- 1 | class DisableAccounts < ActiveRecord::Migration[5.2] 2 | def change 3 | change_table :accounts do |t| 4 | t.boolean :disabled, default: false, null: false 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/snapshots.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | account_id: 5 | timestamps: MyString 6 | 7 | two: 8 | account_id: 9 | timestamps: MyString 10 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /test/fixtures/banks.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | fine_ants_adapter: MyString 6 | 7 | two: 8 | name: MyString 9 | fine_ants_adapter: MyString 10 | -------------------------------------------------------------------------------- /driver.rb: -------------------------------------------------------------------------------- 1 | require "pry" 2 | require_relative "config/environment" 3 | 4 | puts "User ID:" 5 | user_id = gets.chomp 6 | transactions = DownloadsTransactions.new(User.find(user_id)).download 7 | 8 | binding.pry # rubocop:disable Lint/Debugger 9 | puts transactions 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path("../config/application", __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | user: MyString 5 | password: MyString 6 | bank_id: 7 | 8 | two: 9 | user: MyString 10 | password: MyString 11 | bank_id: 12 | -------------------------------------------------------------------------------- /db/migrate/20160807025120_create_banks.rb: -------------------------------------------------------------------------------- 1 | class CreateBanks < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :banks do |t| 4 | t.string :name 5 | t.string :fine_ants_adapter 6 | 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /db/migrate/20181013152718_create_wages.rb.rb: -------------------------------------------------------------------------------- 1 | class CreateWages < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :wages do |t| 4 | t.money :amount 5 | t.date :date 6 | t.string :description 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/lib/downloads_transactions.rb: -------------------------------------------------------------------------------- 1 | class DownloadsTransactions 2 | def initialize(user) 3 | @user = user 4 | end 5 | 6 | def download 7 | FineAnts.download(@user.bank.fine_ants_adapter, { 8 | user: @user.user, 9 | password: @user.password 10 | }) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/fixtures/accounts.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | bank_id: 5 | foreign_id: MyString 6 | user_id: 7 | name: MyString 8 | 9 | two: 10 | bank_id: 11 | foreign_id: MyString 12 | user_id: 13 | name: MyString 14 | -------------------------------------------------------------------------------- /db/migrate/20160807025440_create_snapshots.rb: -------------------------------------------------------------------------------- 1 | class CreateSnapshots < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :snapshots do |t| 4 | t.references :account, index: true, foreign_key: true 5 | t.money :amount 6 | 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20160807025139_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :users do |t| 4 | t.references :bank, index: true, foreign_key: true 5 | t.string :user 6 | t.string :password 7 | 8 | t.timestamps null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | include Administrate::ApplicationHelper 3 | 4 | def namespace 5 | "admin" 6 | end 7 | 8 | def nav_link_state(resource) 9 | if controller.controller_name == "dashboards" && resource == "dashboard" 10 | :active 11 | else 12 | :inactive 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module FineAntsApp 10 | class Application < Rails::Application 11 | config.load_defaults 7.0 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path("../../config/environment", __FILE__) 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20160807025313_create_accounts.rb: -------------------------------------------------------------------------------- 1 | class CreateAccounts < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :accounts do |t| 4 | t.references :bank, index: true, foreign_key: true 5 | t.references :user, index: true, foreign_key: true 6 | t.string :foreign_id 7 | t.string :name 8 | 9 | t.timestamps null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/wage.rb: -------------------------------------------------------------------------------- 1 | class Wage < ActiveRecord::Base 2 | monetize :amount_cents 3 | 4 | def self.chart_data 5 | scan(Wage.all.order("date asc")) { |total, wage| 6 | acc = total.present? ? total[:wage] : 0 7 | { 8 | date: wage.date, 9 | wage: acc + wage.amount.to_d 10 | } 11 | } 12 | end 13 | 14 | def self.scan(arr) 15 | arr.inject([]) { |acc, el| acc << yield(acc.last, el) } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | namespace :admin do 3 | resources :accounts 4 | resources :banks 5 | resources :snapshots 6 | resources :users 7 | resources :wages 8 | 9 | root to: "accounts#index" 10 | end 11 | 12 | resources :fine_ants 13 | resource :dashboard do 14 | get "snapshot-chart-data", to: "dashboards#snapshot_chart_data" 15 | end 16 | 17 | root to: redirect("/dashboard") 18 | end 19 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /db/migrate/20160807140850_move_user_out_of_accounts.rb: -------------------------------------------------------------------------------- 1 | class MoveUserOutOfAccounts < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :accounts_users do |t| 4 | t.references :user, index: true, foreign_key: true 5 | t.references :account, index: true, foreign_key: true 6 | 7 | t.timestamps null: false 8 | end 9 | add_index :accounts_users, [:user_id, :account_id], unique: true 10 | 11 | remove_column :accounts, :user_id, :integer 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path") 2 | const webpack = require("webpack") 3 | 4 | module.exports = { 5 | mode: "production", 6 | devtool: "source-map", 7 | entry: { 8 | application: "./app/javascript/application.js" 9 | }, 10 | output: { 11 | filename: "[name].js", 12 | sourceMapFilename: "[file].map", 13 | path: path.resolve(__dirname, "app/assets/builds"), 14 | }, 15 | plugins: [ 16 | new webpack.optimize.LimitChunkCountPlugin({ 17 | maxChunks: 1 18 | }) 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | ruby "3.2.1" 4 | 5 | gem "fine_ants", git: "https://github.com/searls/fine_ants" 6 | gem "slim-rails" 7 | gem "administrate" 8 | gem "dotenv" 9 | gem "money-rails" 10 | gem "puma" 11 | gem "good_migrations" 12 | 13 | gem "rails", "~> 7.0" 14 | gem "sqlite3" 15 | gem "sassc-rails" 16 | gem "turbo-rails" 17 | gem "uglifier" 18 | gem "jsbundling-rails" 19 | 20 | group :development do 21 | gem "pry-rails" 22 | gem "standard" 23 | gem "web-console" 24 | gem "faker" 25 | gem "table_print" 26 | end 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fine_ants_app", 3 | "version": "1.0.0", 4 | "main": "\"\"", 5 | "repository": "git@github.com:searls/fine_ants_app.git", 6 | "author": "Justin Searls ", 7 | "license": "GPL-3.0", 8 | "dependencies": { 9 | "@hotwired/turbo-rails": "^7.2.5", 10 | "@rails/ujs": "^7.0.4-2", 11 | "amcharts3": "amcharts/amcharts3", 12 | "esbuild": "^0.17.7" 13 | }, 14 | "scripts": { 15 | "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FineAntsApp 5 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload", media: "all" %> 6 | <%= csrf_meta_tags %> 7 | <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> 8 | 9 | 10 |
11 | 14 | 15 |
16 | <%= yield %> 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /app/models/snapshot.rb: -------------------------------------------------------------------------------- 1 | class Snapshot < ActiveRecord::Base 2 | belongs_to :account 3 | monetize :amount_cents 4 | 5 | def self.chart_data 6 | accounts = Account.active 7 | snapshots = all.joins(:account).where.not("accounts.disabled" => true) 8 | snapshots.map(&:created_at).map(&:to_date).uniq.sort.map { |date| 9 | { 10 | date: date, 11 | value: accounts.map { |a| 12 | a.value_on(date, snapshots.select { |s| s.account == a }) 13 | }.sum(0).to_f 14 | } 15 | } 16 | end 17 | 18 | def change_since(date) 19 | amount - account.value_on(date) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/dashboards_controller.rb: -------------------------------------------------------------------------------- 1 | class DashboardsController < ApplicationController 2 | def show 3 | @summaries = AccountSummaries.new(Account.active) 4 | end 5 | 6 | def snapshot_chart_data 7 | render json: merge_points([Snapshot.chart_data, Wage.chart_data]) 8 | end 9 | 10 | def merge_points(points) 11 | points.flatten.group_by { |e| e[:date] }.map { |(_, entries)| 12 | if entries.size == 1 13 | entries.first 14 | else 15 | entries.each_with_object({}) { |entry, combined| 16 | combined.merge!(entry) 17 | } 18 | end 19 | }.flatten.sort_by { |e| e[:date] } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /app/controllers/fine_ants_controller.rb: -------------------------------------------------------------------------------- 1 | require "fine_ants" 2 | 3 | class FineAntsController < ApplicationController 4 | def create 5 | users.each do |user| 6 | DownloadsTransactions.new(user).download.each do |account_snapshot| 7 | Account.upsert!(user, account_snapshot) 8 | end 9 | end 10 | flash[:info] = "Snapshots taken!" 11 | redirect_to dashboard_path 12 | end 13 | 14 | private 15 | 16 | def users 17 | if params.key?(:user_id) 18 | [User.find(params[:user_id])] 19 | else 20 | User.active.sort_by { |u| 21 | u.accounts.active.map { |a| a.most_recent_snapshot.created_at }.min 22 | } 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /app/controllers/admin/banks_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class BanksController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Bank. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Bank.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/users_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class UsersController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = User. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # User.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/wages_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class WagesController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Wage. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Wage.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/accounts_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class AccountsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Account. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Account.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/admin/snapshots_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class SnapshotsController < Admin::ApplicationController 3 | # To customize the behavior of this controller, 4 | # you can overwrite any of the RESTful actions. For example: 5 | # 6 | # def index 7 | # super 8 | # @resources = Snapshot. 9 | # page(params[:page]). 10 | # per(10) 11 | # end 12 | 13 | # Define a custom finder by overriding the `find_resource` method: 14 | # def find_resource(param) 15 | # Snapshot.find_by!(slug: param) 16 | # end 17 | 18 | # See https://administrate-prototype.herokuapp.com/customizing_controller_actions 19 | # for more information 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /app/views/admin/application/_navigation.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | # Navigation 3 | 4 | This partial is used to display the navigation in Administrate. 5 | By default, the navigation contains navigation links 6 | for all resources in the admin dashboard, 7 | as defined by the routes in the `admin/` namespace 8 | %> 9 | 10 | 20 | -------------------------------------------------------------------------------- /app/controllers/admin/application_controller.rb: -------------------------------------------------------------------------------- 1 | # All Administrate controllers inherit from this `Admin::ApplicationController`, 2 | # making it the ideal place to put authentication logic or other 3 | # before_actions. 4 | # 5 | # If you want to add pagination or other controller-level concerns, 6 | # you're free to overwrite the RESTful controller actions. 7 | module Admin 8 | class ApplicationController < Administrate::ApplicationController 9 | before_action :authenticate_admin 10 | 11 | def authenticate_admin 12 | # TODO Add authentication logic here. 13 | end 14 | 15 | # Override this value to specify the number of elements to display at a time 16 | # on index pages. Defaults to 20. 17 | # def records_per_page 18 | # params[:per_page] || 20 19 | # end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.sass: -------------------------------------------------------------------------------- 1 | //= require administrate/application 2 | //= require_tree . 3 | //= require_self 4 | 5 | .actions 6 | text-align: center 7 | margin-top: 2.5rem 8 | 9 | a 10 | text-decoration: none 11 | 12 | .big-update-button 13 | background-color: #f6f7f7 14 | display: inline 15 | padding: 1rem 16 | border-radius: .7rem 17 | box-shadow: 0 2px 4px rgba(41, 63, 84, 0.24), 0 2px 6px rgba(41, 63, 84, 0.12) 18 | 19 | .total 20 | background-color: #ccc 21 | font-weight: bold 22 | 23 | .currency 24 | text-align: right 25 | &.positive 26 | color: green 27 | &.negative 28 | color: red 29 | 30 | .fine-print 31 | margin-top: 1rem 32 | font-size: .6rem 33 | text-align: center 34 | font-style: italic 35 | 36 | #snapshot-chart 37 | width: 100% 38 | height: 500px 39 | 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | .env 10 | 11 | # Ignore the default SQLite database. 12 | /db/*.sqlite3 13 | /db/*.sqlite3-journal 14 | /db/data.dmg 15 | 16 | # Ignore all logfiles and tempfiles. 17 | /log/* 18 | !/log/.keep 19 | /tmp/* 20 | !/tmp/.keep 21 | node_modules 22 | /public/packs 23 | /node_modules 24 | /public/packs 25 | /public/packs-test 26 | /node_modules 27 | 28 | /public/packs 29 | /public/packs-test 30 | /node_modules 31 | /yarn-error.log 32 | yarn-debug.log* 33 | .yarn-integrity 34 | 35 | /app/assets/builds/* 36 | !/app/assets/builds/.keep 37 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | system "yarn check || yarn install --check-files" 15 | 16 | # puts "\n== Copying sample files ==" 17 | # unless File.exist?("config/database.yml") 18 | # system "cp config/database.yml.sample config/database.yml" 19 | # end 20 | 21 | puts "\n== Preparing database ==" 22 | system "bin/rails db:prepare" 23 | 24 | puts "\n== Removing old logs and tempfiles ==" 25 | system "rm -f log/*" 26 | system "rm -rf tmp/cache" 27 | 28 | puts "\n== Restarting application server ==" 29 | system "touch tmp/restart.txt" 30 | end 31 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: be0be88f15bedff38d0cfa2f2f5deef64c79a914742af4970b7863fc9fcebc10646642d139714c699d722de9812f671fe6b6717a1f4451bb0d5cc45b930d2f0a 15 | 16 | test: 17 | secret_key_base: 3bda63c41223254759dcec0ebc46e0d12d47361f7188b130680ac4b58e4bf876193b5ed47ca23621c1a9ce89a1e5784900fc16b45de7ec747b2baeb36d1be5d3 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /lib/tasks/demo.rake: -------------------------------------------------------------------------------- 1 | require "faker" 2 | 3 | ACCOUNT_TYPES = ["Checking", "Savings", "Credit Card", "Investment"] 4 | BANK_ACCOUNTS_COUNT = 5 5 | SNAPSHOTS_COUNT = 100 6 | 7 | task demo: :environment do 8 | raise "Error: Database must be empty to fill with demo data" if [Bank, User, Account, Snapshot].map(&:any?).any? 9 | puts "Generating sample banks..." 10 | 11 | banks = Array.new(BANK_ACCOUNTS_COUNT) { 12 | Bank.create!(name: Faker::Bank.name, fine_ants_adapter: :demo) 13 | } 14 | 15 | puts "Generating sample users, accounts, and historical snapshots..." 16 | banks.each do |bank| 17 | account_type = ACCOUNT_TYPES.sample 18 | account_number = Faker::Bank.account_number 19 | 20 | User.create!(bank: bank, 21 | user: Faker::Internet.user_name, 22 | password: "demo password") 23 | 24 | account = Account.create!(bank: bank, name: "#{account_type} - #{account_number}") 25 | 26 | Array.new(SNAPSHOTS_COUNT) do 27 | Snapshot.create!(account: account, 28 | amount_cents: Faker::Number.decimal(l_digits: 4, r_digits: 2), 29 | created_at: Faker::Date.between(from: 1.years.ago, to: Date.today)) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /app/lib/account_summaries.rb: -------------------------------------------------------------------------------- 1 | class AccountSummaries 2 | attr_reader :name, :last_updated, :week_change, :month_change, :ytd_change, 3 | :amount, 4 | :accounts, :empty_accounts 5 | 6 | def initialize(accounts) 7 | @accounts = accounts.map { |a| AccountSummary.new(a) } 8 | @name = "Totals" 9 | @last_updated = @accounts.map(&:last_updated).max 10 | @week_change = @accounts.map(&:week_change).sum(0) 11 | @month_change = @accounts.map(&:month_change).sum(0) 12 | @ytd_change = @accounts.map(&:ytd_change).sum(0) 13 | @amount = @accounts.map(&:amount).sum(0) 14 | @empty_accounts = @accounts.select { |a| a.amount.zero? } 15 | end 16 | end 17 | 18 | class AccountSummary 19 | attr_reader :name, :last_updated, :week_change, :month_change, :ytd_change, 20 | :amount, 21 | :account 22 | 23 | def initialize(account) 24 | snapshot = account.most_recent_snapshot 25 | @name = account.full_name 26 | @last_updated = snapshot.created_at 27 | @week_change = snapshot.change_since(1.week.ago.to_date) 28 | @month_change = snapshot.change_since(1.month.ago.to_date) 29 | @ytd_change = snapshot.change_since(Date.today.beginning_of_year) 30 | @amount = snapshot.amount 31 | @account = account 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/dashboards/bank_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class BankDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | id: Field::Number, 12 | name: Field::String, 13 | fine_ants_adapter: Field::String, 14 | created_at: Field::DateTime, 15 | updated_at: Field::DateTime 16 | }.freeze 17 | 18 | # COLLECTION_ATTRIBUTES 19 | # an array of attributes that will be displayed on the model's index page. 20 | # 21 | # By default, it's limited to four items to reduce clutter on index pages. 22 | # Feel free to add, remove, or rearrange items. 23 | COLLECTION_ATTRIBUTES = [ 24 | :id, 25 | :name, 26 | :fine_ants_adapter, 27 | :created_at 28 | ].freeze 29 | 30 | # SHOW_PAGE_ATTRIBUTES 31 | # an array of attributes that will be displayed on the model's show page. 32 | SHOW_PAGE_ATTRIBUTES = [ 33 | :id, 34 | :name, 35 | :fine_ants_adapter, 36 | :created_at, 37 | :updated_at 38 | ].freeze 39 | 40 | # FORM_ATTRIBUTES 41 | # an array of attributes that will be displayed 42 | # on the model's form (`new` and `edit`) pages. 43 | FORM_ATTRIBUTES = [ 44 | :name, 45 | :fine_ants_adapter 46 | ].freeze 47 | 48 | # Overwrite this method to customize how banks are displayed 49 | # across all pages of the admin dashboard. 50 | # 51 | def display_resource(bank) 52 | bank.name 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /app/dashboards/snapshot_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class SnapshotDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | account: Field::BelongsTo, 12 | id: Field::Number, 13 | amount_cents: Field::Number, 14 | amount_currency: Field::String, 15 | created_at: Field::DateTime, 16 | updated_at: Field::DateTime 17 | }.freeze 18 | 19 | # COLLECTION_ATTRIBUTES 20 | # an array of attributes that will be displayed on the model's index page. 21 | # 22 | # By default, it's limited to four items to reduce clutter on index pages. 23 | # Feel free to add, remove, or rearrange items. 24 | COLLECTION_ATTRIBUTES = [ 25 | :account, 26 | :id, 27 | :amount_cents, 28 | :amount_currency 29 | ].freeze 30 | 31 | # SHOW_PAGE_ATTRIBUTES 32 | # an array of attributes that will be displayed on the model's show page. 33 | SHOW_PAGE_ATTRIBUTES = [ 34 | :account, 35 | :id, 36 | :amount_cents, 37 | :amount_currency, 38 | :created_at, 39 | :updated_at 40 | ].freeze 41 | 42 | # FORM_ATTRIBUTES 43 | # an array of attributes that will be displayed 44 | # on the model's form (`new` and `edit`) pages. 45 | FORM_ATTRIBUTES = [ 46 | :account, 47 | :amount_cents, 48 | :amount_currency 49 | ].freeze 50 | 51 | # Overwrite this method to customize how snapshots are displayed 52 | # across all pages of the admin dashboard. 53 | # 54 | # def display_resource(snapshot) 55 | # "Snapshot ##{snapshot.id}" 56 | # end 57 | end 58 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /app/dashboards/user_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class UserDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | bank: Field::BelongsTo, 12 | accounts: Field::HasMany, 13 | id: Field::Number, 14 | user: Field::String, 15 | password: Field::String, 16 | created_at: Field::DateTime, 17 | updated_at: Field::DateTime, 18 | disabled: Field::Boolean 19 | }.freeze 20 | 21 | # COLLECTION_ATTRIBUTES 22 | # an array of attributes that will be displayed on the model's index page. 23 | # 24 | # By default, it's limited to four items to reduce clutter on index pages. 25 | # Feel free to add, remove, or rearrange items. 26 | COLLECTION_ATTRIBUTES = [ 27 | :bank, 28 | :accounts, 29 | :id, 30 | :user 31 | ].freeze 32 | 33 | # SHOW_PAGE_ATTRIBUTES 34 | # an array of attributes that will be displayed on the model's show page. 35 | SHOW_PAGE_ATTRIBUTES = [ 36 | :bank, 37 | :accounts, 38 | :id, 39 | :user, 40 | :password, 41 | :created_at, 42 | :updated_at, 43 | :disabled 44 | ].freeze 45 | 46 | # FORM_ATTRIBUTES 47 | # an array of attributes that will be displayed 48 | # on the model's form (`new` and `edit`) pages. 49 | FORM_ATTRIBUTES = [ 50 | :bank, 51 | :accounts, 52 | :user, 53 | :password, 54 | :disabled 55 | ].freeze 56 | 57 | # Overwrite this method to customize how users are displayed 58 | # across all pages of the admin dashboard. 59 | # 60 | def display_resource(user) 61 | user.user 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /app/dashboards/wage_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class WageDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | id: Field::Number, 12 | amount_cents: Field::Number, 13 | amount_currency: Field::String, 14 | date: Field::DateTime, 15 | description: Field::String, 16 | created_at: Field::DateTime, 17 | updated_at: Field::DateTime 18 | }.freeze 19 | 20 | # COLLECTION_ATTRIBUTES 21 | # an array of attributes that will be displayed on the model's index page. 22 | # 23 | # By default, it's limited to four items to reduce clutter on index pages. 24 | # Feel free to add, remove, or rearrange items. 25 | COLLECTION_ATTRIBUTES = [ 26 | :id, 27 | :amount_cents, 28 | :amount_currency, 29 | :date 30 | ].freeze 31 | 32 | # SHOW_PAGE_ATTRIBUTES 33 | # an array of attributes that will be displayed on the model's show page. 34 | SHOW_PAGE_ATTRIBUTES = [ 35 | :id, 36 | :amount_cents, 37 | :amount_currency, 38 | :date, 39 | :description, 40 | :created_at, 41 | :updated_at 42 | ].freeze 43 | 44 | # FORM_ATTRIBUTES 45 | # an array of attributes that will be displayed 46 | # on the model's form (`new` and `edit`) pages. 47 | FORM_ATTRIBUTES = [ 48 | :amount_cents, 49 | :amount_currency, 50 | :date, 51 | :description 52 | ].freeze 53 | 54 | # Overwrite this method to customize how wages are displayed 55 | # across all pages of the admin dashboard. 56 | # 57 | # def display_resource(wage) 58 | # "Wage ##{wage.id}" 59 | # end 60 | end 61 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static file server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Randomize the order test cases are executed. 35 | config.active_support.test_order = :random 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /app/dashboards/account_dashboard.rb: -------------------------------------------------------------------------------- 1 | require "administrate/base_dashboard" 2 | 3 | class AccountDashboard < Administrate::BaseDashboard 4 | # ATTRIBUTE_TYPES 5 | # a hash that describes the type of each of the model's fields. 6 | # 7 | # Each different type represents an Administrate::Field object, 8 | # which determines how the attribute is displayed 9 | # on pages throughout the dashboard. 10 | ATTRIBUTE_TYPES = { 11 | bank: Field::BelongsTo, 12 | users: Field::HasMany, 13 | snapshots: Field::HasMany, 14 | id: Field::Number, 15 | foreign_id: Field::String, 16 | name: Field::String, 17 | created_at: Field::DateTime, 18 | updated_at: Field::DateTime, 19 | disabled: Field::Boolean 20 | }.freeze 21 | 22 | # COLLECTION_ATTRIBUTES 23 | # an array of attributes that will be displayed on the model's index page. 24 | # 25 | # By default, it's limited to four items to reduce clutter on index pages. 26 | # Feel free to add, remove, or rearrange items. 27 | COLLECTION_ATTRIBUTES = [ 28 | :bank, 29 | :users, 30 | :snapshots, 31 | :id 32 | ].freeze 33 | 34 | # SHOW_PAGE_ATTRIBUTES 35 | # an array of attributes that will be displayed on the model's show page. 36 | SHOW_PAGE_ATTRIBUTES = [ 37 | :bank, 38 | :users, 39 | :snapshots, 40 | :id, 41 | :foreign_id, 42 | :name, 43 | :created_at, 44 | :updated_at, 45 | :disabled 46 | ].freeze 47 | 48 | # FORM_ATTRIBUTES 49 | # an array of attributes that will be displayed 50 | # on the model's form (`new` and `edit`) pages. 51 | FORM_ATTRIBUTES = [ 52 | :bank, 53 | :users, 54 | :snapshots, 55 | :foreign_id, 56 | :name, 57 | :disabled 58 | ].freeze 59 | 60 | # Overwrite this method to customize how accounts are displayed 61 | # across all pages of the admin dashboard. 62 | # 63 | def display_resource(account) 64 | account.name 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /app/views/admin/users/show.html.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | # Show 3 | 4 | This view is the template for the show page. 5 | It renders the attributes of a resource, 6 | as well as a link to its edit page. 7 | 8 | ## Local variables: 9 | 10 | - `page`: 11 | An instance of [Administrate::Page::Show][1]. 12 | Contains methods for accessing the resource to be displayed on the page, 13 | as well as helpers for describing how each attribute of the resource 14 | should be displayed. 15 | 16 | [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show 17 | %> 18 | 19 | <% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %> 20 | 21 | 34 | 35 |
36 |
37 | <% page.attributes.each do |attribute| %> 38 |
39 | <%= t( 40 | "helpers.label.#{resource_name}.#{attribute.name}", 41 | default: attribute.name.titleize, 42 | ) %> 43 |
44 | 45 |
<%= render_field attribute, page: page %>
47 | <% end %> 48 |
49 |
50 | 51 | 52 | <%= stylesheet_link_tag 'application', media: 'all' %> 53 |
54 | <%= link_to fine_ants_path(:user_id => page.resource.id), :method => :post do %> 55 |
Take Snapshot!
56 | <% end %> 57 |
58 | -------------------------------------------------------------------------------- /app/models/account.rb: -------------------------------------------------------------------------------- 1 | class Account < ActiveRecord::Base 2 | belongs_to :bank 3 | has_and_belongs_to_many :users 4 | has_many :snapshots 5 | 6 | def self.active 7 | where.not(disabled: true) 8 | end 9 | 10 | def self.upsert!(user, account_snapshot) 11 | find_or_create_by!( 12 | bank: user.bank, 13 | foreign_id: account_snapshot[:id] 14 | ).tap do |account| 15 | account.update!(name: account_snapshot[:name]) 16 | account.users << user unless account.users.include?(user) 17 | account.snapshots.create!(amount: account_snapshot[:amount]) 18 | end 19 | end 20 | 21 | def most_recent_snapshot 22 | snapshots.order("created_at").last 23 | end 24 | 25 | # Returns the value of the account for a date. 26 | # 1. If there was a snapshot that day, great 27 | # 2. Else if there are before & after snapshots, interpolate (eww linear math) 28 | # 3. Else just grab the most recent before-snapshot if there's one of those 29 | # 4. Else zero ¯\_(ツ)_/¯ 30 | def value_on(date, snapshots = self.snapshots) 31 | if (that_day = snapshots.find { |s| s.created_at.to_date == date }) 32 | that_day.amount 33 | elsif snapshots.any? { |s| s.created_at < date } && snapshots.any? { |s| s.created_at > date } 34 | previous = snapshots.select { |s| s.created_at < date }.max_by(&:created_at) 35 | subsequent = snapshots.select { |s| s.created_at > date }.min_by(&:created_at) 36 | total_days = subsequent.created_at.to_date - previous.created_at.to_date 37 | target_days = date - previous.created_at.to_date 38 | (((total_days - target_days) / total_days) * previous.amount) + 39 | ((target_days / total_days) * subsequent.amount) 40 | elsif snapshots.any? { |s| s.created_at < date } 41 | snapshots.select { |s| s.created_at < date }.max_by(&:created_at).amount 42 | else 43 | 0 44 | end 45 | end 46 | 47 | def full_name 48 | "#{bank.name} - #{name}" 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | var validEnv = ['development', 'test', 'production'] 3 | var currentEnv = api.env() 4 | var isDevelopmentEnv = api.env('development') 5 | var isProductionEnv = api.env('production') 6 | var isTestEnv = api.env('test') 7 | 8 | if (!validEnv.includes(currentEnv)) { 9 | throw new Error( 10 | 'Please specify a valid `NODE_ENV` or ' + 11 | '`BABEL_ENV` environment variables. Valid values are "development", ' + 12 | '"test", and "production". Instead, received: ' + 13 | JSON.stringify(currentEnv) + 14 | '.' 15 | ) 16 | } 17 | 18 | return { 19 | presets: [ 20 | isTestEnv && [ 21 | require('@babel/preset-env').default, 22 | { 23 | targets: { 24 | node: 'current' 25 | } 26 | } 27 | ], 28 | (isProductionEnv || isDevelopmentEnv) && [ 29 | require('@babel/preset-env').default, 30 | { 31 | forceAllTransforms: true, 32 | useBuiltIns: 'entry', 33 | modules: false, 34 | exclude: ['transform-typeof-symbol'] 35 | } 36 | ] 37 | ].filter(Boolean), 38 | plugins: [ 39 | require('babel-plugin-macros'), 40 | require('@babel/plugin-syntax-dynamic-import').default, 41 | isTestEnv && require('babel-plugin-dynamic-import-node'), 42 | require('@babel/plugin-transform-destructuring').default, 43 | [ 44 | require('@babel/plugin-proposal-class-properties').default, 45 | { 46 | loose: true 47 | } 48 | ], 49 | [ 50 | require('@babel/plugin-proposal-object-rest-spread').default, 51 | { 52 | useBuiltIns: true 53 | } 54 | ], 55 | [ 56 | require('@babel/plugin-transform-runtime').default, 57 | { 58 | helpers: false, 59 | regenerator: true 60 | } 61 | ], 62 | [ 63 | require('@babel/plugin-transform-regenerator').default, 64 | { 65 | async: false 66 | } 67 | ] 68 | ].filter(Boolean) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | config.web_console.whitelisted_ips = "70.194.13.32" 3 | # Settings specified here will take precedence over those in config/application.rb. 4 | 5 | # In the development environment your application's code is reloaded on 6 | # every request. This slows down response time but is perfect for development 7 | # since you don't have to restart the web server when you make code changes. 8 | config.cache_classes = false 9 | 10 | # Do not eager load code on boot. 11 | config.eager_load = false 12 | 13 | # Show full error reports and disable caching. 14 | config.consider_all_requests_local = true 15 | config.action_controller.perform_caching = false 16 | 17 | # Don't care if the mailer can't send. 18 | config.action_mailer.raise_delivery_errors = false 19 | 20 | # Print deprecation notices to the Rails logger. 21 | config.active_support.deprecation = :log 22 | 23 | # Raise an error on page load if there are pending migrations. 24 | config.active_record.migration_error = :page_load 25 | 26 | # Debug mode disables concatenation and preprocessing of assets. 27 | # This option may cause significant delays in view rendering with a large 28 | # number of complex assets. 29 | config.assets.debug = true 30 | 31 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 32 | # yet still be able to expire them through the digest params. 33 | config.assets.digest = true 34 | 35 | # Suppress logger output for asset requests. 36 | config.assets.quiet = true 37 | 38 | # Adds additional error checking when serving assets at runtime. 39 | # Checks for improperly declared sprockets dependencies. 40 | # Raises helpful error messages. 41 | config.assets.raise_runtime_errors = true 42 | 43 | # Raises error for missing translations 44 | # config.action_view.raise_on_missing_translations = true 45 | 46 | # Use an evented file watcher to asynchronously detect changes in source code, 47 | # routes, locales, etc. This feature depends on the listen gem. 48 | # config.file_watcher = ActiveSupport::EventedFileUpdateChecker 49 | end 50 | -------------------------------------------------------------------------------- /app/views/dashboards/show.slim: -------------------------------------------------------------------------------- 1 | - if flash[:info] 2 | .flashes 3 | .flash.flash-notice 4 | = flash[:info] 5 | 6 | header.main-content__header 7 | h1#page-title.main-content__page-title 💰🐜 Dashboard 📈 8 | 9 | #snapshot-chart 10 | 11 | table 12 | thead 13 | tr 14 | th Account Name 15 | th Last Updated 16 | th YTD Change 17 | th Monthly Change 18 | th Weekly Change 19 | th.total Amount 20 | 21 | tbody 22 | - @summaries.accounts.each do |summary| 23 | - next if summary.amount == 0 24 | tr 25 | td 26 | = link_to summary.name, admin_account_path(summary.account) 27 | td 28 | = summary.last_updated.strftime("%B %d, %Y") 29 | td.currency class=(summary.ytd_change.positive? ? 'positive' : 'negative') 30 | = humanized_money_with_symbol summary.ytd_change 31 | td.currency class=(summary.month_change.positive? ? 'positive' : 'negative') 32 | = humanized_money_with_symbol summary.month_change 33 | td.currency class=(summary.week_change.positive? ? 'positive' : 'negative') 34 | = humanized_money_with_symbol summary.week_change 35 | td.currency.total class=('negative' unless summary.amount.positive?) 36 | = humanized_money_with_symbol summary.amount 37 | tfoot 38 | tr 39 | td colspan=2 40 | strong Totals 41 | td.currency class=(@summaries.ytd_change.positive? ? 'positive' : 'negative') 42 | strong 43 | = humanized_money_with_symbol @summaries.ytd_change 44 | td.currency class=(@summaries.month_change.positive? ? 'positive' : 'negative') 45 | strong 46 | = humanized_money_with_symbol @summaries.month_change 47 | td.currency class=(@summaries.week_change.positive? ? 'positive' : 'negative') 48 | strong 49 | = humanized_money_with_symbol @summaries.week_change 50 | td.currency.total class=('negative' unless @summaries.amount.positive?) 51 | strong 52 | = humanized_money_with_symbol @summaries.amount 53 | 54 | - if @summaries.empty_accounts.any? 55 | p.fine-print 56 | | Hiding these accounts, because they're empty: #{@summaries.empty_accounts.map {|s| s.name }.join(", ")} 57 | 58 | .actions 59 | = link_to fine_ants_path, :method => :post do 60 | .big-update-button Take Fresh Account Snapshots! 61 | 62 | -------------------------------------------------------------------------------- /app/javascript/snapshot-chart.js: -------------------------------------------------------------------------------- 1 | import amcharts from 'amcharts3' 2 | import 'amcharts3/amcharts/serial' 3 | import 'amcharts3/amcharts/plugins/dataloader/dataloader' 4 | import 'amcharts3/amcharts/themes/light' 5 | 6 | document.addEventListener('turbo:load', () => { 7 | if (!document.getElementById('snapshot-chart')) return 8 | 9 | const chart = AmCharts.makeChart("snapshot-chart", { 10 | "pathToImages": "/assets/amcharts/images/", 11 | "type": "serial", 12 | "theme": "light", 13 | "marginRight": 40, 14 | "marginLeft": 40, 15 | "autoMarginOffset": 20, 16 | "mouseWheelZoomEnabled":true, 17 | "dataDateFormat": "YYYY-MM-DD", 18 | "valueAxes": [{ 19 | "id": "v1", 20 | "unit": "$", 21 | "unitPosition": "left", 22 | "axisAlpha": 0, 23 | }], 24 | "graphs": [{ 25 | "id": "g1", 26 | "bullet": "round", 27 | "bulletBorderAlpha": 1, 28 | "bulletColor": "#FFFFFF", 29 | "bulletSize": 5, 30 | "hideBulletsCount": 50, 31 | "lineThickness": 2, 32 | "useLineColorForBulletBorder": true, 33 | "valueField": "value", 34 | "balloonText": "$[[value]]" 35 | }, { 36 | "id": "g2", 37 | "bullet": "round", 38 | "bulletBorderAlpha": 1, 39 | "bulletColor": "#FFFFFF", 40 | "bulletSize": 5, 41 | "hideBulletsCount": 50, 42 | "lineThickness": 2, 43 | "useLineColorForBulletBorder": true, 44 | "valueField": "wage", 45 | "balloonText": "$[[wage]]" 46 | }], 47 | "chartScrollbar": { 48 | "graph": "g1", 49 | "oppositeAxis": false, 50 | "offset": 30, 51 | "scrollbarHeight": 80, 52 | "backgroundAlpha": 0, 53 | "selectedBackgroundAlpha": 0.1, 54 | "selectedBackgroundColor": "#888888", 55 | "graphFillAlpha": 0, 56 | "graphLineAlpha": 0.5, 57 | "selectedGraphFillAlpha": 0, 58 | "selectedGraphLineAlpha": 1, 59 | "autoGridCount":true, 60 | "color":"#AAAAAA" 61 | }, 62 | "chartCursor": { 63 | "pan": true, 64 | "valueLineEnabled": true, 65 | "valueLineBalloonEnabled": true, 66 | "cursorAlpha":1, 67 | "cursorColor":"#258cbb", 68 | "limitToGraph":"g1", 69 | "valueLineAlpha":0.2, 70 | "valueZoomable":true 71 | }, 72 | "valueScrollbar":{ 73 | "offset": 20, 74 | "scrollbarHeight":10 75 | }, 76 | "categoryField": "date", 77 | "categoryAxis": { 78 | "parseDates": true, 79 | "dashLength": 1, 80 | "minorGridEnabled": true 81 | }, 82 | "dataLoader": { 83 | "url": "/dashboard/snapshot-chart-data" 84 | } 85 | }) 86 | }) 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fine_ants_app 🐜 2 | 3 | This is a little Rails app that uses the 4 | [fine_ants](https://github.com/searls/fine_ants) 🐜 gem to aggregate personal account standings and tally them up by taking snapshots using Capybara (e.g. scraping them with browsers). It's meant to be run locally. 5 | 6 | Demo dashboard screenshot 7 | 8 | ## setup 9 | 10 | **This app isn't secured! At all! It's meant to be run locally! Don't go 11 | deploying it to Heroku or Google or the Cloud!** 12 | 13 | ### requirements 14 | 15 | - Ruby 3.2.1 16 | - Bundler 2 17 | - Yarn 1 18 | 19 | ### install 20 | 21 | ``` 22 | $ git clone git@github.com:searls/fine-ants-app.git # 🐜 23 | $ cd fine-ants-app 24 | $ bin/setup 25 | $ bin/dev 26 | ``` 27 | 28 | That'll get the server going at [http://localhost:3000](http://localhost:3000). 29 | 30 | ### demo 31 | 32 | **Be sure to run this on an empty database to keep from corrupting your data.** 33 | 34 | To generate demo data with which to play with the app, run 35 | 36 | ``` 37 | $ bin/rails demo 38 | ``` 39 | 40 | This will add randomized banks, accounts, and snapshot data to your database. 41 | Also, keep in mind that the demo data isn't attached to a supported fine_ants 42 | adapter, and so any attempts to generate fresh snapshots will fail. It's just 43 | there to give you a look at the dashboard with some data in it. 44 | 45 | ### create stuff 46 | 47 | 1. Create a bank (e.g. named "Vanguard", adapter "vanguard") 48 | [here](http://localhost:3000/admin/banks/new) 49 | 2. Create a user for that 🐜 bank with your user and password 50 | [here](http://localhost:3000/admin/users/new) 51 | 3. Head 🐜 back to the [dashboard](http://localhost:3000/) and click 52 | "Update Accounts" to kick off update process. This will save off `Snapshot` 53 | models for each of your accounts 54 | 4. After the 🐜 update finishes, your dashboard should tally up your accounts based 55 | on their latest snapshots, giving you the grand total 56 | 57 | ## secure your data 58 | 59 | I secure my data on an encrypted disk image. I do this with Disk Utility: 60 | 61 | ![screen shot 2016-08-07 at 12 18 40 pm](https://cloud.githubusercontent.com/assets/79303/17463676/1f8db934-5c99-11e6-99d1-18f3bffe7b82.png) 62 | 63 | With the disk image mounted to `/Volumes/fine_ants_data`, I then set up symlinks 64 | to my local databases: 65 | 66 | ``` 67 | $ cd db 68 | $ ln -s /Volumes/fine_ants_data/development.sqlite3 . 69 | $ ln -s /Volumes/fine_ants_data/test.sqlite3 . 70 | ``` 71 | 72 | Then, when starting my app, I start by opening (and decrypting the local disk 73 | image) with: 74 | 75 | ``` 76 | $ open db/data.dmg 77 | # Which will prompt me for the image's password 78 | $ bin/dev 79 | ``` 80 | 81 | Since it's so easy to encrypt your local data in OS X, this is a good enough 82 | safeguard against accidentally sharing your personal financial information when 83 | moving around code and projects, which most people typically think of as safe. 84 | -------------------------------------------------------------------------------- /config/initializers/money.rb: -------------------------------------------------------------------------------- 1 | MoneyRails.configure do |config| 2 | Money.locale_backend = :currency 3 | 4 | # To set the default currency 5 | # 6 | # config.default_currency = :usd 7 | 8 | # Set default bank object 9 | # 10 | # Example: 11 | # config.default_bank = EuCentralBank.new 12 | 13 | # Add exchange rates to current money bank object. 14 | # (The conversion rate refers to one direction only) 15 | # 16 | # Example: 17 | # config.add_rate "USD", "CAD", 1.24515 18 | # config.add_rate "CAD", "USD", 0.803115 19 | 20 | # To handle the inclusion of validations for monetized fields 21 | # The default value is true 22 | # 23 | # config.include_validations = true 24 | 25 | # Default ActiveRecord migration configuration values for columns: 26 | # 27 | # config.amount_column = { prefix: '', # column name prefix 28 | # postfix: '_cents', # column name postfix 29 | # column_name: nil, # full column name (overrides prefix, postfix and accessor name) 30 | # type: :integer, # column type 31 | # present: true, # column will be created 32 | # null: false, # other options will be treated as column options 33 | # default: 0 34 | # } 35 | # 36 | # config.currency_column = { prefix: '', 37 | # postfix: '_currency', 38 | # column_name: nil, 39 | # type: :string, 40 | # present: true, 41 | # null: false, 42 | # default: 'USD' 43 | # } 44 | 45 | # Register a custom currency 46 | # 47 | # Example: 48 | # config.register_currency = { 49 | # :priority => 1, 50 | # :iso_code => "EU4", 51 | # :name => "Euro with subunit of 4 digits", 52 | # :symbol => "€", 53 | # :symbol_first => true, 54 | # :subunit => "Subcent", 55 | # :subunit_to_unit => 10000, 56 | # :thousands_separator => ".", 57 | # :decimal_mark => "," 58 | # } 59 | 60 | # Specify a rounding mode 61 | # Any one of: 62 | # 63 | # BigDecimal::ROUND_UP, 64 | # BigDecimal::ROUND_DOWN, 65 | # BigDecimal::ROUND_HALF_UP, 66 | # BigDecimal::ROUND_HALF_DOWN, 67 | # BigDecimal::ROUND_HALF_EVEN, 68 | # BigDecimal::ROUND_CEILING, 69 | # BigDecimal::ROUND_FLOOR 70 | # 71 | # set to BigDecimal::ROUND_HALF_EVEN by default 72 | # 73 | # config.rounding_mode = BigDecimal::ROUND_HALF_UP 74 | 75 | # Set default money format globally. 76 | # Default value is nil meaning "ignore this option". 77 | # Example: 78 | # 79 | # config.default_format = { 80 | # :no_cents_if_whole => nil, 81 | # :symbol => nil, 82 | # :sign_before_symbol => nil 83 | # } 84 | 85 | # Set default raise_error_on_money_parsing option 86 | # It will be raise error if assigned different currency 87 | # The default value is false 88 | # 89 | # Example: 90 | # config.raise_error_on_money_parsing = false 91 | end 92 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[7.0].define(version: 2018_10_13_152718) do 14 | create_table "accounts", force: :cascade do |t| 15 | t.integer "bank_id" 16 | t.string "foreign_id" 17 | t.string "name" 18 | t.datetime "created_at", precision: nil, null: false 19 | t.datetime "updated_at", precision: nil, null: false 20 | t.boolean "disabled", default: false, null: false 21 | t.index ["bank_id", "foreign_id"], name: "index_accounts_on_bank_id_and_foreign_id", unique: true 22 | t.index ["bank_id"], name: "index_accounts_on_bank_id" 23 | end 24 | 25 | create_table "accounts_users", force: :cascade do |t| 26 | t.integer "user_id" 27 | t.integer "account_id" 28 | t.datetime "created_at", precision: nil, null: false 29 | t.datetime "updated_at", precision: nil, null: false 30 | t.index ["account_id"], name: "index_accounts_users_on_account_id" 31 | t.index ["user_id", "account_id"], name: "index_accounts_users_on_user_id_and_account_id", unique: true 32 | t.index ["user_id"], name: "index_accounts_users_on_user_id" 33 | end 34 | 35 | create_table "banks", force: :cascade do |t| 36 | t.string "name" 37 | t.string "fine_ants_adapter" 38 | t.datetime "created_at", precision: nil, null: false 39 | t.datetime "updated_at", precision: nil, null: false 40 | end 41 | 42 | create_table "snapshots", force: :cascade do |t| 43 | t.integer "account_id" 44 | t.integer "amount_cents", default: 0, null: false 45 | t.string "amount_currency", default: "USD", null: false 46 | t.datetime "created_at", precision: nil, null: false 47 | t.datetime "updated_at", precision: nil, null: false 48 | t.index ["account_id"], name: "index_snapshots_on_account_id" 49 | end 50 | 51 | create_table "users", force: :cascade do |t| 52 | t.integer "bank_id" 53 | t.string "user" 54 | t.string "password" 55 | t.datetime "created_at", precision: nil, null: false 56 | t.datetime "updated_at", precision: nil, null: false 57 | t.boolean "disabled", default: false, null: false 58 | t.index ["bank_id"], name: "index_users_on_bank_id" 59 | end 60 | 61 | create_table "wages", force: :cascade do |t| 62 | t.integer "amount_cents", default: 0, null: false 63 | t.string "amount_currency", default: "USD", null: false 64 | t.date "date" 65 | t.string "description" 66 | t.datetime "created_at", precision: nil, null: false 67 | t.datetime "updated_at", precision: nil, null: false 68 | end 69 | 70 | add_foreign_key "accounts", "banks" 71 | add_foreign_key "accounts_users", "accounts" 72 | add_foreign_key "accounts_users", "users" 73 | add_foreign_key "snapshots", "accounts" 74 | add_foreign_key "users", "banks" 75 | end 76 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like 20 | # NGINX, varnish or squid. 21 | # config.action_dispatch.rack_cache = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.serve_static_files = ENV["RAILS_SERVE_STATIC_FILES"].present? 26 | 27 | # Compress JavaScripts and CSS. 28 | config.assets.js_compressor = :uglifier 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = false 33 | 34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 35 | # yet still be able to expire them through the digest params. 36 | config.assets.digest = true 37 | 38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 39 | 40 | # Specifies the header that your server uses for sending files. 41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 43 | 44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 45 | # config.force_ssl = true 46 | 47 | # Use the lowest log level to ensure availability of diagnostic information 48 | # when problems arise. 49 | config.log_level = :debug 50 | 51 | # Prepend all log lines with the following tags. 52 | # config.log_tags = [ :subdomain, :uuid ] 53 | 54 | # Use a different logger for distributed setups. 55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 56 | 57 | # Use a different cache store in production. 58 | # config.cache_store = :mem_cache_store 59 | 60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 61 | # config.action_controller.asset_host = 'http://assets.example.com' 62 | 63 | # Ignore bad email addresses and do not raise email delivery errors. 64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 65 | # config.action_mailer.raise_delivery_errors = false 66 | 67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 68 | # the I18n.default_locale when a translation cannot be found). 69 | config.i18n.fallbacks = [I18n.default_locale] 70 | 71 | # Send deprecation notices to registered listeners. 72 | config.active_support.deprecation = :notify 73 | 74 | # Use default logging formatter so that PID and timestamp are not suppressed. 75 | config.log_formatter = ::Logger::Formatter.new 76 | 77 | # Do not dump schema after migrations. 78 | config.active_record.dump_schema_after_migration = false 79 | end 80 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/searls/fine_ants 3 | revision: a307d812b98a65f54b69096deef58063c297e722 4 | specs: 5 | fine_ants (1.9.0) 6 | capybara (~> 3.26) 7 | selenium-webdriver (~> 3.142.0) 8 | 9 | GEM 10 | remote: https://rubygems.org/ 11 | specs: 12 | actioncable (7.0.4.2) 13 | actionpack (= 7.0.4.2) 14 | activesupport (= 7.0.4.2) 15 | nio4r (~> 2.0) 16 | websocket-driver (>= 0.6.1) 17 | actionmailbox (7.0.4.2) 18 | actionpack (= 7.0.4.2) 19 | activejob (= 7.0.4.2) 20 | activerecord (= 7.0.4.2) 21 | activestorage (= 7.0.4.2) 22 | activesupport (= 7.0.4.2) 23 | mail (>= 2.7.1) 24 | net-imap 25 | net-pop 26 | net-smtp 27 | actionmailer (7.0.4.2) 28 | actionpack (= 7.0.4.2) 29 | actionview (= 7.0.4.2) 30 | activejob (= 7.0.4.2) 31 | activesupport (= 7.0.4.2) 32 | mail (~> 2.5, >= 2.5.4) 33 | net-imap 34 | net-pop 35 | net-smtp 36 | rails-dom-testing (~> 2.0) 37 | actionpack (7.0.4.2) 38 | actionview (= 7.0.4.2) 39 | activesupport (= 7.0.4.2) 40 | rack (~> 2.0, >= 2.2.0) 41 | rack-test (>= 0.6.3) 42 | rails-dom-testing (~> 2.0) 43 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 44 | actiontext (7.0.4.2) 45 | actionpack (= 7.0.4.2) 46 | activerecord (= 7.0.4.2) 47 | activestorage (= 7.0.4.2) 48 | activesupport (= 7.0.4.2) 49 | globalid (>= 0.6.0) 50 | nokogiri (>= 1.8.5) 51 | actionview (7.0.4.2) 52 | activesupport (= 7.0.4.2) 53 | builder (~> 3.1) 54 | erubi (~> 1.4) 55 | rails-dom-testing (~> 2.0) 56 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 57 | activejob (7.0.4.2) 58 | activesupport (= 7.0.4.2) 59 | globalid (>= 0.3.6) 60 | activemodel (7.0.4.2) 61 | activesupport (= 7.0.4.2) 62 | activerecord (7.0.4.2) 63 | activemodel (= 7.0.4.2) 64 | activesupport (= 7.0.4.2) 65 | activestorage (7.0.4.2) 66 | actionpack (= 7.0.4.2) 67 | activejob (= 7.0.4.2) 68 | activerecord (= 7.0.4.2) 69 | activesupport (= 7.0.4.2) 70 | marcel (~> 1.0) 71 | mini_mime (>= 1.1.0) 72 | activesupport (7.0.4.2) 73 | concurrent-ruby (~> 1.0, >= 1.0.2) 74 | i18n (>= 1.6, < 2) 75 | minitest (>= 5.1) 76 | tzinfo (~> 2.0) 77 | addressable (2.8.1) 78 | public_suffix (>= 2.0.2, < 6.0) 79 | administrate (0.18.0) 80 | actionpack (>= 5.0) 81 | actionview (>= 5.0) 82 | activerecord (>= 5.0) 83 | jquery-rails (>= 4.0) 84 | kaminari (>= 1.0) 85 | sassc-rails (~> 2.1) 86 | selectize-rails (~> 0.6) 87 | ast (2.4.2) 88 | bindex (0.8.1) 89 | builder (3.2.4) 90 | capybara (3.38.0) 91 | addressable 92 | matrix 93 | mini_mime (>= 0.1.3) 94 | nokogiri (~> 1.8) 95 | rack (>= 1.6.0) 96 | rack-test (>= 0.6.3) 97 | regexp_parser (>= 1.5, < 3.0) 98 | xpath (~> 3.2) 99 | childprocess (3.0.0) 100 | coderay (1.1.3) 101 | concurrent-ruby (1.2.0) 102 | crass (1.0.6) 103 | date (3.3.3) 104 | dotenv (2.8.1) 105 | erubi (1.12.0) 106 | execjs (2.8.1) 107 | faker (3.1.1) 108 | i18n (>= 1.8.11, < 2) 109 | ffi (1.15.5) 110 | globalid (1.1.0) 111 | activesupport (>= 5.0) 112 | good_migrations (0.2.1) 113 | activerecord (>= 3.1) 114 | railties (>= 3.1) 115 | i18n (1.12.0) 116 | concurrent-ruby (~> 1.0) 117 | jquery-rails (4.5.1) 118 | rails-dom-testing (>= 1, < 3) 119 | railties (>= 4.2.0) 120 | thor (>= 0.14, < 2.0) 121 | jsbundling-rails (1.1.1) 122 | railties (>= 6.0.0) 123 | json (2.6.3) 124 | kaminari (1.2.2) 125 | activesupport (>= 4.1.0) 126 | kaminari-actionview (= 1.2.2) 127 | kaminari-activerecord (= 1.2.2) 128 | kaminari-core (= 1.2.2) 129 | kaminari-actionview (1.2.2) 130 | actionview 131 | kaminari-core (= 1.2.2) 132 | kaminari-activerecord (1.2.2) 133 | activerecord 134 | kaminari-core (= 1.2.2) 135 | kaminari-core (1.2.2) 136 | language_server-protocol (3.17.0.3) 137 | loofah (2.19.1) 138 | crass (~> 1.0.2) 139 | nokogiri (>= 1.5.9) 140 | mail (2.8.1) 141 | mini_mime (>= 0.1.1) 142 | net-imap 143 | net-pop 144 | net-smtp 145 | marcel (1.0.2) 146 | matrix (0.4.2) 147 | method_source (1.0.0) 148 | mini_mime (1.1.2) 149 | mini_portile2 (2.8.1) 150 | minitest (5.17.0) 151 | monetize (1.12.0) 152 | money (~> 6.12) 153 | money (6.16.0) 154 | i18n (>= 0.6.4, <= 2) 155 | money-rails (1.15.0) 156 | activesupport (>= 3.0) 157 | monetize (~> 1.9) 158 | money (~> 6.13) 159 | railties (>= 3.0) 160 | net-imap (0.3.4) 161 | date 162 | net-protocol 163 | net-pop (0.1.2) 164 | net-protocol 165 | net-protocol (0.2.1) 166 | timeout 167 | net-smtp (0.3.3) 168 | net-protocol 169 | nio4r (2.5.8) 170 | nokogiri (1.14.1) 171 | mini_portile2 (~> 2.8.0) 172 | racc (~> 1.4) 173 | parallel (1.22.1) 174 | parser (3.2.1.0) 175 | ast (~> 2.4.1) 176 | pry (0.14.2) 177 | coderay (~> 1.1) 178 | method_source (~> 1.0) 179 | pry-rails (0.3.9) 180 | pry (>= 0.10.4) 181 | public_suffix (5.0.1) 182 | puma (6.0.2) 183 | nio4r (~> 2.0) 184 | racc (1.6.2) 185 | rack (2.2.6.2) 186 | rack-test (2.0.2) 187 | rack (>= 1.3) 188 | rails (7.0.4.2) 189 | actioncable (= 7.0.4.2) 190 | actionmailbox (= 7.0.4.2) 191 | actionmailer (= 7.0.4.2) 192 | actionpack (= 7.0.4.2) 193 | actiontext (= 7.0.4.2) 194 | actionview (= 7.0.4.2) 195 | activejob (= 7.0.4.2) 196 | activemodel (= 7.0.4.2) 197 | activerecord (= 7.0.4.2) 198 | activestorage (= 7.0.4.2) 199 | activesupport (= 7.0.4.2) 200 | bundler (>= 1.15.0) 201 | railties (= 7.0.4.2) 202 | rails-dom-testing (2.0.3) 203 | activesupport (>= 4.2.0) 204 | nokogiri (>= 1.6) 205 | rails-html-sanitizer (1.5.0) 206 | loofah (~> 2.19, >= 2.19.1) 207 | railties (7.0.4.2) 208 | actionpack (= 7.0.4.2) 209 | activesupport (= 7.0.4.2) 210 | method_source 211 | rake (>= 12.2) 212 | thor (~> 1.0) 213 | zeitwerk (~> 2.5) 214 | rainbow (3.1.1) 215 | rake (13.0.6) 216 | regexp_parser (2.7.0) 217 | rexml (3.2.5) 218 | rubocop (1.44.1) 219 | json (~> 2.3) 220 | parallel (~> 1.10) 221 | parser (>= 3.2.0.0) 222 | rainbow (>= 2.2.2, < 4.0) 223 | regexp_parser (>= 1.8, < 3.0) 224 | rexml (>= 3.2.5, < 4.0) 225 | rubocop-ast (>= 1.24.1, < 2.0) 226 | ruby-progressbar (~> 1.7) 227 | unicode-display_width (>= 2.4.0, < 3.0) 228 | rubocop-ast (1.26.0) 229 | parser (>= 3.2.1.0) 230 | rubocop-performance (1.15.2) 231 | rubocop (>= 1.7.0, < 2.0) 232 | rubocop-ast (>= 0.4.0) 233 | ruby-progressbar (1.11.0) 234 | rubyzip (2.3.2) 235 | sassc (2.4.0) 236 | ffi (~> 1.9) 237 | sassc-rails (2.1.2) 238 | railties (>= 4.0.0) 239 | sassc (>= 2.0) 240 | sprockets (> 3.0) 241 | sprockets-rails 242 | tilt 243 | selectize-rails (0.12.6) 244 | selenium-webdriver (3.142.7) 245 | childprocess (>= 0.5, < 4.0) 246 | rubyzip (>= 1.2.2) 247 | slim (4.1.0) 248 | temple (>= 0.7.6, < 0.9) 249 | tilt (>= 2.0.6, < 2.1) 250 | slim-rails (3.5.1) 251 | actionpack (>= 3.1) 252 | railties (>= 3.1) 253 | slim (>= 3.0, < 5.0) 254 | sprockets (4.2.0) 255 | concurrent-ruby (~> 1.0) 256 | rack (>= 2.2.4, < 4) 257 | sprockets-rails (3.4.2) 258 | actionpack (>= 5.2) 259 | activesupport (>= 5.2) 260 | sprockets (>= 3.0.0) 261 | sqlite3 (1.6.0) 262 | mini_portile2 (~> 2.8.0) 263 | standard (1.24.3) 264 | language_server-protocol (~> 3.17.0.2) 265 | rubocop (= 1.44.1) 266 | rubocop-performance (= 1.15.2) 267 | table_print (1.5.7) 268 | temple (0.8.2) 269 | thor (1.2.1) 270 | tilt (2.0.11) 271 | timeout (0.3.1) 272 | turbo-rails (1.3.3) 273 | actionpack (>= 6.0.0) 274 | activejob (>= 6.0.0) 275 | railties (>= 6.0.0) 276 | tzinfo (2.0.6) 277 | concurrent-ruby (~> 1.0) 278 | uglifier (4.2.0) 279 | execjs (>= 0.3.0, < 3) 280 | unicode-display_width (2.4.2) 281 | web-console (4.2.0) 282 | actionview (>= 6.0.0) 283 | activemodel (>= 6.0.0) 284 | bindex (>= 0.4.0) 285 | railties (>= 6.0.0) 286 | websocket-driver (0.7.5) 287 | websocket-extensions (>= 0.1.0) 288 | websocket-extensions (0.1.5) 289 | xpath (3.2.0) 290 | nokogiri (~> 1.8) 291 | zeitwerk (2.6.7) 292 | 293 | PLATFORMS 294 | ruby 295 | 296 | DEPENDENCIES 297 | administrate 298 | dotenv 299 | faker 300 | fine_ants! 301 | good_migrations 302 | jsbundling-rails 303 | money-rails 304 | pry-rails 305 | puma 306 | rails (~> 7.0) 307 | sassc-rails 308 | slim-rails 309 | sqlite3 310 | standard 311 | table_print 312 | turbo-rails 313 | uglifier 314 | web-console 315 | 316 | RUBY VERSION 317 | ruby 3.2.1p31 318 | 319 | BUNDLED WITH 320 | 2.4.6 321 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@esbuild/android-arm64@0.17.7": 6 | version "0.17.7" 7 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.7.tgz#7d22b442815624423de5541545401e12a8d474d8" 8 | integrity sha512-fOUBZvcbtbQJIj2K/LMKcjULGfXLV9R4qjXFsi3UuqFhIRJHz0Fp6kFjsMFI6vLuPrfC5G9Dmh+3RZOrSKY2Lg== 9 | 10 | "@esbuild/android-arm@0.17.7": 11 | version "0.17.7" 12 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.7.tgz#fa30de0cfae8e8416c693dc449c415765542483b" 13 | integrity sha512-Np6Lg8VUiuzHP5XvHU7zfSVPN4ILdiOhxA1GQ1uvCK2T2l3nI8igQV0c9FJx4hTkq8WGqhGEvn5UuRH8jMkExg== 14 | 15 | "@esbuild/android-x64@0.17.7": 16 | version "0.17.7" 17 | resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.7.tgz#34a1af914510ec821246859f8ae7d8fe843dd37b" 18 | integrity sha512-6YILpPvop1rPAvaO/n2iWQL45RyTVTR/1SK7P6Xi2fyu+hpEeX22fE2U2oJd1sfpovUJOWTRdugjddX6QCup3A== 19 | 20 | "@esbuild/darwin-arm64@0.17.7": 21 | version "0.17.7" 22 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.7.tgz#06712059a30a6130eef701fb634883a4aaea02f7" 23 | integrity sha512-7i0gfFsDt1BBiurZz5oZIpzfxqy5QkJmhXdtrf2Hma/gI9vL2AqxHhRBoI1NeWc9IhN1qOzWZrslhiXZweMSFg== 24 | 25 | "@esbuild/darwin-x64@0.17.7": 26 | version "0.17.7" 27 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.7.tgz#58cd69d00d5b9847ad2015858a7ec3f10bf309ad" 28 | integrity sha512-hRvIu3vuVIcv4SJXEKOHVsNssM5tLE2xWdb9ZyJqsgYp+onRa5El3VJ4+WjTbkf/A2FD5wuMIbO2FCTV39LE0w== 29 | 30 | "@esbuild/freebsd-arm64@0.17.7": 31 | version "0.17.7" 32 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.7.tgz#1dd3de24a9683c8321a4e3c42b11b32a48e791d4" 33 | integrity sha512-2NJjeQ9kiabJkVXLM3sHkySqkL1KY8BeyLams3ITyiLW10IwDL0msU5Lq1cULCn9zNxt1Seh1I6QrqyHUvOtQw== 34 | 35 | "@esbuild/freebsd-x64@0.17.7": 36 | version "0.17.7" 37 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.7.tgz#b0e409e1c7cc05412c8dd149c2c39e0a1dee9567" 38 | integrity sha512-8kSxlbjuLYMoIgvRxPybirHJeW45dflyIgHVs+jzMYJf87QOay1ZUTzKjNL3vqHQjmkSn8p6KDfHVrztn7Rprw== 39 | 40 | "@esbuild/linux-arm64@0.17.7": 41 | version "0.17.7" 42 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.7.tgz#35cfae28e460b96ccc027eccc28b13c0712d6df3" 43 | integrity sha512-43Bbhq3Ia/mGFTCRA4NlY8VRH3dLQltJ4cqzhSfq+cdvdm9nKJXVh4NUkJvdZgEZIkf/ufeMmJ0/22v9btXTcw== 44 | 45 | "@esbuild/linux-arm@0.17.7": 46 | version "0.17.7" 47 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.7.tgz#a378301c253ef64d19a112c9ec922680c2fb5a71" 48 | integrity sha512-07RsAAzznWqdfJC+h3L2UVWwnUHepsFw5GmzySnUspHHb7glJ1+47rvlcH0SeUtoVOs8hF4/THgZbtJRyALaJA== 49 | 50 | "@esbuild/linux-ia32@0.17.7": 51 | version "0.17.7" 52 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.7.tgz#7d36087db95b1faaee8df203c511775a4d322a2b" 53 | integrity sha512-ViYkfcfnbwOoTS7xE4DvYFv7QOlW8kPBuccc4erJ0jx2mXDPR7e0lYOH9JelotS9qe8uJ0s2i3UjUvjunEp53A== 54 | 55 | "@esbuild/linux-loong64@0.17.7": 56 | version "0.17.7" 57 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.7.tgz#b989253520308d81ee0e4846de9f63f2f11c7f10" 58 | integrity sha512-H1g+AwwcqYQ/Hl/sMcopRcNLY/fysIb/ksDfCa3/kOaHQNhBrLeDYw+88VAFV5U6oJL9GqnmUj72m9Nv3th3hA== 59 | 60 | "@esbuild/linux-mips64el@0.17.7": 61 | version "0.17.7" 62 | resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.7.tgz#ae751365cdf967dfa89dd59cdb0dcc8723a66f9a" 63 | integrity sha512-MDLGrVbTGYtmldlbcxfeDPdhxttUmWoX3ovk9u6jc8iM+ueBAFlaXKuUMCoyP/zfOJb+KElB61eSdBPSvNcCEg== 64 | 65 | "@esbuild/linux-ppc64@0.17.7": 66 | version "0.17.7" 67 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.7.tgz#ad1c9299c463f0409e57166e76e91afb6193ea9f" 68 | integrity sha512-UWtLhRPKzI+v2bKk4j9rBpGyXbLAXLCOeqt1tLVAt1mfagHpFjUzzIHCpPiUfY3x1xY5e45/+BWzGpqqvSglNw== 69 | 70 | "@esbuild/linux-riscv64@0.17.7": 71 | version "0.17.7" 72 | resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.7.tgz#84acb7451bef7458e6067d9c358026ffa1831910" 73 | integrity sha512-3C/RTKqZauUwBYtIQAv7ELTJd+H2dNKPyzwE2ZTbz2RNrNhNHRoeKnG5C++eM6nSZWUCLyyaWfq1v1YRwBS/+A== 74 | 75 | "@esbuild/linux-s390x@0.17.7": 76 | version "0.17.7" 77 | resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.7.tgz#0bf23c78c52ea60ae4ea95239b728683a86a7ab8" 78 | integrity sha512-x7cuRSCm998KFZqGEtSo8rI5hXLxWji4znZkBhg2FPF8A8lxLLCsSXe2P5utf0RBQflb3K97dkEH/BJwTqrbDw== 79 | 80 | "@esbuild/linux-x64@0.17.7": 81 | version "0.17.7" 82 | resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.7.tgz#932d8c6e1b0d6a57a4e94a8390dfebeebba21dcc" 83 | integrity sha512-1Z2BtWgM0Wc92WWiZR5kZ5eC+IetI++X+nf9NMbUvVymt74fnQqwgM5btlTW7P5uCHfq03u5MWHjIZa4o+TnXQ== 84 | 85 | "@esbuild/netbsd-x64@0.17.7": 86 | version "0.17.7" 87 | resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.7.tgz#6aa81873c6e08aa419378e07c8d3eed5aa77bf25" 88 | integrity sha512-//VShPN4hgbmkDjYNCZermIhj8ORqoPNmAnwSPqPtBB0xOpHrXMlJhsqLNsgoBm0zi/5tmy//WyL6g81Uq2c6Q== 89 | 90 | "@esbuild/openbsd-x64@0.17.7": 91 | version "0.17.7" 92 | resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.7.tgz#0698f260250a7022e2cae7385cbd09a86eb0967c" 93 | integrity sha512-IQ8BliXHiOsbQEOHzc7mVLIw2UYPpbOXJQ9cK1nClNYQjZthvfiA6rWZMz4BZpVzHZJ+/H2H23cZwRJ1NPYOGg== 94 | 95 | "@esbuild/sunos-x64@0.17.7": 96 | version "0.17.7" 97 | resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.7.tgz#ef97445672deec50e3b3549af2ee6d42fbc04250" 98 | integrity sha512-phO5HvU3SyURmcW6dfQXX4UEkFREUwaoiTgi1xH+CAFKPGsrcG6oDp1U70yQf5lxRKujoSCEIoBr0uFykJzN2g== 99 | 100 | "@esbuild/win32-arm64@0.17.7": 101 | version "0.17.7" 102 | resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.7.tgz#70865d2332d7883e2e49077770adfe51c51343e3" 103 | integrity sha512-G/cRKlYrwp1B0uvzEdnFPJ3A6zSWjnsRrWivsEW0IEHZk+czv0Bmiwa51RncruHLjQ4fGsvlYPmCmwzmutPzHA== 104 | 105 | "@esbuild/win32-ia32@0.17.7": 106 | version "0.17.7" 107 | resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.7.tgz#39831b787013c7da7e61c8eb6a9df0fed9bd0fcb" 108 | integrity sha512-/yMNVlMew07NrOflJdRAZcMdUoYTOCPbCHx0eHtg55l87wXeuhvYOPBQy5HLX31Ku+W2XsBD5HnjUjEUsTXJug== 109 | 110 | "@esbuild/win32-x64@0.17.7": 111 | version "0.17.7" 112 | resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.7.tgz#03b231fcfa0702562978979468dfc8b09b55ac59" 113 | integrity sha512-K9/YybM6WZO71x73Iyab6mwieHtHjm9hrPR/a9FBPZmFO3w+fJaM2uu2rt3JYf/rZR24MFwTliI8VSoKKOtYtg== 114 | 115 | "@hotwired/turbo-rails@^7.2.5": 116 | version "7.2.5" 117 | resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.2.5.tgz#74fc3395a29a76df2bb8835aa88c86885cffde4c" 118 | integrity sha512-F8ztmARxd/XBdevRa//HoJGZ7u+Unb0J7cQUeUP+pBvt9Ta2TJJ7a2TORAOhjC8Zgxx+LKwm/1UUHqN3ojjiGw== 119 | dependencies: 120 | "@hotwired/turbo" "^7.2.5" 121 | "@rails/actioncable" "^7.0" 122 | 123 | "@hotwired/turbo@^7.2.5": 124 | version "7.2.5" 125 | resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.2.5.tgz#2d9d6bde8a9549c3aea8970445ade16ffd56719a" 126 | integrity sha512-o5PByC/mWkmTe4pWnKrixhPECJUxIT/NHtxKqjq7n9Fj6JlNza1pgxdTCJVIq+PI0j95U+7mA3N4n4A/QYZtZQ== 127 | 128 | "@rails/actioncable@^7.0": 129 | version "7.0.4" 130 | resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.0.4.tgz#70a3ca56809f7aaabb80af2f9c01ae51e1a8ed41" 131 | integrity sha512-tz4oM+Zn9CYsvtyicsa/AwzKZKL+ITHWkhiu7x+xF77clh2b4Rm+s6xnOgY/sGDWoFWZmtKsE95hxBPkgQQNnQ== 132 | 133 | "@rails/ujs@^7.0.4-2": 134 | version "7.0.4-2" 135 | resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.0.4-2.tgz#62b108cc297c0c60f415720295673ee73f08e210" 136 | integrity sha512-ec6e2+YSfg4DgrVzIYzpo7ayze6dOu+lZ6RsIR+COkuZCp2QGMEyHZQzNdHt065FjCtpv6wRZQIybAtWrzPqlQ== 137 | 138 | amcharts3@amcharts/amcharts3: 139 | version "3.21.15" 140 | resolved "https://codeload.github.com/amcharts/amcharts3/tar.gz/cac5a668652f271dd28c82a072da364c0bd708db" 141 | 142 | esbuild@^0.17.7: 143 | version "0.17.7" 144 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.7.tgz#a7ace55f2bf82fdb1c9013a924620ce2596984fa" 145 | integrity sha512-+5hHlrK108fT6C6/40juy0w4DYKtyZ5NjfBlTccBdsFutR7WBxpIY633JzZJewdsCy8xWA/u2z0MSniIJwufYg== 146 | optionalDependencies: 147 | "@esbuild/android-arm" "0.17.7" 148 | "@esbuild/android-arm64" "0.17.7" 149 | "@esbuild/android-x64" "0.17.7" 150 | "@esbuild/darwin-arm64" "0.17.7" 151 | "@esbuild/darwin-x64" "0.17.7" 152 | "@esbuild/freebsd-arm64" "0.17.7" 153 | "@esbuild/freebsd-x64" "0.17.7" 154 | "@esbuild/linux-arm" "0.17.7" 155 | "@esbuild/linux-arm64" "0.17.7" 156 | "@esbuild/linux-ia32" "0.17.7" 157 | "@esbuild/linux-loong64" "0.17.7" 158 | "@esbuild/linux-mips64el" "0.17.7" 159 | "@esbuild/linux-ppc64" "0.17.7" 160 | "@esbuild/linux-riscv64" "0.17.7" 161 | "@esbuild/linux-s390x" "0.17.7" 162 | "@esbuild/linux-x64" "0.17.7" 163 | "@esbuild/netbsd-x64" "0.17.7" 164 | "@esbuild/openbsd-x64" "0.17.7" 165 | "@esbuild/sunos-x64" "0.17.7" 166 | "@esbuild/win32-arm64" "0.17.7" 167 | "@esbuild/win32-ia32" "0.17.7" 168 | "@esbuild/win32-x64" "0.17.7" 169 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | fine_ants_app - a Rails app for aggregating finance account info 635 | Copyright (C) 2016 Justin Searls 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------