See: https://github.com/SocietyClub/RCV
- About the Project
- Contributing
- Restful Verb Documentation
- Getting Started
- How To Run the API
- Other Development Info
The backend for Ranked Choice Voting. For any questions regarding this project contact [email protected]
Follow these guidelines:
Read this before you make changes to the API!
https://www.restapitutorial.com/lessons/httpmethods.html
Make sure to install Golang on your local system beforehand: https://golang.org/dl/
- Log into Google Cloud and head to Service accounts under the IAM & Admin page. https://console.cloud.google.com/iam-admin/serviceaccounts
- Select rcv-service-account and under action click Manage Keys
- Create a new key, select json file format and save it for later. Do not save the key in this repo in case we accidently deploy it :)
- Provide authentication credentials to your application code by setting the environment variable GOOGLE_APPLICATION_CREDENTIALS
For more details check out: https://cloud.google.com/firestore/docs/quickstart-servers#go
git clone https://github.com/SocietyClub/RCV-backend.git
cd RCV-backend/api
go get
-
Copy service accounts credentials that you generated in the previous steps.
-
Paste credentials in RCV-backend\api\configs\config.yml under credentials inside the string.
-
Run the following commands
$env:GOOGLE_APPLICATION_CREDENTIALS="../firestore_prod_key.json" # or where your key is stored at...
cd RCV-backend/api
go run main.go
DO NOT COMMIT PUSH CREDENTIALS, ALWAYS REMOVE THEM AFTER DEPLOYMENT
Only package maintainers have access to deploy. These instructions are for them.
Once you are authorized to deploy through gcloud via your google account, you may download gcloud locally (https://cloud.google.com/sdk/docs/quickstart?authuser=5) or use the terminal from the online google console.
- Go to https://console.cloud.google.com/home/dashboard?project=societyclub-rcv-backend and open the terminal (or download gcloud locally)
gcloud config set project societyclub-rcv-backend
You can check if the config was set properly viagcloud config list
git clone https://github.com/SocietyClub/RCV-backend.git
cd RCV-backend/helloworld
git pull
gcloud app deploy