Skip to content

Commit

Permalink
Add initial data model work and makeshift UI
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Nov 20, 2024
1 parent 6311697 commit 16da1e6
Show file tree
Hide file tree
Showing 137 changed files with 8,255 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.

# Ignore git directory.
/.git/
/.gitignore

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all default key files.
/config/master.key
/config/credentials/*.key
/config/bigquery-keyfile.json

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/.keep

# Ignore assets.
/node_modules/
/app/assets/builds/*
!/app/assets/builds/.keep
/public/assets

# Ignore CI service files.
/.github

# Ignore development files
/.devcontainer

# Ignore Docker-related files
/.dockerignore
/Dockerfile*
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
config/credentials/*.yml.enc diff=rails_credentials
config/credentials.yml.enc diff=rails_credentials
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: "daily"
versioning-strategy: lockfile-only
allow:
- dependency-name: "rails"
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# Temporary files generated by your text editor or operating system
# belong in git's global ignore instead:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key
/config/bigquery-keyfile.json

/node_modules
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruby 3.3.6
nodejs 20.9.0
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"emmet.includeLanguages": {
"erb": "html"
}
}
52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Development Environment

These steps assume you have followed PRX's [Local Development Environment guide](https://github.com/PRX/internal/wiki/Guide:-Local-Development-Environment), which will install a number of dependencies. You can fulfill those dependencies however you'd like, but you may need alter the procedures in this document to match your environment.

### Environment Setup

1. Clone the project repository:

```shell
git clone https://github.com/PRX/dovetail-insights.git
cd dovetail-insights
```

1. Install Ruby and other runtimes:

```shell
asdf install
```

1. Configure a dedicated local hostname in puma-dev:

```shell
echo 4203 > ~/.puma-dev/insights.dovetail.prx
```

You will access the local development server at [http://insights.dovetail.prx.test](http://insights.dovetail.prx.test/) or [https://insights.dovetail.prx.test](https://insights.dovetail.prx.test/).

1. Configure BigQuery credentials

Create a file called `config/bigquery-keyfile.json`, and add JSON client credentials for Google Cloud that have access to the BigQuery database you want to use. If you're not sure which credentials to use or where to get them, please ask around.
1. Configure local environment variables.
Make a copy of the example file.
```shell
cp env-example .env
```
Set `BIGQUERY_PROJECT` to the Google Cloud project name that contains the BigQuery database you want to use. Set `BIGQUERY_CREDENTIALS` to the _path_ of a file that contains BigQuery API credentials from above. (i.e., `./config/bigquery-keyfile.json`)
1. Install Ruby gems.
```shell
bundle install
```
1. Install npm packages.
```shell
yarn install
```
80 changes: 80 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
source "https://rubygems.org"

ruby "3.3.6"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 8.0.0"
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"
# Use sqlite3 as the database for Active Record
gem "sqlite3", ">= 2.1"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[windows jruby]

# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
gem "solid_cache"
gem "solid_queue"
gem "solid_cable"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
gem "kamal", ">= 2.3.0", require: false

# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
gem "thruster", require: false

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# Make requests to BigQuery [https://cloud.google.com/ruby/docs/reference/google-cloud-bigquery/latest/index.html]
gem "google-cloud-bigquery"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[mri windows], require: "debug/prelude"

# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
gem "brakeman", require: false

# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false

# Shim to load environment variables from .env into ENV [https://github.com/bkeepers/dotenv]
gem "dotenv"

# Better HTML for Rails [https://github.com/Shopify/better-html]
gem "better_html"
end

group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"

# Ruby's bikeshed-proof linter and formatter [https://github.com/standardrb/standard]
gem "standard"

# Lint your ERB or HTML files [https://github.com/Shopify/erb_lint]
gem "erb_lint", require: false
end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
end
Loading

0 comments on commit 16da1e6

Please sign in to comment.