From cc3269f30c8142bfd5a9b3f2f20d21f5beae4fb5 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Thu, 22 Apr 2021 03:17:50 -0400 Subject: [PATCH 01/18] Create ReleaseNotes.md --- ReleaseNotes.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 ReleaseNotes.md diff --git a/ReleaseNotes.md b/ReleaseNotes.md new file mode 100644 index 0000000..38bf0d7 --- /dev/null +++ b/ReleaseNotes.md @@ -0,0 +1 @@ +# Release Notes From 3fc0fbc603eaebc37fad57f9ab745953063a758d Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Thu, 22 Apr 2021 03:21:30 -0400 Subject: [PATCH 02/18] Create InstallGuide.md --- InstallGuide.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 InstallGuide.md diff --git a/InstallGuide.md b/InstallGuide.md new file mode 100644 index 0000000..43f1450 --- /dev/null +++ b/InstallGuide.md @@ -0,0 +1,19 @@ +# Pre-requisites +are that the customer must have before they can begin the installation process? + +# Dependent libraries that must be installed: +what third party software must be installed for your software to function? + +# Download instructions: +how will the customer and users get access to the project? + +# Build instructions (if needed) +if you are providing the raw source code rather than a binary build, how will the customer and users create the required executable application? + +# Installation of actual application: +what steps have to be taken after the software is built? What directories are required for installation? + +# Run instructions: +what does the user/customer have to do to get the software to execute? + +# Troubleshooting: From a6ea08f0dc3269ef6d51aeba905f5dd8547fa0aa Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Thu, 22 Apr 2021 03:25:17 -0400 Subject: [PATCH 03/18] Update InstallGuide.md --- InstallGuide.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/InstallGuide.md b/InstallGuide.md index 43f1450..960050a 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -1,19 +1,33 @@ -# Pre-requisites +# Local Installation (for testing/development) + +See README.md + +# Production Instance + +Production app goes on Google Cloud. + +## Pre-requisites +1. A Google Cloud account are that the customer must have before they can begin the installation process? -# Dependent libraries that must be installed: +## Dependent libraries that must be installed: +1. Docker Desktop +2. Git +3. Google Cloud CLI (Command Line Interface) what third party software must be installed for your software to function? -# Download instructions: +## Download instructions: +1. Clone the repository (it's open source) how will the customer and users get access to the project? -# Build instructions (if needed) +## Build instructions (if needed) +1. Docker bulid if you are providing the raw source code rather than a binary build, how will the customer and users create the required executable application? -# Installation of actual application: +## Installation of actual application: what steps have to be taken after the software is built? What directories are required for installation? -# Run instructions: +## Run instructions: what does the user/customer have to do to get the software to execute? -# Troubleshooting: +## Troubleshooting: From 246850e22fca132f27f9228d965dfdb9e5f40f4a Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:52:12 -0400 Subject: [PATCH 04/18] Listing most features, some fixes, still need bugs --- ReleaseNotes.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 38bf0d7..94ad43f 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1 +1,49 @@ # Release Notes + +## Teminology +- **Donee**: someone receiving clothing/items _from_ Carrie's Closet +- **Request**: form which a donee uses ask Carrie's Closet for clothing/items +- **Donor**: somone giving clothing/items _to_ Carrie's Closet +- **Donation:** form which donors use to give items to Carrie's Closet + +## New & Improved + +- Anyone on the internet can make item requests. ๐Ÿ’ They can specify + - How urgent their need is + - When they are available + - What items they need + - Where they are located + +- Anyone on the internet can also donate to Carrie's Closet ๐ŸŽ… They can specify + - What items they'd like to donate + - Where they are located + - When they are available + - Directly increase/increase quantities when inventory lists inebitably get out of wack + +- Administrators & volunteers can manage item inventory ๐Ÿ‘š + - Can specify categories (like boy's shoes, girl's tops, etc.) + - Automatically decrease inventory when a request is fulfilled + - Automatically increase inventory when a donation is received + +- Admnistrators can manage other user's accounts ๐Ÿงพ + - Grant them 1 or more roles within Carrie's Closet: donee, donor, volunteer, administrator + - Invite new users by sending unique sign up links to email addresses + +- You get emails now! Notifications ๐Ÿ“ง + - To admins & volunteers when an urgent request comes in + - To anyone who completes a form, confirming it's completed + - To new users, inviting them to join + +- The app doesn't look ugly anymore! ๐Ÿฆ‹ +- Paypal! Carrie's Closet can accept money from nice people online + +## Known Bugs +- Team? + +## Fixes ๐Ÿ› ๏ธ +- Radio buttons are no longer strangly stacked (side by side now) +- The invite user page doesn't lead to a black hole anymore... why'd we do that... haha, oops +- Donors are no longer allowed to donate negative (huh?) item quantities +- The inventory list doesn't extend past the width of your screen + + From 824bab3481a1d4cee046871d908d8f1d80c08c9f Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 11:22:38 -0400 Subject: [PATCH 05/18] Add Technical Overview and polish boilerplate --- InstallGuide.md | 77 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/InstallGuide.md b/InstallGuide.md index 960050a..a025761 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -1,33 +1,60 @@ +# Technical Overview + +This webapp for Carrie's Closet of Georgia runs using [Ruby on Rails](https://rubyonrails.org/), a full-stack framework for [CRUD web apps](https://www.codecademy.com/articles/what-is-crud). The best resource for learning about and debugging common Rails problems is the [official Rails guide](https://guides.rubyonrails.org/), which were used extensively during development. Rails beleives in "convention over configuration," so many features needed came out of the box. Many also come from packages, which Rails calls Gems. Notable Gems used by this webapp include: `devise`, `devise-invitable`, `webpakcer`, and `puma`. Gems can suffer from the [bloated dependency problem](https://res.cloudinary.com/practicaldev/image/fetch/s--hHU5ov3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://preview.redd.it/eu7hrdzzy3x11.jpg%3Fwidth%3D640%26crop%3Dsmart%26auto%3Dwebp%26s%3D18ed21e9420e1b0fb327c3d356f0c47eb28f9aa2), so tread carefully when adding new ones. + +The app is deployed on Google Cloud using their managed [Kubernetes](https://kubernetes.io/) platform, [Google Cloud Run](https://cloud.google.com/run). The binaries are packaged into a [Docker](https://docs.docker.com/get-started/overview/) container, which Google scales automagically based on request intensity. Current configuration allows Google to shut down all container instances when not in use, which means Carrie's Closet gets around 1.2 million free monthly requests (although first requests in more than an hour can be slow). Postgres is used for the database, which is also hosted with Google Cloud, and is currently the only hosting cost. For details on how to deploy to these services, continue reading. + # Local Installation (for testing/development) -See README.md +See [README.md](README.md) # Production Instance Production app goes on Google Cloud. -## Pre-requisites +### Pre-requisites 1. A Google Cloud account -are that the customer must have before they can begin the installation process? - -## Dependent libraries that must be installed: -1. Docker Desktop -2. Git -3. Google Cloud CLI (Command Line Interface) -what third party software must be installed for your software to function? - -## Download instructions: -1. Clone the repository (it's open source) -how will the customer and users get access to the project? - -## Build instructions (if needed) -1. Docker bulid -if you are providing the raw source code rather than a binary build, how will the customer and users create the required executable application? - -## Installation of actual application: -what steps have to be taken after the software is built? What directories are required for installation? - -## Run instructions: -what does the user/customer have to do to get the software to execute? - -## Troubleshooting: +2. A project on Google Cloud with billing enabled, as well as the Cloud Run API, Cloud SQL API, and Google Contiainer Registry enabled + +### Dependent libraries that must be installed: +1. [Docker Desktop](https://www.docker.com/products/docker-desktop) +2. [Git](https://git-scm.com/downloads) +3. [Google Cloud CLI](https://cloud.google.com/sdk) (Command Line Interface) + +### Download instructions: +Clone the repository (it's open source) by runing in your shell: + +```$ git clone https://github.com/tumbleshack/CarriesCloset.git``` + +### Build instructions (if needed) +Prepare your environment by setting your Google Cloud project id +``` +export PROJECT_ID=your-project-id +``` +Create a name for your cloud run service, we suggest +``` +export _SERVICE_ID=carries-closet-webapp +``` +Build the container by running +``` +$ docker build . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID +``` + +### Installation of actual application: +Login to the Google Cloud CLI with +``` +gcloud login +``` +Send the container to your Google Container Registry +``` +docker push gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID +``` + +### Run instructions: +Then deploy the container to Google Cloud Run +``` +gcloud run deploy $_SERVICE_ID --image=gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID --platform=managed --region=us-east1 +``` +The CLI will then give the public URL on which the web app is running in your shell. + +### Troubleshooting: From 09a10a65af939eaad1f015121c34cab64fea3033 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:19:19 -0400 Subject: [PATCH 06/18] Detail to Cloud Run & Cloud PostgreSQL --- InstallGuide.md | 75 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/InstallGuide.md b/InstallGuide.md index a025761..8b7315e 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -10,51 +10,92 @@ See [README.md](README.md) # Production Instance -Production app goes on Google Cloud. +Production app goes on Google Cloud. The source code will be built into a Docker container locally, then pushed to a container registry, then deployed. ### Pre-requisites 1. A Google Cloud account -2. A project on Google Cloud with billing enabled, as well as the Cloud Run API, Cloud SQL API, and Google Contiainer Registry enabled +2. A project on Google Cloud with billing enabled, as well as the Cloud Run API, [Cloud SQL API](https://console.cloud.google.com/flows/enableapi?apiid=sqladmin&redirect=https://console.cloud.google.com&_ga=2.123185100.670298711.1619196945-1893429947.1619196945), and Google Contiainer Registry enabled -### Dependent libraries that must be installed: +Go to the Google Cloud Console and find the SQL service. Create a PostgreSQL instance. The minium resources should be sufficient: +- Shared CPU without High Availablility +- 1/2 GB Memory +- 10 GB HDD Storage +- Keep a up to 7 backups + +Create a new user for the PostgreSQL instance in the Users menu of the instance page. Select "ADD USER ACCOUNT" then select the "PostgreSQL" radio button. Make a user name and password, note these somewhere. + +Now, grant your Default compute service account Cloud SQL Admin permissions to allow the webapp access to the databse. Go to Google Cloud's IAM service. + +Locate the service account `{somenumber}-compute@developer.gserviceaccount.com`. If this account does not exist, proceede to the next step, and return here after completing the "Run Instructions" section. + +Click on the edit member icon for `{somenumber}-compute@developer.gserviceaccount.com`. Select "ADD ANOTHER ROLE". Locate Cloud SQL Admin (make sure the Cloud SQL Admin API is enabled). Save. + +### Dependent Libraries that must be Installed on your Machine: 1. [Docker Desktop](https://www.docker.com/products/docker-desktop) 2. [Git](https://git-scm.com/downloads) 3. [Google Cloud CLI](https://cloud.google.com/sdk) (Command Line Interface) -### Download instructions: +### Download Instructions: Clone the repository (it's open source) by runing in your shell: ```$ git clone https://github.com/tumbleshack/CarriesCloset.git``` -### Build instructions (if needed) -Prepare your environment by setting your Google Cloud project id +### Build Instructions +Prepare your environment by setting your Google Cloud project id: +``` +$ export PROJECT_ID=your-project-id ``` -export PROJECT_ID=your-project-id +Create a name for your cloud run service, we suggest: ``` -Create a name for your cloud run service, we suggest +$ export _SERVICE_ID=carries-closet-webapp ``` -export _SERVICE_ID=carries-closet-webapp +Generate the file `config/master.key` by running in your shell: ``` -Build the container by running +$ EDITOR=vim rails credentials:edit +``` +Exit vim by typing `:wq`. + +Next, build the container by running: ``` $ docker build . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ``` -### Installation of actual application: -Login to the Google Cloud CLI with +### Installation of Application: +Login to the Google Cloud CLI with: ``` -gcloud login +gcloud auth login ``` -Send the container to your Google Container Registry +Send the container to your Google Container Registry: ``` docker push gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ``` -### Run instructions: -Then deploy the container to Google Cloud Run +### Run Instructions: +Now deploy the container to Google Cloud Run. ``` gcloud run deploy $_SERVICE_ID --image=gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID --platform=managed --region=us-east1 ``` -The CLI will then give the public URL on which the web app is running in your shell. +The CLI will then give the public URL on which the web app is running in your shell. Go to the Google Cloud Console, locate the Cloud Run service, and select "EDIT & DEPLOY NEW REVISION." Go the "VARIABLES" tab. Add the following environment variables: +- `RAILS_ENV`: `production` +- `RAILS_MASTER_KEY`: the key found in `config/master.key` +- `DATABASE_USERNAME`: username you set for the PostgreSQL instance +- `DATABASE_PASSWORD`: password you set for the PostgreSQL username +- `RAILS_LOG_TO_STDOUT`: `true` +- `INSTANCE_CONNECTION_NAME`: {project-id}:{postgres-region}:{postgres-instance-id}, for example `carries-closet:us-central1:closet-db-1` +Then click the "DEPLOY" button. ### Troubleshooting: + +The Cloud Run logs are the most helpful resource for debugging problems. You can locate them in the "LOGS" tab of the Cloud Run service's page. If the service fails to deploy, Cloud Run will present a link to the relevent logs in the Google Cloud Console. Tips for some common problems: + +**Cloud Run fails to connect to the Database** + +Ensure the environment variables `DATABASE_USERNAME`, `DATABASE_PASSWORD`, `INSTANCE_CONNECTION_NAME` are set correctly. Read about the instance connection name and general database connection [here](https://cloud.google.com/sql/docs/mysql/connect-run) + +**A `gcloud` command fails** + +Read about gcloud authorization [here](https://cloud.google.com/sdk/gcloud/reference/auth/login). + +**Rails encounters a secret key error** + +Ensure the environment variable `RAILS_MASTER_KEY` matches the master key in the file. Every time a new master key is generated, this variable must be updated. From fc6a5fa72712e52fef80e99de9d6bbc3935127bf Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:26:25 -0400 Subject: [PATCH 07/18] Update ReleaseNotes.md --- ReleaseNotes.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 94ad43f..b92d7c1 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,12 +1,12 @@ # Release Notes -## Teminology +## Teminology ๐Ÿ“˜ - **Donee**: someone receiving clothing/items _from_ Carrie's Closet - **Request**: form which a donee uses ask Carrie's Closet for clothing/items - **Donor**: somone giving clothing/items _to_ Carrie's Closet - **Donation:** form which donors use to give items to Carrie's Closet -## New & Improved +## New & Improved โญ - Anyone on the internet can make item requests. ๐Ÿ’ They can specify - How urgent their need is @@ -38,7 +38,10 @@ - Paypal! Carrie's Closet can accept money from nice people online ## Known Bugs -- Team? +- When a user selects "yes" to inputing their address, forms to not validate one is actually entered +- Admins can create duplicate item categories +- When creating an account, if the "Password" and "Confirm Password" fields do not match, no error is surfaced (but account creation is still blocked) +- The radio buttons may still be stacked on mobile views ## Fixes ๐Ÿ› ๏ธ - Radio buttons are no longer strangly stacked (side by side now) @@ -46,4 +49,3 @@ - Donors are no longer allowed to donate negative (huh?) item quantities - The inventory list doesn't extend past the width of your screen - From 9d1e5a67ae0664606b583331b3e92355d9db73e9 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:28:39 -0400 Subject: [PATCH 08/18] Bug --- ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index b92d7c1..e579b9a 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -37,7 +37,7 @@ - The app doesn't look ugly anymore! ๐Ÿฆ‹ - Paypal! Carrie's Closet can accept money from nice people online -## Known Bugs +## Known Bugs ๐Ÿž - When a user selects "yes" to inputing their address, forms to not validate one is actually entered - Admins can create duplicate item categories - When creating an account, if the "Password" and "Confirm Password" fields do not match, no error is surfaced (but account creation is still blocked) From 9a907ce29f793a4bc0e794b2cf92c9afc416320e Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 14:39:53 -0400 Subject: [PATCH 09/18] allow unauthenticated --- InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstallGuide.md b/InstallGuide.md index 8b7315e..14ffd82 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -73,7 +73,7 @@ docker push gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ### Run Instructions: Now deploy the container to Google Cloud Run. ``` -gcloud run deploy $_SERVICE_ID --image=gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID --platform=managed --region=us-east1 +gcloud run deploy $_SERVICE_ID --image=gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID --platform=managed --region=us-east1 --allow-unauthenticated ``` The CLI will then give the public URL on which the web app is running in your shell. Go to the Google Cloud Console, locate the Cloud Run service, and select "EDIT & DEPLOY NEW REVISION." Go the "VARIABLES" tab. Add the following environment variables: - `RAILS_ENV`: `production` From 0d759f308b0e70caaf7f817c37b92244068be289 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 14:41:34 -0400 Subject: [PATCH 10/18] Updated port --- InstallGuide.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InstallGuide.md b/InstallGuide.md index 14ffd82..8948593 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -82,6 +82,9 @@ The CLI will then give the public URL on which the web app is running in your sh - `DATABASE_PASSWORD`: password you set for the PostgreSQL username - `RAILS_LOG_TO_STDOUT`: `true` - `INSTANCE_CONNECTION_NAME`: {project-id}:{postgres-region}:{postgres-instance-id}, for example `carries-closet:us-central1:closet-db-1` + +Go to the CONTAINER tab, and set Port to `3000` + Then click the "DEPLOY" button. ### Troubleshooting: From 17e006edf02c3f3fc78cae57dcbf6db831a02014 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 15:34:44 -0400 Subject: [PATCH 11/18] Update InstallGuide.md --- InstallGuide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/InstallGuide.md b/InstallGuide.md index 8948593..769c9b0 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -85,6 +85,8 @@ The CLI will then give the public URL on which the web app is running in your sh Go to the CONTAINER tab, and set Port to `3000` +Go to the CONNECTIONS tab. Under the "Cloud SQL connections" heading, select your PostgreSQL instance in the dropdown. + Then click the "DEPLOY" button. ### Troubleshooting: From d1f85803625da8ea5f6c1c54cda8c19b3ed72470 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 16:07:42 -0400 Subject: [PATCH 12/18] Added database seed instructions --- InstallGuide.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/InstallGuide.md b/InstallGuide.md index 769c9b0..066e574 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -30,6 +30,30 @@ Locate the service account `{somenumber}-compute@developer.gserviceaccount.com`. Click on the edit member icon for `{somenumber}-compute@developer.gserviceaccount.com`. Select "ADD ANOTHER ROLE". Locate Cloud SQL Admin (make sure the Cloud SQL Admin API is enabled). Save. +### Seed the Database + +If the deployment is fresh (ie. database has never been setup before), the database will need to be seeded. The seeds are set in the file [db/seeds.rb](db/seeds.rb). **Make sure to change the administrator seed** before proceeding. + +To seed the database, run the docker container on your local machine, connect it to the Google Cloud PostgreSQL instance, then execute the seed command inside the container. + +First, authorize your local network to connect with Cloud SQL. Go to the Google Cloud Console page for the PostgreSQL instance, and view the "Connections" tab. Add your public IP address to the list of "Authorized networks." + +Next, copy the IP address of your PostgreSQL instance, found on the "Overview" tab. Make sure it's a public IP address. Open the file [config/database.yml](config/database.yml) and temporarily change the `host` field under `production` to the PostgreSQL IP address just copied. + +Now, set all the environment variables specified in the _**Run Instructions:**_ section of this document by temporarily adding them to the Dockerfile. Build the container as specified in _Build Instructions_ and run it with: +``` +docker run --name cc_server_seed -d gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID +``` +Once running, execute the seed command inside the container with: +``` +docker exec cc_server_seed bin/rails db:seed +``` +Once the seed finishes, it's safe to stop the container with: +``` +docker stop cc_server_seed +``` +Restore the Dockerfile and [config/database.yml](config/database.yml) file back to their original states, and proceed with installation. + ### Dependent Libraries that must be Installed on your Machine: 1. [Docker Desktop](https://www.docker.com/products/docker-desktop) 2. [Git](https://git-scm.com/downloads) From 5b5eac279d40835a286827e103972c6c7edfcf75 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 16:09:43 -0400 Subject: [PATCH 13/18] Changed Dockerfile to Dockerfile.prod --- InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstallGuide.md b/InstallGuide.md index 066e574..b0da36f 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -81,7 +81,7 @@ Exit vim by typing `:wq`. Next, build the container by running: ``` -$ docker build . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID +$ docker build f Dockerfile.prod . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ``` ### Installation of Application: From a19004222f1e4c8fca6c160d69536deff1765e27 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 16:10:35 -0400 Subject: [PATCH 14/18] Update InstallGuide.md --- InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstallGuide.md b/InstallGuide.md index b0da36f..4725ab6 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -46,7 +46,7 @@ docker run --name cc_server_seed -d gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ``` Once running, execute the seed command inside the container with: ``` -docker exec cc_server_seed bin/rails db:seed +docker exec cc_server_seed bin/rails db:create db:migrate db:seed ``` Once the seed finishes, it's safe to stop the container with: ``` From f5adaf316ab62582358c8495e4bfe08d90a16cde Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 16:12:04 -0400 Subject: [PATCH 15/18] Update InstallGuide.md --- InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstallGuide.md b/InstallGuide.md index 4725ab6..c4e7cfc 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -1,6 +1,6 @@ # Technical Overview -This webapp for Carrie's Closet of Georgia runs using [Ruby on Rails](https://rubyonrails.org/), a full-stack framework for [CRUD web apps](https://www.codecademy.com/articles/what-is-crud). The best resource for learning about and debugging common Rails problems is the [official Rails guide](https://guides.rubyonrails.org/), which were used extensively during development. Rails beleives in "convention over configuration," so many features needed came out of the box. Many also come from packages, which Rails calls Gems. Notable Gems used by this webapp include: `devise`, `devise-invitable`, `webpakcer`, and `puma`. Gems can suffer from the [bloated dependency problem](https://res.cloudinary.com/practicaldev/image/fetch/s--hHU5ov3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://preview.redd.it/eu7hrdzzy3x11.jpg%3Fwidth%3D640%26crop%3Dsmart%26auto%3Dwebp%26s%3D18ed21e9420e1b0fb327c3d356f0c47eb28f9aa2), so tread carefully when adding new ones. +This webapp for Carrie's Closet of Georgia runs using [Ruby on Rails](https://rubyonrails.org/), a full-stack framework for [CRUD web apps](https://www.codecademy.com/articles/what-is-crud). The best resource for learning about and debugging common Rails problems is the [official Rails guide](https://guides.rubyonrails.org/), which was used extensively during development. Rails beleives in "convention over configuration," so many features needed came out of the box. Many also come from packages, which Rails calls Gems. Notable Gems used by this webapp include: `devise`, `devise-invitable`, `webpakcer`, and `puma`. Gems can suffer from the [bloated dependency problem](https://res.cloudinary.com/practicaldev/image/fetch/s--hHU5ov3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://preview.redd.it/eu7hrdzzy3x11.jpg%3Fwidth%3D640%26crop%3Dsmart%26auto%3Dwebp%26s%3D18ed21e9420e1b0fb327c3d356f0c47eb28f9aa2), so tread carefully when adding new ones. The app is deployed on Google Cloud using their managed [Kubernetes](https://kubernetes.io/) platform, [Google Cloud Run](https://cloud.google.com/run). The binaries are packaged into a [Docker](https://docs.docker.com/get-started/overview/) container, which Google scales automagically based on request intensity. Current configuration allows Google to shut down all container instances when not in use, which means Carrie's Closet gets around 1.2 million free monthly requests (although first requests in more than an hour can be slow). Postgres is used for the database, which is also hosted with Google Cloud, and is currently the only hosting cost. For details on how to deploy to these services, continue reading. From fb145cd83777cc310344003dea710500bba25931 Mon Sep 17 00:00:00 2001 From: juliagrigni <77636451+juliagrigni@users.noreply.github.com> Date: Fri, 23 Apr 2021 21:20:17 -0400 Subject: [PATCH 16/18] Update InstallGuide.md spelling and grammar --- InstallGuide.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/InstallGuide.md b/InstallGuide.md index c4e7cfc..2f447e8 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -1,6 +1,6 @@ # Technical Overview -This webapp for Carrie's Closet of Georgia runs using [Ruby on Rails](https://rubyonrails.org/), a full-stack framework for [CRUD web apps](https://www.codecademy.com/articles/what-is-crud). The best resource for learning about and debugging common Rails problems is the [official Rails guide](https://guides.rubyonrails.org/), which was used extensively during development. Rails beleives in "convention over configuration," so many features needed came out of the box. Many also come from packages, which Rails calls Gems. Notable Gems used by this webapp include: `devise`, `devise-invitable`, `webpakcer`, and `puma`. Gems can suffer from the [bloated dependency problem](https://res.cloudinary.com/practicaldev/image/fetch/s--hHU5ov3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://preview.redd.it/eu7hrdzzy3x11.jpg%3Fwidth%3D640%26crop%3Dsmart%26auto%3Dwebp%26s%3D18ed21e9420e1b0fb327c3d356f0c47eb28f9aa2), so tread carefully when adding new ones. +This webapp for Carrie's Closet of Georgia runs using [Ruby on Rails](https://rubyonrails.org/), a full-stack framework for [CRUD web apps](https://www.codecademy.com/articles/what-is-crud). The best resource for learning about and debugging common Rails problems is the [official Rails guide](https://guides.rubyonrails.org/), which was used extensively during development. Rails believes in "convention over configuration," so many features needed came out of the box. Many also come from packages, which Rails calls Gems. Notable Gems used by this webapp include: `devise`, `devise-invitable`, `webpacker`, and `puma`. Gems can suffer from the [bloated dependency problem](https://res.cloudinary.com/practicaldev/image/fetch/s--hHU5ov3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://preview.redd.it/eu7hrdzzy3x11.jpg%3Fwidth%3D640%26crop%3Dsmart%26auto%3Dwebp%26s%3D18ed21e9420e1b0fb327c3d356f0c47eb28f9aa2), so tread carefully when adding new ones. The app is deployed on Google Cloud using their managed [Kubernetes](https://kubernetes.io/) platform, [Google Cloud Run](https://cloud.google.com/run). The binaries are packaged into a [Docker](https://docs.docker.com/get-started/overview/) container, which Google scales automagically based on request intensity. Current configuration allows Google to shut down all container instances when not in use, which means Carrie's Closet gets around 1.2 million free monthly requests (although first requests in more than an hour can be slow). Postgres is used for the database, which is also hosted with Google Cloud, and is currently the only hosting cost. For details on how to deploy to these services, continue reading. @@ -10,7 +10,7 @@ See [README.md](README.md) # Production Instance -Production app goes on Google Cloud. The source code will be built into a Docker container locally, then pushed to a container registry, then deployed. +The production app goes on Google Cloud. The source code will be built into a Docker container locally, then pushed to a container registry, then deployed. ### Pre-requisites 1. A Google Cloud account @@ -20,19 +20,19 @@ Go to the Google Cloud Console and find the SQL service. Create a PostgreSQL ins - Shared CPU without High Availablility - 1/2 GB Memory - 10 GB HDD Storage -- Keep a up to 7 backups +- Keep up to 7 backups Create a new user for the PostgreSQL instance in the Users menu of the instance page. Select "ADD USER ACCOUNT" then select the "PostgreSQL" radio button. Make a user name and password, note these somewhere. Now, grant your Default compute service account Cloud SQL Admin permissions to allow the webapp access to the databse. Go to Google Cloud's IAM service. -Locate the service account `{somenumber}-compute@developer.gserviceaccount.com`. If this account does not exist, proceede to the next step, and return here after completing the "Run Instructions" section. +Locate the service account `{somenumber}-compute@developer.gserviceaccount.com`. If this account does not exist, proceed to the next step, and return here after completing the "Run Instructions" section. Click on the edit member icon for `{somenumber}-compute@developer.gserviceaccount.com`. Select "ADD ANOTHER ROLE". Locate Cloud SQL Admin (make sure the Cloud SQL Admin API is enabled). Save. ### Seed the Database -If the deployment is fresh (ie. database has never been setup before), the database will need to be seeded. The seeds are set in the file [db/seeds.rb](db/seeds.rb). **Make sure to change the administrator seed** before proceeding. +If the deployment is fresh (ie. the database has never been setup before), the database will need to be seeded. The seeds are set in the file [db/seeds.rb](db/seeds.rb). **Make sure to change the administrator seed** before proceeding. To seed the database, run the docker container on your local machine, connect it to the Google Cloud PostgreSQL instance, then execute the seed command inside the container. @@ -115,7 +115,7 @@ Then click the "DEPLOY" button. ### Troubleshooting: -The Cloud Run logs are the most helpful resource for debugging problems. You can locate them in the "LOGS" tab of the Cloud Run service's page. If the service fails to deploy, Cloud Run will present a link to the relevent logs in the Google Cloud Console. Tips for some common problems: +The Cloud Run logs are the most helpful resource for debugging problems. You can locate them in the "LOGS" tab of the Cloud Run service's page. If the service fails to deploy, Cloud Run will present a link to the relevant logs in the Google Cloud Console. Tips for some common problems: **Cloud Run fails to connect to the Database** From d300fed1e1963b1fea12495ba4c3e24e4982de7e Mon Sep 17 00:00:00 2001 From: juliagrigni <77636451+juliagrigni@users.noreply.github.com> Date: Fri, 23 Apr 2021 21:49:08 -0400 Subject: [PATCH 17/18] release notes minor corrections and tone --- ReleaseNotes.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index e579b9a..6c6e7a0 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,4 +1,4 @@ -# Release Notes +# Release Notes: Version 1.0 ## Teminology ๐Ÿ“˜ - **Donee**: someone receiving clothing/items _from_ Carrie's Closet @@ -6,35 +6,35 @@ - **Donor**: somone giving clothing/items _to_ Carrie's Closet - **Donation:** form which donors use to give items to Carrie's Closet -## New & Improved โญ +## New & Improved Functionality in This Release โญ - Anyone on the internet can make item requests. ๐Ÿ’ They can specify - How urgent their need is - - When they are available + - When they are available to receive the items - What items they need - Where they are located - Anyone on the internet can also donate to Carrie's Closet ๐ŸŽ… They can specify - What items they'd like to donate - Where they are located - - When they are available - - Directly increase/increase quantities when inventory lists inebitably get out of wack + - When they are available to donate the items - Administrators & volunteers can manage item inventory ๐Ÿ‘š - Can specify categories (like boy's shoes, girl's tops, etc.) - - Automatically decrease inventory when a request is fulfilled - - Automatically increase inventory when a donation is received + - The system automatically decreases inventory when a request is fulfilled + - The system automatically increases inventory when a donation is received + - Directly increase/decrease quantities when inventory lists inevitably get out of sync with real inventory - Admnistrators can manage other user's accounts ๐Ÿงพ - - Grant them 1 or more roles within Carrie's Closet: donee, donor, volunteer, administrator + - Grant them one or more roles within Carrie's Closet: donee, donor, volunteer, administrator - Invite new users by sending unique sign up links to email addresses -- You get emails now! Notifications ๐Ÿ“ง +- Users get emails now! Notifications ๐Ÿ“ง - To admins & volunteers when an urgent request comes in - To anyone who completes a form, confirming it's completed - To new users, inviting them to join -- The app doesn't look ugly anymore! ๐Ÿฆ‹ +- The app is now stylistically appealing! ๐Ÿฆ‹ - Paypal! Carrie's Closet can accept money from nice people online ## Known Bugs ๐Ÿž @@ -43,9 +43,9 @@ - When creating an account, if the "Password" and "Confirm Password" fields do not match, no error is surfaced (but account creation is still blocked) - The radio buttons may still be stacked on mobile views -## Fixes ๐Ÿ› ๏ธ -- Radio buttons are no longer strangly stacked (side by side now) -- The invite user page doesn't lead to a black hole anymore... why'd we do that... haha, oops -- Donors are no longer allowed to donate negative (huh?) item quantities +## Previous Bugs that are Now Fixed ๐Ÿ› ๏ธ +- Radio buttons are no longer strangely stacked (side by side now) +- The invite user page leads to the intended location +- Donors are no longer allowed to donate negative item quantities - The inventory list doesn't extend past the width of your screen From f9e3ff97c7537fbc5d4cb943a6c56f5bf03174e9 Mon Sep 17 00:00:00 2001 From: tumbleshack <43155606+tumbleshack@users.noreply.github.com> Date: Fri, 23 Apr 2021 23:49:32 -0400 Subject: [PATCH 18/18] Update InstallGuide.md --- InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InstallGuide.md b/InstallGuide.md index 2f447e8..4922910 100644 --- a/InstallGuide.md +++ b/InstallGuide.md @@ -81,7 +81,7 @@ Exit vim by typing `:wq`. Next, build the container by running: ``` -$ docker build f Dockerfile.prod . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID +$ docker build -f Dockerfile.prod . --tag gcr.io/$PROJECT_ID/cloudrun/$_SERVICE_ID ``` ### Installation of Application: