From e830ee1f6e910b0f70151f1124455cca0047cd59 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 00:43:12 -0500 Subject: [PATCH 1/6] Fixed yaml invalid list --- .do/deploy.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index 2b1df80..ab16c7a 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -2,7 +2,7 @@ spec: name: jury services: - name: jury-service - - dockerfile_path: Dockerfile + dockerfile_path: Dockerfile envs: - key: JURY_NAME scope: RUN_AND_BUILD_TIME From 5fb69769407b12682d78056c39eb55d8bc29b53c Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 00:44:27 -0500 Subject: [PATCH 2/6] Fix repo_clone_url field --- .do/deploy.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index ab16c7a..172c778 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -23,5 +23,5 @@ spec: type: SECRET git: branch: master - repo: https://github.com/acmutd/jury.git + repo_clone_url: https://github.com/acmutd/jury.git \ No newline at end of file From a46b0f11f4125f2b4ce7505008f7723d6bd5e88a Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 00:49:06 -0500 Subject: [PATCH 3/6] Added instance size to template --- .do/deploy.template.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index 172c778..7c5dbb2 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -24,4 +24,6 @@ spec: git: branch: master repo_clone_url: https://github.com/acmutd/jury.git + instance_size_slug: s-1vcpu-512mb-10gb + instance_count: 1 \ No newline at end of file From 014a3b221dae0e91e4a251402e803b8d5732c1f8 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 00:51:11 -0500 Subject: [PATCH 4/6] bah the size is wrong --- .do/deploy.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index 7c5dbb2..23969ff 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -24,6 +24,6 @@ spec: git: branch: master repo_clone_url: https://github.com/acmutd/jury.git - instance_size_slug: s-1vcpu-512mb-10gb + instance_size_slug: basic-xxs instance_count: 1 \ No newline at end of file From 9363f8e10bb447982886902b27c89aa7f6f083d0 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 00:55:59 -0500 Subject: [PATCH 5/6] Ig envs are not secret --- .do/deploy.template.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index 23969ff..dcf560f 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -8,10 +8,8 @@ spec: scope: RUN_AND_BUILD_TIME - key: JURY_ADMIN_PASSWORD scope: RUN_AND_BUILD_TIME - type: SECRET - key: MONGODB_URI scope: RUN_AND_BUILD_TIME - type: SECRET - key: EMAIL_HOST scope: RUN_AND_BUILD_TIME - key: EMAIL_PORT @@ -20,7 +18,6 @@ spec: scope: RUN_AND_BUILD_TIME - key: EMAIL_PASSWORD scope: RUN_AND_BUILD_TIME - type: SECRET git: branch: master repo_clone_url: https://github.com/acmutd/jury.git From f8cf614b660bc0fbea5836a9052425964474cc0c Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Fri, 6 Oct 2023 01:14:52 -0500 Subject: [PATCH 6/6] Added deploy button to README --- .do/deploy.template.yaml | 3 +-- Dockerfile | 1 - README.md | 51 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index dcf560f..ba5bc14 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -4,7 +4,7 @@ spec: - name: jury-service dockerfile_path: Dockerfile envs: - - key: JURY_NAME + - key: REACT_APP_JURY_NAME scope: RUN_AND_BUILD_TIME - key: JURY_ADMIN_PASSWORD scope: RUN_AND_BUILD_TIME @@ -23,4 +23,3 @@ spec: repo_clone_url: https://github.com/acmutd/jury.git instance_size_slug: basic-xxs instance_count: 1 - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d50710d..57e06aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ COPY ["client/package.json", "client/tailwind.config.js", "client/tsconfig.json" ARG NODE_ENV=production ARG REACT_APP_JURY_NAME -ARG REACT_APP_JURY_URL ARG REACT_APP_HUB RUN yarn install diff --git a/README.md b/README.md index e4154f8..65c2c05 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,56 @@ A project designed to create a new pairwise judging system using modern technologies aimed at optimizing the user experience of judges and admin users. See the inspiration for this project: [Gavel by anishathalye](https://github.com/anishathalye/gavel). Refer to [this excellent article](https://www.anishathalye.com/2015/03/07/designing-a-better-judging-system/) for more details on the underlying formulas of Gavel! The majority of our algorithm will be based off of research done in the field of [pairwise comparison](https://en.wikipedia.org/wiki/Pairwise_comparison). -# Deployment +# One Click Deploy! + +[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/acmutd/jury/tree/master&refcode=de08cdf58df3) + +## 0. Set up MongoDB Atlas + +MongoDB is a **free** NoSQL database that is hosted in the cloud! Their website has great instructions on how to quickly create an account and 100% lifetime free database, perfect for Jury: https://www.mongodb.com/docs/atlas/getting-started/. + +Follow the instructions up to step 5: connect to your cluster. You will get a URI string that looks like `mongodb+srv://:@.mongodb.net/?retryWrites=true&w=majority`, except \, \, and \ should be filled in. You will need that for the environmental variables. + +## 1. Resources + +- Click Edit Plan +- Change plan to "Basic" +- Change Instance Size to "$5.00/mo -- Basic (512 MB RAM | 1 vCPU)" + +Note that since Digital Ocean charges prorated, this will literally be like less than 20 cents a day. + +## 2. Environmental Variables + +Click on "edit" next to "jury-service" and fill in the env as follows: + +- REACT_APP_JURY_NAME - Name of the app to display to the user (eg. HackUTD X Judging) +- JURY_ADMIN_PASSWORD - Password for the admin portal (suggestion: use 2 random words) +- MONGODB_URI - URI of MongoDB Atlas instance (see step 0) +- EMAIL_HOST - SMTP email host (see below) +- EMAIL_FROM - SMTP email sending from address (see below) +- EMAIL_PASSWORD - SMTP email password (see below) +- EMAIL_POST - 587 + +### Email hosting + +If using Gmail SMTP: +- EMAIL_HOST = smtp.gmail.com +- EMAIL_FROM = gmail username +- EMAIL_PASSWORD = google app password + +If using SendGrid SMTP: +- EMAIL_HOST = smtp.sendgrid.com +- EMAIL_FROM = sendgrid email sender +- EMAIL_PASSWORD = sendgrid API key + +## 3. Info + +You can change the start of the URL if you want: +- App Info > edit +- Change app name (URL will be .ondigitalocean.app) +- Click Next + +# Deploy Manually ## Setup