profile
viewpoint
Laura Mosher lauramosher https://laura.mosher.tech Full-stack software engineer with a passion for clean code and oxford commas.

rubyforgood/casa 26

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.

lauramosher/wicked_pdf_dummy_app 1

Dummy App to test WickedPDF configuration

lauramosher/acme 0

Introducing Phoenix - ElixirConf US 2017 Training Application

lauramosher/casa 0

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.

lauramosher/centsible 0

Simple Budget App in Rails + React

lauramosher/daisy 0

Remote Starter Kit to bootstrap your day

lauramosher/daisy-slack 0

OAuth 2.0 handshake for Slack

lauramosher/devise_invitable 0

An invitation strategy for devise

lauramosher/faker 0

A library for generating fake data such as names, addresses, and phone numbers.

lauramosher/glsec-nametag-creation 0

Small web based utility to help with GLSEC 2013 name tag creation process.

push eventTerrastories/terrastories

Laura Mosher

commit sha 7f0fd6cbb9e17801d95ea38fd4e2edf7b90a0c19

Move the media folder into data This will make it so if we ever want to persist more "data" to survive between docker down and volume removal, we have one centralized place for it.

view details

push time in 2 days

push eventTerrastories/terrastories

Laura Mosher

commit sha 72b88f367d9fe3601301f6838e7c0accc3419f36

Media volume link for Docker web

view details

push time in 2 days

issue openedTerrastories/terrastories

Improve first-touch App + Docker setup

Set up can be a little gnarly with Docker and needing to know the correct commands for building, starting, and updating the Rails environment.

The goal of this ticket is to create scripts and commands that will create a more streamlined clone to contribute workflow for new devs to the project.

  1. setup script
  2. update script (new or updates to gems)
  3. db helpers scripts
  4. start up and usage scripts
  5. running all tests script

created time in 2 days

pull request commentTerrastories/terrastories

add model and dashboard for themes, added controller logic to only al…

Yes! The click through I did works great.

There are a couple of unrelated things that need to get resolved before a merge can happen:

  • It looks like the .env.example accidentally got removed in this change. Can you please add that back in?
  • It also looks like there are conflicts in the Gemfile.lock that need to be resolved before we can merge. A refresh with the main branch should resolve them. I think you can also remove the Gemfile.lock changes from your branch entirely since you didn't add any Gems yourself.

Let me (or one of the Stewards) know if you need help navigating this.

Thank you again for the contribution!

kev-kev

comment created time in 7 days

PR opened Terrastories/terrastories

Update docker and docker-compose config and scripts

Summary of Changes

  • Updates docker-compose.yml to use more recent configuration for dependent builds/images.
  • Removes e2e test script in favor of root test script that runs the command via run.
  • Adds global test script that runs e2e specs and rspec unit tests
  • Renames and updates script/test to script/test.sh for Windows running capability. Windows PowerShell requires a file extension to run.
  • Removes rails/scripts/wait-for-it.sh as part of new docker-compose setup

Notes

File Extension Naming (why is there .sh sometimes, but not all of the time?)

