Skip to content

Commit

Permalink
Merge branch 'stable' into OSC-17
Browse files Browse the repository at this point in the history
  • Loading branch information
kirykr committed Dec 11, 2023
2 parents f5e3c92 + b52bfb9 commit 9b92ccf
Show file tree
Hide file tree
Showing 691 changed files with 29,340 additions and 11,567 deletions.
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,23 @@ yarn-debug.log*
/node_modules
~$*
TODO.md
NOTES.md
REVISION
GIT_REVISION
sorbet

## AWS
aws/ecs/private/*
NOTES.md
staging.env

# aws private
aws/ecs/private/

# Deployment
k8s-deploy
config/ansible
config/jenkins
# Ignore spreadsheet fiels
/*.csv
/*.xls
/*.xlsx
/*.xlsx
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "none"
}
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.3.7
2 changes: 2 additions & 0 deletions .rufo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trailing_commas false
quote_style :single
15 changes: 9 additions & 6 deletions .solargraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ exclude:
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
reporters:
- require_not_found
require_paths: []
plugins: []
# require: []
# domains: []
# reporters:
# - rubocop:version=0.81.0 # diagnostics
formatter:
rubocop:
version: 0.61.0
# require_paths: []
# plugins: []
max_files: 5000
23 changes: 11 additions & 12 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ require "dotenv"
Dotenv.load

# Load DSL and set up stages
require 'capistrano/setup'
require "capistrano/setup"

# Include default deployment tasks
require 'capistrano/deploy'
require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
# Include tasks from other gems included in your Gemfile
Expand All @@ -21,15 +21,14 @@ install_plugin Capistrano::SCM::Git
#
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
# require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/rvm'
require 'capistrano/passenger'
require 'capistrano/rails'
require "capistrano/bundler"
require "capistrano/rvm"
require "capistrano/passenger"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
require 'capistrano/sidekiq/systemd'

require 'whenever/capistrano'
require 'capistrano/sidekiq'
require 'appsignal/capistrano'
require "whenever/capistrano"
require "appsignal/capistrano"
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM ruby:2.3.3
FROM ruby:2.3.7

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list
RUN apt-get update -q && \
apt-get install -qy procps curl ca-certificates gnupg2 build-essential --no-install-recommends && apt-get clean
RUN curl -fsSL https://deb.nodesource.com/setup_12.x | bash -
RUN curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client fonts-khmeros memcached cron
RUN mkdir /app
Expand Down
13 changes: 10 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'https://rubygems.org'

gem 'bundler', '1.17.3'
gem 'rails', '4.2.5'
gem 'pg', '~> 0.18.4'
gem 'jquery-rails'
Expand All @@ -13,12 +14,12 @@ gem 'bootstrap-sass', '~> 3.3.5'
gem 'devise', '~> 3.5', '>= 3.5.2'
gem 'haml-rails', '~> 0.9'
gem 'dotenv-rails', '~> 2.0.2'
gem 'roo', '~> 2.2'
gem 'roo', '~> 2.8.3'
gem 'fog'
gem 's3'
gem 'ffaker', '~> 2.1.0'
gem 'draper', '~> 2.1'
gem 'datagrid', '~> 1.4.2'
gem 'datagrid', '1.6.3'
gem 'active_model_serializers'
gem 'sinatra', require: false
gem 'rack-cors', require: 'rack/cors'
Expand Down Expand Up @@ -54,6 +55,7 @@ gem 'carrierwave', '~> 1.3.2'
gem 'mini_magick', '~> 4.5'
gem 'chartkick', '~> 3.4'
gem 'font-awesome-rails', '~> 4.7'
gem 'ruby-ole', '~> 1.2', '>= 1.2.12.2'
gem 'spreadsheet', '~> 1.1.3'
gem 'apartment', '~> 1.2'
gem 'dropzonejs-rails', '~> 0.7.3'
Expand Down Expand Up @@ -105,14 +107,15 @@ group :staging, :demo do
end

group :development do
gem 'active_record_query_trace', '1.7'
gem 'letter_opener', '~> 1.4.1'
gem 'letter_opener_web', '~> 1.3', '>= 1.3.4'
gem 'rubocop', '~> 0.81.0', require: false
gem 'capistrano', '3.9.0'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-passenger', '~> 0.1.1'
gem 'capistrano-rvm', '~> 0.1.2'
gem 'capistrano-sidekiq', '~> 1.0', '>= 1.0.3'
gem 'capistrano-sidekiq-systemd', require: false
gem 'capistrano-foreman'
gem 'rack-mini-profiler', '~> 1.0'
gem 'metainspector'
Expand All @@ -132,3 +135,7 @@ end

gem "sentry-raven", "~> 2.13"
gem 'terser', '~> 1.1', '>= 1.1.12'

gem "redis-rails", "~> 5.0"

gem "ahoy_email", "1.0.3"
51 changes: 39 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GEM
activemodel (>= 3.2)
active_record_doctor (1.8.0)
activerecord (>= 4.2.0)
active_record_query_trace (1.7)
active_record_union (1.2.0)
activerecord (>= 4.0)
activejob (4.2.5)
Expand All @@ -50,6 +51,11 @@ GEM
activerecord (>= 4.2, < 7.0)
activesupport (>= 4.2, < 7.0)
addressable (2.4.0)
ahoy_email (1.0.3)
actionmailer (>= 4.2)
addressable (>= 2.3.2)
nokogiri
safely_block (>= 0.1.1)
airbrussh (1.3.2)
sshkit (>= 1.6.1, != 1.7.0)
ancestry (3.0.5)
Expand Down Expand Up @@ -111,9 +117,8 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano-sidekiq (1.0.3)
capistrano-sidekiq-systemd (0.2.0)
capistrano (>= 3.9.0)
sidekiq (>= 3.4, < 6.0)
capybara (2.15.4)
addressable
mini_mime (>= 0.1.3)
Expand Down Expand Up @@ -169,8 +174,8 @@ GEM
octokit (~> 4.7)
terminal-table (~> 1)
database_cleaner (1.8.5)
datagrid (1.4.4)
rails (>= 3.2.22.2)
datagrid (1.6.3)
rails (>= 4.0)
db_text_search (0.2.0)
activerecord (>= 4.1.15, < 6.0)
declarative (0.0.9)
Expand Down Expand Up @@ -207,6 +212,7 @@ GEM
dry-inflector (0.1.2)
enumerize (2.3.1)
activesupport (>= 3.2)
errbase (0.1.1)
erubis (2.7.0)
ethon (0.8.1)
ffi (>= 1.3.0)
Expand Down Expand Up @@ -575,7 +581,6 @@ GEM
no_proxy_fix (0.1.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
racc (~> 1.4)
nokogumbo (2.0.2)
nokogiri (~> 1.8, >= 1.8.4)
octokit (4.19.0)
Expand Down Expand Up @@ -615,7 +620,6 @@ GEM
slop (~> 3.4)
pundit (1.1.0)
activesupport (>= 3.0.0)
racc (1.5.2)
rack (1.6.13)
rack-cors (1.0.6)
rack (>= 1.6.0)
Expand Down Expand Up @@ -675,9 +679,25 @@ GEM
railties (>= 3.2)
tilt
redis (3.3.5)
redis-actionpack (5.1.0)
actionpack (>= 4.0, < 7)
redis-rack (>= 1, < 3)
redis-store (>= 1.1.0, < 2)
redis-activesupport (5.3.0)
activesupport (>= 3, < 8)
redis-store (>= 1.3, < 2)
redis-rack (2.0.6)
rack (>= 1.5, < 3)
redis-store (>= 1.2, < 2)
redis-rails (5.0.2)
redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2)
redis-session-store (0.11.3)
actionpack (>= 3, < 7)
redis (>= 3, < 5)
redis-store (1.6.0)
redis (>= 2.2, < 5)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
Expand All @@ -687,9 +707,9 @@ GEM
railties (>= 4.2.0, < 5.1)
retriable (3.0.2)
rexml (3.2.5)
roo (2.3.2)
roo (2.8.3)
nokogiri (~> 1)
rubyzip (~> 1.1, < 2.0.0)
rubyzip (>= 1.3.0, < 3.0.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
Expand Down Expand Up @@ -731,9 +751,11 @@ GEM
ruby-progressbar (1.11.0)
ruby_parser (3.14.2)
sexp_processor (~> 4.9)
rubyzip (1.2.0)
rubyzip (1.3.0)
s3 (0.3.24)
proxies (~> 0.2.0)
safely_block (0.2.2)
errbase (>= 0.1.1)
sanitize (5.2.1)
crass (~> 1.0.2)
nokogiri (>= 1.8.0)
Expand Down Expand Up @@ -880,7 +902,9 @@ PLATFORMS
DEPENDENCIES
active_model_serializers
active_record_doctor (~> 1.8)
active_record_query_trace (= 1.7)
acts_as_paranoid (~> 0.6.1)
ahoy_email (= 1.0.3)
ancestry (~> 3.0, >= 3.0.5)
apartment (~> 1.2)
appsignal (~> 3.0, >= 3.0.24)
Expand All @@ -891,13 +915,14 @@ DEPENDENCIES
bourbon (~> 4.2)
browser (~> 2.1)
bullet (= 5.4.3)
bundler (= 1.17.3)
cancancan (~> 1.13, >= 1.13.1)
capistrano (= 3.9.0)
capistrano-foreman
capistrano-passenger (~> 0.1.1)
capistrano-rails (~> 1.1.1)
capistrano-rvm (~> 0.1.2)
capistrano-sidekiq (~> 1.0, >= 1.0.3)
capistrano-sidekiq-systemd
capybara (~> 2.15.4)
carrierwave (~> 1.3.2)
caxlsx (~> 2.0, >= 2.0.2)
Expand All @@ -907,7 +932,7 @@ DEPENDENCIES
dalli (~> 2.7, >= 2.7.11)
danger (~> 5.16, >= 5.16.1)
database_cleaner (~> 1.5, >= 1.5.1)
datagrid (~> 1.4.2)
datagrid (= 1.6.3)
devise (~> 3.5, >= 3.5.2)
devise_token_auth (~> 0.1.37)
doorkeeper (~> 4.4, >= 4.4.3)
Expand Down Expand Up @@ -960,12 +985,14 @@ DEPENDENCIES
rails (= 4.2.5)
rails-erd
react-rails (~> 2.6.0)
redis-rails (~> 5.0)
redis-session-store (~> 0.11.3)
roo (~> 2.2)
roo (~> 2.8.3)
rspec-activemodel-mocks (~> 1.1)
rspec-rails (~> 4.0.0)
rspec-sidekiq (~> 3.0, >= 3.0.3)
rubocop (~> 0.81.0)
ruby-ole (~> 1.2, >= 1.2.12.2)
s3
sass-rails (~> 5.0)
select2-rails (~> 3.5.9.3)
Expand Down
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
# OSCaR - Open Source Case-management and Record-keeping

<img src='./app/assets/images/OSCaR_logo.png'>
### Open Source Case-management and Record-keeping.

[![Build Status](https://travis-ci.com/DevZep/oscar-web.svg?branch=master)](https://travis-ci.com/DevZep/oscar-web)
[![Build Status](https://travis-ci.com/DevZep/oscar-web.svg?branch=stable)](https://travis-ci.com/DevZep/oscar-web)
[![Build Status](https://travis-ci.com/DevZep/oscar-web.svg?branch=staging)](https://travis-ci.com/DevZep/oscar-web)

### Requirements

- Docker Desktop (latest stable version for your platform)

### Getting Started

Given that we are using Docker, then most common development tasks you will just need the _core services_ which are essentially the OSCaR App Service (Rails) and the OSCaR Database Service (Postgres). To spin these services up only, use the following `make` command:

```
make start_core
```

This starts a Rails, Postgres and Webpack container. If you need the Mongo container running then execute the following command in a separate terminal:

```
make start_mongo
```

See the project [Makefile](./Makefile) for a list of all the available commands.

Once the containers have fired up open a web browser and navigate to [http://localhost:3000](http://localhost:3000) to open the app. To login, click on the 'dev' organizations logo (there should only be the one logo) and the username (email) is any of the users (listed in the 'users' sheet) of the [lib/devdata/dev_tenant.xlsx](lib/devdata/dev_tenant.xlsx) spreadsheet with the password set to `123456789`.

_NOTE_ If this is the first time you have run this you may need to stop the containers and run it again!

## Debugging using Pry

If you want to debug the Rails application using Pry you need to attach to the container running Rails first. To do that in a new terminal window run:

```
make rails_attach
```

Now when your code runs and gets to the `binding.pry` line it will halt and a Pry REPL session will be available in the terminal window where you are attached.

When you have finished dubugging just type `exit` in the Pry REPL session as you normally would. Keep this terminal attached for convenience if you need to use Pry again.

NOTE: To detach the tty **without also terminating the Rails container**, you need to use the escape sequence **Ctrl+P** followed by **Ctrl+Q**.

## Troubleshooting

#### Issue pending migrations when starting Docker container

If you have pending migrations that **prevent the Docker container from starting** for example:

```
app | You have 2 pending migrations:
app | 20200603071312 ________
app | 20200603081325 ________
app | Run `rake db:migrate` to update your database then try again.
app exited with code 1
```

Then you can fix this by running the following command and then starting services again.

```
make db_migrate
```

| Master Branch | Stable Branch | Staging Branch |
| ------------------------------------------------------------------------------------------------------------------- | :-----------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------: |
Expand Down
Loading

0 comments on commit 9b92ccf

Please sign in to comment.