I've made a change to how we name / utilize file extensions in the app:

  1. For any script that is run via docker, the file extension has been removed. *nix does not require file extensions to run bash/shell scripts, and so any script that we'd run in docker and only docker, I've removed the file extension.
  2. For any script that is run via command-line outside of docker (<root>/script/*) have a .sh file extension. This is so when run in Windows Powershell, it will be able to be executed. Windows will error if it doesn't know / recognize the file extension.

This is more for a cognitive separation: if the script doesn't have a .sh extension, there is a good chance you shouldn't be running it.

First time startup

I made a few superficial changes to boot up.

Now, when the server is first started, there is a message before boot up that we are starting the server.

There is a second message that displays after initialization and before it's fully finished booting. This flushes standard out for Docker and shows progress for when the server is actually bootable.

➜  terrastories git:(lm-docker-updates) docker-compose up web
Starting terrastories_db_1 ... done
Starting terrastories_web_1 ... done
Attaching to terrastories_web_1
web_1           | Starting Rails Server...
web_1           | => Booting Puma
web_1           | => Rails 5.2.3 application starting in development
web_1           | => Run `rails server -h` for more startup options
web_1           | Initialized
web_1           | Puma starting in single mode...
web_1           | * Version 3.12.6 (ruby 2.5.1-p57), codename: Llamas in Pajamas
web_1           | * Min threads: 5, max threads: 5
web_1           | * Environment: development
web_1           | * Listening on tcp://0.0.0.0:3000
web_1           | Use Ctrl-C to stop

Commands/Startup

At this point, all of the expected docker commands should continue to function as expected, such as build/up. Please run through setup instructions again and ensure that things still work as expected.

+41 -201

0 comment

12 changed files

pr created time in 8 days

push eventTerrastories/terrastories

Laura Mosher

commit sha da18e37aa29d1544f9ca47870fccf349bfc79247

Update DEVELOPMENT.md with new note on how to run tests

view details

push time in 8 days

create barnchTerrastories/terrastories

branch : lm-docker-updates

created branch time in 8 days

Pull request review commentTerrastories/terrastories

add model and dashboard for themes, added controller logic to only al…

+require 'pry'+module Admin+  class ThemesController < Admin::ApplicationController+    def create+      if theme_params[:active]

So, this check and the one on line 12 will always run the deactivate_prev_theme code even if active was not checked (is set to false) in the form.

This is because the form input is sending back "0" / "1" for false / true if the checkbox was checked or not, and so an object check will always return true because it's a string.

The quickest way to resolve this is to check if theme_params[:active] == "1", which is the equivalent to true.

kev-kev

comment created time in 8 days

Pull request review commentTerrastories/terrastories

add model and dashboard for themes, added controller logic to only al…

-<div class="welcome">
+<div class="welcome" style="background-image: url(<%= @theme ? @theme.background_img : 'welcome-bg.jpg' %>) " > <%#no-repeat center center fixed%>

I noticed that when there is no theme set, the default welcome image is missing / a blank white background.

I believe that's because now that we are referencing the image from the root (rather than relative assets in the stylesheet), we need to specify the assets folder.

<div class="welcome" style="background-image: url(<%= @theme ? @theme.background_img : 'assets/welcome-bg.jpg' %>) " >
kev-kev

comment created time in 8 days

Pull request review commentTerrastories/terrastories

add model and dashboard for themes, added controller logic to only al…

+class CreateThemes < ActiveRecord::Migration[5.2]+  def change+    create_table :themes do |t|+      t.string :background_img+      t.boolean :active

Lets change this to set a database constraint to null: false - this way when we are utilizing the boolean in Rails, it'll always be a true boolean (instead of a 3-way "boolean" - true / false / null [falsey]).

      t.boolean :active, null: false, default: false

Here is more thoughts on the threestate boolean problem: https://thoughtbot.com/blog/avoid-the-threestate-boolean-problem.

kev-kev

comment created time in 8 days

Pull request review commentTerrastories/terrastories

add model and dashboard for themes, added controller logic to only al…

+require 'pry'+module Admin+  class ThemesController < Admin::ApplicationController+    def create+      if theme_params[:active]+        deactivate_prev_theme+      end+      super+    end++    def update+      if theme_params[:active]+        deactivate_prev_theme+      end+      super+    end+    +    def deactivate_prev_theme+      prev = Theme.find_by(active: true)+      prev.update(active: false)

I think if we change these lines to this one:

      Theme.where(active: true).update_all(active: false)

It would stop any errors from trying to run update when no record is active found. (update_all will still run on an empty relation and commit no updates). It would also make it so if we somehow ended up with multiple themes active, it would ensure ALL of them are marked as inactive.

If we would rather leave it the same, we can do a guard check against no-previously active theme on line 20 to avoid errors:

      prev = Theme.find_by(active: true)
      prev.update(active: false) if prev.present?
kev-kev

comment created time in 8 days

issue commentTerrastories/terrastories

Setup RuboCop for Ruby

Thoughts on utilizing StandardRB? It is essentially a wrapper around RuboCop, but defines "standards" for which rules are enforced rather than having to determine which ones we want to and why for each cop.

kalimar

comment created time in 8 days

pull request commentTerrastories/terrastories

Bump json from 2.2.0 to 2.3.1 in /rails

@dependabot squash and merge

dependabot[bot]

comment created time in 8 days

issue commentrubyforgood/casa

[bug] Error when admin adds new volunteer

@Zrrrpy I think, based on the documentation, it sounds like it'll a specific set of 5 authorized email addresses rather than a blanket authorized domain. So the specific gmail email address would need to be on the authorized list, rather than the whole @gmail.com domain.

There might be a way to add and "verify" a casa owned domain as being authorized, which may be a worthwhile route. I'm not sure of the restrictions of doing so on a free vs credit-card / paid account.

Zrrrpy

comment created time in 15 days

issue commentrubyforgood/casa

[bug] Error when admin adds new volunteer

Hi!

So I dug into this a short bit and I was unable to produce this issue locally — the mail sent as expected. I was able to reproduce this issue on the Staging link provided.

Based on the error message provided "Please add your own domain or add the address to authorized recipients in Account Settings" and the documentation here:

This domain is to be used for testing only. It allows both sending and receiving messages; and also tracking can be enabled for it. But it only allows sending to a list of up to 5 authorized recipients.

My guess is that it's erroring due to the email being provided for the Volunteer is not on the Mailgun sandbox "authorized" email list. I would suggest adding an authorized email to your account and seeing if the error persists.

Zrrrpy

comment created time in 16 days

issue commentrubyforgood/casa

[bug] Error when admin adds new volunteer

I'll take this one! :)

Zrrrpy

comment created time in 16 days

push eventTerrastories/terrastories

ohamuy

commit sha 8434ba8f4fc2612ca49fb9de783f575ed1380b6a

Pop-up image update

view details

ohamuy

commit sha 3543a24b7ae613b83404aa1621a29e2f2c190818

Update _balloon.scss

view details

Laura Mosher

commit sha 0455459daca7f9e478756ef3033405b3557f3e7b

Merge pull request #471 from ohamuy/Pop-up-Image Pop-up image update

view details

push time in 18 days

PR merged Terrastories/terrastories

Pop-up image update

This fixes issue #469. These are the pop-ups before: Screen Shot 2020-07-13 at 1 23 15 PM Screen Shot 2020-07-13 at 1 23 02 PM

After Changes: Screen Shot 2020-07-13 at 1 22 25 PM Screen Shot 2020-07-13 at 1 22 19 PM

All images are in their original proportions, the container expands with the picture.

+2 -5

1 comment

1 changed file

ohamuy

pr closed time in 18 days

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha 64112351454ae59c19c36e657cc9409fc9179bdb

Add favicon (and fix typo)

view details

push time in 19 days

Pull request review commentTerrastories/terrastories

Pop-up image update

 .ts-markerPopup {   &-content {-    display: flex;     justify-content: center;

Since we are removing display: flex we should also remove this — this CSS attribute won't do anything without display being set to flex!

ohamuy

comment created time in 20 days

issue commentTerrastories/terrastories

Fix rspec tests

Should those be allowed to be blank or do we only want Places to be created with a latitude and longitude?

I would say allowed to be blank but I am not sure what the original ticket was asking. @Terrastories/terrastories-stewards pinging to see if you have any input on the preference for lat/long requirements.

lauramosher

comment created time in 20 days

fork lauramosher/casa

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.

https://casa-r4g-staging.herokuapp.com/

fork in 23 days

delete branch Terrastories/terrastories

delete branch : update-gems

delete time in a month

push eventTerrastories/terrastories

Laura Mosher

commit sha 508b70b42524243ce7a293c4c355efa7fa31b367

Update gems - administrate 0.12.0 -> 0.13.0 - kaminari 1.1.1 -> 1.2.1 - nokogiri 1.10.5 -> 1.10.9 - puma 3.12.2 -> 3.12.6 - rack 2.0.7 -> 2.2.3 - websocket-extensions 0.1.4 -> 0.1.5 And all subdependencies of these gems

view details

Laura Mosher

commit sha e5ed203666c252c51d6e5ca10a4f049a3adb44e0

Merge pull request #456 from Terrastories/update-gems Update gems

view details

push time in a month

PR merged Terrastories/terrastories

Update gems dependencies rails
  • administrate 0.12.0 -> 0.13.0
  • kaminari 1.1.1 -> 1.2.1
  • nokogiri 1.10.5 -> 1.10.9
  • puma 3.12.2 -> 3.12.6
  • rack 2.0.7 -> 2.2.3
  • websocket-extensions 0.1.4 -> 0.1.5

And all subdependencies of these gems.

Note: This addresses all of the rails/bundler dependabot open pending PRs.

+29 -29

1 comment

1 changed file

lauramosher

pr closed time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha ad7902cc6429a3427639d4544821514664743fc3

add ga

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha 650aada9f95cc6961a2a6432b0134f98f5424230

adjust SEO tags to be property & explicit

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha f8c5e72bed80c541007da672f95c1c5639ada1d8

base website

view details

Laura Mosher

commit sha 4a1a8f537975a9b278217ad3134303724079df76

Set theme jekyll-theme-cayman

view details

Laura Mosher

commit sha 6156c7e958c9fd3e493fca586fd14400d24afbd2

Update project text

view details

Laura Mosher

commit sha cecb3534c2de6c89a466bbee622835edc1e9d3f0

Create CNAME

view details

Laura Mosher

commit sha 704ff9751aea966fa6730102a0950c99da215503

Update SEO meta

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha 1de20f2bc604ba5fa2130456db6b14ada057378e

Set theme jekyll-theme-cayman

view details

Laura Mosher

commit sha 218a6c88dae2ef150783f897a8e3f2b638dc5a5b

Update project text

view details

Laura Mosher

commit sha 8ea8fba84bf89f2792db415e142ab4c698d950fa

Create CNAME

view details

Laura Mosher

commit sha 286c07c2364f34644ec7a1b4c20ca270cbb3e7eb

Update SEO meta

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha d3284e11de3e5d499a10d3c239328bdecbab0180

Update SEO meta

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha b9fb6546a3c7536bcecb65464343f1a4980867d6

Create CNAME

view details

push time in a month

delete branch lauramosherllc/lauramosherllc.github.io

delete branch : main

delete time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha f589df76db5da1fa2d22c4391b581040554ac4c7

Update project text

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha e8da53cba4b9fa32f20ec0fad2120a07230a4f5f

Set theme jekyll-theme-cayman

view details

push time in a month

push eventlauramosherllc/lauramosherllc.github.io

Laura Mosher

commit sha 9881e912cfe09d26e5c0de13d58ad98deeced059

Update project text

view details

push time in a month

create barnchlauramosherllc/lauramosherllc.github.io

branch : main

created branch time in a month

push eventlauramosher/lauramosher.github.io

Laura Mosher

commit sha 8c2de180c04339312a580f2aa793befdd4a13038

Delete CNAME

view details

push time in a month

issue openedTerrastories/terrastories

Fix rspec tests

Right now, if you run docker-compose run web-test rspec, there are a number of failing specs.

Finished in 14.18 seconds (files took 3.24 seconds to load)
84 examples, 21 failures

This issue is to work through those failing specs and make them pass.

created time in a month

issue commentTerrastories/terrastories

SETUP.md readme is missing one additional step for Windows

@rudokemper I have not needed to run this!

rudokemper

comment created time in a month

Pull request review commentTerrastories/terrastories

Allowing online image and video uploads to S3

 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)  require 'bundler/setup' # Set up gems listed in the Gemfile.-require 'bootsnap/setup' # Speed up boot time by caching expensive operations.+# require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

Works for me! One fewer dependencies

mirandawang

comment created time in a month

Pull request review commentTerrastories/terrastories

Allowing online image and video uploads to S3

 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)  require 'bundler/setup' # Set up gems listed in the Gemfile.-require 'bootsnap/setup' # Speed up boot time by caching expensive operations.+# require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

I noticed we commented out the bootsnap gem and the setup here — is that required for the S3 stuff?

mirandawang

comment created time in a month

Pull request review commentTerrastories/terrastories

Allowing online image and video uploads to S3

 yarn-debug.log* /node_modules yarn-debug.log* .yarn-integrity++# Ignore master key for decrypting credentials and more.+/config/master.key

This is also on line 19 of this file, do we need to add it again?

mirandawang

comment created time in a month

pull request commentTerrastories/terrastories

Bump websocket-extensions from 0.1.3 to 0.1.4 in /rails

@dependabot merge

dependabot[bot]

comment created time in a month

issue commentTerrastories/terrastories

[CMS] [i18n] Language picker should show selected language, not default language.

@rudokemper do you want to write a new ticket to translate the last few languages or keep this one open?

rudokemper

comment created time in a month

push eventTerrastories/terrastories

ohamuy

commit sha 64ae0d2bfe1d94409c3e28752fd4579b7ef2aab5

Welcome languages fix issues Change color on hover over languages Change langauge selection. added "(selected)"

view details

ohamuy

commit sha fe3e6986b22ee1cdcb9c67090caa9d8655dc6175

Update Language Picker Alphebatized spansh translations Added "(selected)" for english, spanish, and japanese; other languages still need that translation. Added color change on hover

view details

Laura Mosher

commit sha ade0783459063b2277f5c89bb0422c1594bbc7b7

Merge pull request #453 from ohamuy/Language-Changes Language changes

view details

push time in a month

PR merged Terrastories/terrastories

Language changes

Fixes issue #446

Adds "(selected)" word to the selected language Adds color change on hover over language

+28 -18

1 comment

8 changed files

ohamuy

pr closed time in a month

pull request commentTerrastories/terrastories

Addressing issue #441

Hi @Lukmin1999 - Thanks so much for your PR! It seems like there are some extra commits in this PR that are unrelated to the story images issue in #446

It looks like the other two commits have already been accepted, and I believe this PR commit weirdness can be resolved by updating your branch with Terrastories:master.

Lukmin1999

comment created time in a month

PR opened Terrastories/terrastories

Update gems
  • administrate 0.12.0 -> 0.13.0
  • kaminari 1.1.1 -> 1.2.1
  • nokogiri 1.10.5 -> 1.10.9
  • puma 3.12.2 -> 3.12.6
  • rack 2.0.7 -> 2.2.3
  • websocket-extensions 0.1.4 -> 0.1.5

And all subdependencies of these gems.

Note: This addresses all of the rails/bundler dependabot open pending PRs.

+29 -29

0 comment

1 changed file

pr created time in a month

create barnchTerrastories/terrastories

branch : update-gems

created branch time in a month

pull request commentTerrastories/terrastories

Update to ReadMe Setup, Added Development section, fixed issue #446

We have now done that, the language changes have been separated into another pull request

Thank you! When you have a moment, can you please update the PR title and description to remove references to the separated work? 💅

ohamuy

comment created time in a month

Pull request review commentTerrastories/terrastories

Update to ReadMe Setup, Added Development section, fixed issue #446

+# Setup Windows++## Table of Contents++1. [Setup Docker](#setup-docker)++2. [Setup the application](#Setup-the-application)++3. [Run the application](#Run-the-application)++4. [Using the application](#using-the-application)++5. [Common setup errors](#having-troubles-check-our-common-errors--gotchas)++6. [Development](#development)++7. [Backup and restore the Terrastories database](#backup-and-restore-the-terrastories-database)++## Setup Docker++Docker is a platform that serves to deliver software in packages called containers. Terrastories makes use of this to deliver the +many facets included in the application in one easy package. ++Download Docker:++- https://hub.docker.com/editions/community/docker-ce-desktop-windows/++System prerequisites for Windows 10 Pro: +- 64 bit processor +- 4GB system RAM +- [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Pro:++- https://docs.docker.com/docker-for-windows/install/++System prerequisites for Windows 10 Home: +- Ensure that you are running on version 2004 or higher, you will need to update your system if it is running on an older version+- Enable the WSL 2 feature on Windows, follow the instructions on this link to complete this step, this includes installing a Linux distribution such as Ubuntu+- To complete the previous steps, you must have a 64 bit processor, 4GB system RAM, and [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Home:++- https://docs.docker.com/docker-for-windows/install-windows-home/++There is no need to import any repositories at this point through docker. +To verify that your docker is up and running, click on the app or check the menu bar. Docker should show that it is running: +<br>+<div style="text-align:center">+    <img src="dockerMac.png" alt="dockerImg" width="200"/>+</div>

Did you mean to use dockerMac.png image in the windows setup? I wonder if we should screenshot for windows, or leave out this image entirely on this section for windows.

ohamuy

comment created time in a month

Pull request review commentTerrastories/terrastories

Update to ReadMe Setup, Added Development section, fixed issue #446

+# Setup Windows++## Table of Contents++1. [Setup Docker](#setup-docker)++2. [Setup the application](#Setup-the-application)++3. [Run the application](#Run-the-application)++4. [Using the application](#using-the-application)++5. [Common setup errors](#having-troubles-check-our-common-errors--gotchas)++6. [Development](#development)++7. [Backup and restore the Terrastories database](#backup-and-restore-the-terrastories-database)++## Setup Docker++Docker is a platform that serves to deliver software in packages called containers. Terrastories makes use of this to deliver the +many facets included in the application in one easy package. ++Download Docker:++- https://hub.docker.com/editions/community/docker-ce-desktop-windows/++System prerequisites for Windows 10 Pro: +- 64 bit processor +- 4GB system RAM +- [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Pro:++- https://docs.docker.com/docker-for-windows/install/++System prerequisites for Windows 10 Home: +- Ensure that you are running on version 2004 or higher, you will need to update your system if it is running on an older version+- Enable the WSL 2 feature on Windows, follow the instructions on this link to complete this step, this includes installing a Linux distribution such as Ubuntu+- To complete the previous steps, you must have a 64 bit processor, 4GB system RAM, and [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Home:++- https://docs.docker.com/docker-for-windows/install-windows-home/

This block of information is a little hard to navigate. I think if we add some formatting, it will help future readers determine which instructions to follow:

| | Windows 10 Pro |  Windows 10 Home |
| --- | --- | --- |
| System Requirements | - 64 bit processor<br>- 4GB system RAM<br>- [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/) | Same as Windows 10 Pro, plus: <br>- OS Version 2004 or higher (update your system if version is older)<br>- Enable [WSL 2 feature](https://docs.docker.com/docker-for-windows/wsl/) |
| Setup Instructions | https://docs.docker.com/docker-for-windows/install/ | https://docs.docker.com/docker-for-windows/install-windows-home/ |

Which will look like this:

Windows 10 Pro Windows 10 Home
System Requirements - 64 bit processor<br>- 4GB system RAM<br>- virtualization must be enabled Same as Windows 10 Pro, plus: <br>- OS Version 2004 or higher (update your system if version is older)<br>- Enable WSL 2 feature
Setup Instructions https://docs.docker.com/docker-for-windows/install/ https://docs.docker.com/docker-for-windows/install-windows-home/

It also allows us to add other versions of windows in a sensible manner.

ohamuy

comment created time in a month

Pull request review commentTerrastories/terrastories

Update to ReadMe Setup, Added Development section, fixed issue #446

+# Setup Windows++## Table of Contents++1. [Setup Docker](#setup-docker)++2. [Setup the application](#Setup-the-application)++3. [Run the application](#Run-the-application)++4. [Using the application](#using-the-application)++5. [Common setup errors](#having-troubles-check-our-common-errors--gotchas)++6. [Development](#development)++7. [Backup and restore the Terrastories database](#backup-and-restore-the-terrastories-database)++## Setup Docker++Docker is a platform that serves to deliver software in packages called containers. Terrastories makes use of this to deliver the +many facets included in the application in one easy package. ++Download Docker:++- https://hub.docker.com/editions/community/docker-ce-desktop-windows/++System prerequisites for Windows 10 Pro: +- 64 bit processor +- 4GB system RAM +- [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Pro:++- https://docs.docker.com/docker-for-windows/install/++System prerequisites for Windows 10 Home: +- Ensure that you are running on version 2004 or higher, you will need to update your system if it is running on an older version+- Enable the WSL 2 feature on Windows, follow the instructions on this link to complete this step, this includes installing a Linux distribution such as Ubuntu+- To complete the previous steps, you must have a 64 bit processor, 4GB system RAM, and [virtualization must be enabled](https://mashtips.com/enable-virtualization-windows-10/). ++Setup instructions for Docker on Windows 10 Home:++- https://docs.docker.com/docker-for-windows/install-windows-home/++There is no need to import any repositories at this point through docker. +To verify that your docker is up and running, click on the app or check the menu bar. Docker should show that it is running: +<br>+<div style="text-align:center">+    <img src="dockerMac.png" alt="dockerImg" width="200"/>+</div>++## Setup the application+Create a fork of the Terrastories/terrastories repository. Now clone the repository locally to your computer. ++Using the source-code editor of your choice, open the terrastories repository. There, a file can be found called `.env.example`. +Copy the contents of this file into a newly created file called `.env` (Do not change .env.example!).++Now navigate to a site called [Mapbox](https://mapbox.com/signup) create an account, and copy the mapbox access token (either your default public token or a new one you create) found under your acccount. ++Navigate back to the `.env` file you created and replace where it says [your pk token here] with your mapbox access token. ++Open Powershell and navigate to the terrastories repository and run:++```+docker-compose build+```++This will download and build all the docker images used in this project. Upon completion you should see output similar to:++```+...+Successfully tagged terrastories:latest+```++## Run the application++Within Powershell, run:++```+docker-compose up+```++If this fails, make sure all firewalls are turned off and you have a secure connection to the internet. If it continues to fail, check +the [common setup errors](#having-troubles-check-our-common-errors--gotchas) section. ++This command should terminate with an output similar to:++```+terrastories_e2e_1 exited with code 0+```++Open another Powershell window and run the following command to setup:++```+docker-compose exec web bin/setup+```++This command runs a setup script that lives in bin/setup, which does:++- install ruby gems+- install javascript packages+- setup database+See the script file for the details.++Enter `localhost:3000` into your internet browser to view the application/++## Using the application ++Everytime you want to open and use the application, make sure you have docker desktop running and run the following command into+Powershell:++```+docker-compose up+```++You can view the running application at `localhost:3000`++It will take a moment to load when first opening the application +++## Having troubles? Check our common errors & gotchas++If you run into any problems getting the application to start, please check out a list of common errors & gotchas that we have put together [here](https://docs.google.com/document/d/1uSbQl56rAh3AA8Xm7IRZ8qepAMVN55ZOkAqQ8Kh423E/edit)!++Additionally, feel free to join us in Slack [here](https://t.co/kUtI3lnpW1) and find us in the channel #terrastories :) You can also post an issue and label it with `question`. We will get back to you ASAP!++## Development++Most developer contributions will be focused on the rails app. Because this project uses+docker, we already have a uniform ruby/rails development environment in our rails docker+image. Any time you need to run a rails command you should do so from a running docker+container to take advantage of this consistent environment. Use the following command to+open a bash console on the rails container:++```+docker-compose exec web /bin/bash+```++Now you can treat this console like any other development environment, running rails or+bundler commands as needed. **Please refrain from running such commands in your local+environment. Always use the rails container instead.**++Any changes to source files should be made directly in your local filesystem under the+`/opt/terrastories` directory using your preferred editing tools.++## Backup and restore the Terrastories database++Terrastories stores Places, Speakers, and Stories in a database (Postgres DB). it is possible to back these data up and restore them by running lines of code in a bash terminal. ++Using Powershell:++Backup the DB in PS with:++```+docker run --rm -v "terrastories_postgres_data:/pgdata" -v "$(pwd):/host" busybox tar -cvzf /host/db-backup-test.tgz -C /pgdata .+```++Restore a backup in PS with:++```+docker run --rm -i -v "terrastories_postgres_data:/pgdata" -v "$(pwd):/source/" busybox tar -xvzf /source/db-backup.tgz -C /pgdata+```++Note: the above code is assuming your build is called `terrastories`. It may be necessary to run `docker volume ls` to get the right Docker container name ending with `_postgres_data`.

This section seems to be repeated across all of the individual environment setup, I wonder if we could reorganize these sections into the DEVELOPMENT.md file and only leave the split instructions for first-time setup.

ohamuy

comment created time in a month

create barnchTerrastories/terrastories

branch : test-windows

created branch time in 2 months

more