├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docker-compose-prod.yml ├── docker-compose.yml └── scripts ├── database_setup.sql ├── dev_spinup.sh ├── docker_settings_init.sh └── prod_spinup.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .repo 2 | .DS_STORE 3 | 4 | build 5 | log 6 | 7 | groot* 8 | canopy 9 | display 10 | 11 | npm-debug.log 12 | 13 | clients.db 14 | 15 | config.go 16 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTING 2 | > Thanks for wanting to contribute! 3 | 4 | The way we work on Groot is in a sort of bi-modal development mindset. We have 2 sets of development going on at once: __hardening__ development and __feature__ development. 5 | 6 | We organize priorities though releases. 7 | 8 | Releases termed X.0 are hardening releases and will contain mostly bug fixes and refinements to the overarching system. 9 | 10 | Releases termed X.5 are feature releases and contain new ideas we want to implement. 11 | 12 | We have release notes tracked in the main groot repo and you will likely see X.0/X.5 releases tracked in the same doc. 13 | 14 | - [Groot v1.0/v1.5](https://github.com/acm-uiuc/groot/issues/24) 15 | 16 | We use milestones then to track the specific issues in each release 17 | 18 | Repos will be tagged once all issues in a release have been addressed (X.0 blocks a X.5 release, but not the other way around). 19 | 20 | We track ongoing development on the Groot project board (https://github.com/orgs/acm-uiuc/projects/1) 21 | 22 | ## What you should work on 23 | 24 | The core team (@aashishkapur @sameetandpotatoes @bcongdon @narendasan), focus mostly on X.0 releases and we want newer developers to start working on X.5 releases. 25 | 26 | If you want to help out check the most recent release notes and pick and X.5 issue to work on. If you need help getting started checkout the README or ask us questions on the [Gitter](https://gitter.im/acm-uiuc/groot-development) 27 | 28 | ## Submitting Code Changes 29 | If you are ready to put a pull request in, great! 30 | 31 | ## Things to verify: 32 | - [ ] Make sure to tag the issue you are addressing in your comments if applicable. 33 | - [ ] Make sure any tests pass 34 | - [ ] Make sure you stick to rough style guidelines 35 | - [ ] Have you added the license header to any new files? 36 | 37 | After a quick discussion and maybe some changes requested, your code will get merged 38 | 39 | 40 | ### Style Guidelines 41 | __Go__ (just us a linter basically): 42 | ```go 43 | //Function Signatures: 44 | func foo(arg1: int, arg2: bool) { 45 | 46 | //if/else 47 | if x == y { 48 | return x 49 | } 50 | return y 51 | 52 | //No non bracketed blocks 53 | //wrong: 54 | if x == 1 55 | return true 56 | //correct: 57 | if x == 1 { 58 | return true 59 | } 60 | ``` 61 | 62 | __JS__ (Use something like ESLint) 63 | ```js 64 | //Function Signatures: 65 | function foo(arg1: int, arg2: bool) { 66 | 67 | //if/else 68 | if x == y { 69 | return x 70 | } 71 | return y 72 | 73 | //No non bracketed blocks 74 | //wrong: 75 | if x == 1 76 | return true 77 | //correct: 78 | if x == 1 { 79 | return true 80 | } 81 | ``` 82 | __Ruby__: 83 | Use the rubocop linters in the repos 84 | 85 | __Python__: 86 | Follow PEP8 87 | 88 | 89 | ### License Header 90 | ``` 91 | Copyright © 2017, ACM@UIUC 92 | 93 | This file is part of the Groot Project. 94 | 95 | The Groot Project is open source software, released under the University of Illinois/NCSA Open Source License. 96 | You should have received a copy of this license in a file with the distribution. 97 | ``` 98 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | University of Illinois/NCSA Open Source License 2 | 3 | Copyright (c) 2017 ACM@UIUC. All rights reserved. 4 | 5 | Developed by: Groot Development Team 6 | ACM@UIUC 7 | https://acm.illinois.edu 8 | 9 | Permission is hereby granted, free of charge, to any person 10 | obtaining a copy of this software and associated documentation files 11 | (the "Software"), to deal with the Software without restriction, 12 | including without limitation the rights to use, copy, modify, merge, 13 | publish, distribute, sublicense, and/or sell copies of the Software, 14 | and to permit persons to whom the Software is furnished to do so, 15 | subject to the following conditions: 16 | 17 | * Redistributions of source code must retain the above copyright notice, 18 | this list of conditions and the following disclaimers. 19 | 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimers in the 22 | documentation and/or other materials provided with the distribution. 23 | 24 | * Neither the names of ACM@UIUC, the Groot Development Team nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this Software without specific prior written permission. 27 | 28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 29 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH 34 | THE SOFTWARE. 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Groot 2 | Groot is the next generation web application serving the UIUC Chapter of ACM. It is the replacement for liquid which goes defunct 1/1/2016. 3 | 4 | 5 | [![Join the chat at https://acm-uiuc.slack.com/messages/C6XGZD212/](https://img.shields.io/badge/slack-groot-724D71.svg)](https://acm-uiuc.slack.com/messages/C6XGZD212/) 6 | 7 | ## Groot Projects 8 | 9 | - [groot](https://github.com/acm-uiuc/groot) - Infrastructure of ACM@UIUC 10 | 11 | ### Javascript 12 | 13 | - [groot-desktop-frontend](https://github.com/acm-uiuc/groot-desktop-frontend) - Desktop Frontend for Groot 14 | - [groot-events-service](https://github.com/acm-uiuc/groot-events-service) - Manages ACM events 15 | - [groot-groups-service](https://github.com/acm-uiuc/groot-groups-service) - Manages ACM groups 16 | 17 | ### Python 18 | 19 | - [groot-credits-service](https://github.com/acm-uiuc/groot-credits-service) - Unified payment system for ACM@UIUC 20 | - [groot-gigs-service](https://github.com/acm-uiuc/groot-gigs-service) - Supporting the Groot economy 21 | - [groot-meme-service](https://github.com/acm-uiuc/groot-meme-service) - Internal ACM@UIUC Meme Board 22 | - [groot-voz](https://github.com/acm-uiuc/groot-voz) - Alexa integrations for Groot 23 | 24 | ### Ruby 25 | 26 | - [groot-auth-stub-service](https://github.com/acm-uiuc/groot-auth-stub-service) - A development authentication service that mocks crowd and returns a fake user 27 | - [groot-merch-service](https://github.com/acm-uiuc/groot-merch-service) - Groot service for injecting caffeine into your blood stream 28 | - [groot-quotes-service](https://github.com/acm-uiuc/groot-quotes-service) - Manages quotes heard around the ACM office 29 | - [groot-recruiters-service](https://github.com/acm-uiuc/groot-recruiters-service) - Recruiter Services for Groot 30 | - [groot-recruiters-templates-example](https://github.com/acm-uiuc/groot-recruiters-templates-example) - Holds template used by the Recruiter service to send emails 31 | - [groot-users-service](https://github.com/acm-uiuc/groot-users-service) - Users Services for Groot 32 | 33 | ### Go 34 | 35 | - [groot-api-gateway](https://github.com/acm-uiuc/groot-api-gateway) - API Gateway for the Groot project written in Arbor 36 | 37 | ## Setting Up Groot 38 | 39 | 1. Follow [these](https://docs.docker.com/compose/install/#uninstallation) instructions to install Docker and docker-compose. 40 | 2. Install repo - https://android.googlesource.com/tools/repo/ 41 | 42 | Mac OS 43 | ```sh 44 | brew install repo 45 | ``` 46 | 47 | Ubuntu 14.04+ 48 | ```sh 49 | sudo apt install repo 50 | 51 | ``` 52 | 3. Make a directory to house your groot work 53 | ```sh 54 | mkdir groot-deploy 55 | ``` 56 | 57 | 4. Within this directory run the following command to start managing the projects 58 | 59 | ```sh 60 | repo init -u git@github.com:acm-uiuc/groot-manifest 61 | ``` 62 | 63 | 5. Run the following command to grab the latest releases of all services, including the frontend 64 | 65 | ```sh 66 | repo sync 67 | ``` 68 | 69 | 6. Run the settings init script: 70 | ```sh 71 | ./scripts/docker_settings_init.sh 72 | ``` 73 | 7. Start up Docker. (This may involve `docker-machine` if you're on a Mac) 74 | 8. Start the Docker containers: 75 | ```sh 76 | docker-compose up 77 | ``` 78 | 9. Wait for the image to build and startup. If it works, you'll be able to visit `https://0.0.0.0:5000` in a browser and see the deployed site. The Groot API will be available on port 8000. 79 | 80 | a. If you see errors it is most likely because you need to create configuration files for each of the services. 81 | For each service with an error, copy and rename the `template` file to the name of the file minus template. 82 | For example `groot-api-gateway/config/config.go.template` should be copied and renamed to `groot-api-gateway/config/config.go` 83 | 84 | Useful Notes: 85 | 86 | * If you want to just rebuild one service (i.e. for dev work), you can keep the `docker-compose` command running, and run this command in a separate terminal window to rebuild the service you're working on: 87 | ``` 88 | docker-compose up -d --build SERVICE 89 | ``` 90 | * For dev work you'll probably want to run in unauthenticated mode. To do this, change the `CMD` line in `groot-api-gateway/Dockerfile` to: 91 | ``` 92 | CMD ["./build/groot-api-gateway", "-u"] 93 | ``` 94 | * To view logs, run: 95 | ``` 96 | sudo docker-compose logs -f 97 | ``` 98 | 99 | ## Legacy Instructions 100 | *Note: It is necessary for you to have an ssh key (without a password if you want it to be even easier) attached to your github* 101 | 102 | 1. Install repo - https://android.googlesource.com/tools/repo/ 103 | 104 | Mac OS 105 | ```sh 106 | brew install repo 107 | ``` 108 | 109 | Ubuntu 14.04+ 110 | ```sh 111 | sudo apt install repo 112 | 113 | ``` 114 | 2. Make a directory to house your groot work 115 | ```sh 116 | mkdir groot 117 | ``` 118 | 119 | 3. Within this directory run the following command to start managing the projects 120 | 121 | ```sh 122 | repo init -u git@github.com:acm-uiuc/groot-manifest 123 | ``` 124 | 125 | 4. Run the following command to grab the latest releases of the services and frontend 126 | 127 | ```sh 128 | repo sync 129 | ``` 130 | 131 | - If you want to grab the latest ever just run the same command 132 | 5. Run the ```dev_spinup.sh``` script to start up a dev instance of groot (will grab the latest version of each service on github) 133 | 6. Run the ```prod_spinup.sh``` script to start a production version of groot (will grab the latest version of each and place them in their respective containers, so you will need docker) 134 | 135 | ### First Time Setup 136 | - Golang 137 | + Install Software 138 | ```sh 139 | mkdir [SOME DIRECTORY] 140 | mkdir [SOME DIRECTORY]/bin && mkdir [SOME DIRECTORY]/lib \ 141 | && mkdir [SOME DIRECTORY]/src 142 | mkdir -p [SOME DIRECTORY]/src/github.com/acm-uiuc 143 | ``` 144 | --- Add to .profile (.zshrc/.bashrc) --- 145 | ```sh 146 | export GOPATH=[SOME DIRECTORY] 147 | 148 | #macOS 149 | export GOROOT=/usr/local/opt/go/libexec 150 | #Ubuntu 14.04+ 151 | export GOROOT=/usr/local/go 152 | 153 | export PATH=$PATH:$GOPATH/bin 154 | export PATH=$PATH:$GOROOT/bin 155 | ``` 156 | ```sh 157 | #macOS 158 | brew install go 159 | #Ubuntu 14.04+ 160 | sudo curl -O https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz 161 | sudo tar -xvf go1.7.linux-amd64.tar.gz 162 | sudo mv go /usr/local 163 | ``` 164 | + Add ```groot``` to ```GOPATH``` 165 | ```sh 166 | ln -s [PATH to groot-deploy]/groot-api-gateway [SOME DIRECTORY]/src/github.com/acm-uiuc/groot-api-gateway 167 | ``` 168 | + Install groot dependecies 169 | ```sh 170 | go get github.com/gorilla/mux 171 | 172 | go get github.com/boltdb/bolt 173 | 174 | go get github.com/kennygrant/sanitize 175 | 176 | go get github.com/acm-uiuc/arbor/server 177 | 178 | go get github.com/acm-uiuc/arbor/services 179 | 180 | go get github.com/acm-uiuc/arbor/security 181 | 182 | go get github.com/acm-uiuc/arbor/proxy 183 | 184 | go install github.com/gorilla/mux 185 | 186 | go install github.com/boltdb/bolt 187 | 188 | go install github.com/kennygrant/sanitize 189 | 190 | go install github.com/acm-uiuc/arbor/server 191 | 192 | go install github.com/acm-uiuc/arbor/services 193 | 194 | go install github.com/acm-uiuc/arbor/security 195 | 196 | go install github.com/acm-uiuc/arbor/proxy 197 | ``` 198 | 199 | + Install packages 200 | 201 | ```sh 202 | go install github.com/acm-uiuc/groot-api-gateway/config 203 | 204 | go install github.com/acm-uiuc/groot-api-gateway/services 205 | ``` 206 | - Node 207 | + Install Software 208 | ```sh 209 | #macOS 210 | brew install node 211 | #Ubuntu 14.04+ 212 | sudo apt-get install nodejs 213 | sudo apt-get install npm 214 | sudo apt-get install build-essential 215 | sudo apt-get update 216 | sudo apt-get install build-essential libssl-dev 217 | curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh 218 | bash install_nvm.sh 219 | source ~/.profile 220 | nvm install 7.2.0 221 | nvm use 7.2.0 222 | sudo npm install -g forever 223 | ``` 224 | - Ruby 225 | + Install Software 226 | ```sh 227 | #macOS 228 | brew install rbenv 229 | #Ubuntu 14.04+ 230 | sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev 231 | git clone https://github.com/rbenv/rbenv.git ~/.rbenv 232 | echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc (~/.profile / ~/.zshrc) 233 | echo 'eval "$(rbenv init -)"' >> ~/.bashrc (~/.profile / ~/.zshrc) 234 | source ~/.bashrc (~/.profile / ~/.zshrc) 235 | git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build 236 | 237 | rbenv install 2.3.1 238 | rbenv global 2.3.1 239 | # You may have to restart your terminal session 240 | gem install bundler 241 | ``` 242 | - Python 243 | + Install Software 244 | ``` 245 | #macOS 246 | brew install python 247 | #Ubuntu 248 | sudo apt install python-pip 249 | ``` 250 | 251 | - MySQL 252 | + Install Software 253 | ```sh 254 | #macOS 255 | brew install mysql 256 | mysqladmin -u root password 'yourpassword' 257 | mysql.server restart 258 | #Ubuntu 14.04+ 259 | sudo apt-get install mysql-server 260 | sudo apt-get install libmysqlclient-dev 261 | sudo mysqld --intialize 262 | 263 | mysql -u root 264 | mysql> CREATE DATABASE groot_recruiter_service; 265 | mysql> CREATE DATABASE acm_users; 266 | mysql> CREATE DATABASE groot_meme_service; 267 | mysql> CREATE DATABASE groot_quotes_service; 268 | ``` 269 | 270 | ## License 271 | 272 | This project is licensed under the University of Illinois/NCSA Open Source License. For a full copy of this license take a look at the LICENSE file. 273 | 274 | When contributing new files to this project, preappend the following header to the file as a comment: 275 | 276 | ``` 277 | Copyright © 2017, ACM@UIUC 278 | 279 | This file is part of the Groot Project. 280 | 281 | The Groot Project is open source software, released under the University of Illinois/NCSA Open Source License. 282 | You should have received a copy of this license in a file with the distribution. 283 | ``` 284 | -------------------------------------------------------------------------------- /docker-compose-prod.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | db: 4 | image: mysql 5 | volumes: 6 | - ./scripts/database_setup.sql:/docker-entrypoint-initdb.d/schema.sql:ro 7 | - db_data:/var/lib/mysql 8 | ports: 9 | - "3306:3306" 10 | restart: always 11 | environment: 12 | # Necessary so that MySQL doesn't complain about uninitialized root user. 13 | # Our setup script initializes a root password on the first launch. 14 | # The MySQL password should be changed by hand to whatever the prod 15 | # credentials are as soon as possible, and then service credentials must 16 | # be also updated accordingly. 17 | MYSQL_ALLOW_EMPTY_PASSWORD: "yes" 18 | 19 | groot-ad-service: 20 | build: groot-ad-service 21 | ports: 22 | - "8998:8998" 23 | depends_on: 24 | - groot-api-gateway 25 | volumes: 26 | - ./groot-ad-service:/usr/src/app 27 | restart: always 28 | 29 | groot-api-gateway: 30 | build: groot-api-gateway 31 | ports: 32 | - "8000:8000" 33 | volumes: 34 | - groot_api_gateway_volume:/var/groot-api-gateway/ 35 | restart: always 36 | 37 | groot-credits-service: 38 | build: groot-credits-service 39 | ports: 40 | - "8765:8765" 41 | depends_on: 42 | - db 43 | - groot-api-gateway 44 | restart: always 45 | 46 | groot-desktop-frontend: 47 | build: groot-desktop-frontend 48 | depends_on: 49 | - groot-api-gateway 50 | ports: 51 | - "5000:5000" 52 | restart: always 53 | 54 | groot-events-service: 55 | build: groot-events-service 56 | ports: 57 | - "8002:8002" 58 | depends_on: 59 | - groot-api-gateway 60 | restart: always 61 | environment: 62 | TZ: "America/Chicago" 63 | 64 | groot-gigs-service: 65 | build: groot-gigs-service 66 | ports: 67 | - "8964:8964" 68 | depends_on: 69 | - db 70 | - groot-api-gateway 71 | restart: always 72 | 73 | groot-groups-service: 74 | build: groot-groups-service 75 | ports: 76 | - "9001:9001" 77 | depends_on: 78 | - groot-api-gateway 79 | restart: always 80 | 81 | groot-meme-service: 82 | build: groot-meme-service 83 | ports: 84 | - "42069:42069" 85 | depends_on: 86 | - db 87 | - groot-api-gateway 88 | restart: always 89 | 90 | groot-merch-service: 91 | build: groot-merch-service 92 | ports: 93 | - "6969:6969" 94 | depends_on: 95 | - db 96 | - groot-api-gateway 97 | restart: always 98 | environment: 99 | RACK_ENV: "production" 100 | 101 | groot-notification-service: 102 | build: groot-notification-service 103 | ports: 104 | - "1122:1122" 105 | depends_on: 106 | - groot-api-gateway 107 | restart: always 108 | 109 | groot-quotes-service: 110 | build: groot-quotes-service 111 | ports: 112 | - "9494:9494" 113 | depends_on: 114 | - db 115 | - groot-api-gateway 116 | restart: always 117 | environment: 118 | RACK_ENV: "production" 119 | 120 | groot-recruiters-service: 121 | build: groot-recruiters-service 122 | ports: 123 | - "4567:4567" 124 | depends_on: 125 | - db 126 | - groot-api-gateway 127 | restart: always 128 | environment: 129 | RACK_ENV: "production" 130 | 131 | groot-request-service: 132 | build: groot-request-service 133 | ports: 134 | - "5656:5656" 135 | depends_on: 136 | - groot-api-gateway 137 | restart: always 138 | 139 | groot-users-service: 140 | build: groot-users-service 141 | ports: 142 | - "8001:8001" 143 | depends_on: 144 | - db 145 | - groot-api-gateway 146 | restart: always 147 | environment: 148 | RACK_ENV: "production" 149 | 150 | groot-voz: 151 | build: groot-voz 152 | ports: 153 | - "5652:5652" 154 | depends_on: 155 | - db 156 | - groot-api-gateway 157 | restart: always 158 | 159 | volumes: 160 | db_data: 161 | groot_api_gateway_volume: 162 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | db: 4 | image: mysql 5 | volumes: 6 | - ./scripts/database_setup.sql:/docker-entrypoint-initdb.d/schema.sql:ro 7 | - db_data:/var/lib/mysql 8 | ports: 9 | - "3306:3306" 10 | restart: always 11 | environment: 12 | MYSQL_ROOT_PASSWORD: "root" 13 | 14 | groot-ad-service: 15 | build: groot-ad-service 16 | ports: 17 | - "8998:8998" 18 | depends_on: 19 | - groot-api-gateway 20 | volumes: 21 | - ./groot-ad-service:/usr/src/app 22 | restart: always 23 | 24 | groot-api-gateway: 25 | build: groot-api-gateway 26 | ports: 27 | - "8000:8000" 28 | volumes: 29 | - groot_api_gateway_volume:/var/groot-api-gateway/ 30 | command: ["./build/groot-api-gateway", "-u"] 31 | restart: always 32 | 33 | groot-auth-stub-service: 34 | build: groot-auth-stub-service 35 | ports: 36 | - "8008:8008" 37 | volumes: 38 | - ./groot-auth-stub-service:/usr/src/app 39 | restart: always 40 | 41 | groot-credits-service: 42 | build: groot-credits-service 43 | ports: 44 | - "8765:8765" 45 | depends_on: 46 | - db 47 | - groot-api-gateway 48 | volumes: 49 | - ./groot-credits-service:/usr/src/app 50 | environment: 51 | CREDITS_DEBUG: "True" 52 | restart: always 53 | 54 | groot-desktop-frontend: 55 | build: groot-desktop-frontend 56 | depends_on: 57 | - groot-api-gateway 58 | ports: 59 | - "5000:5000" 60 | volumes: 61 | - ./groot-desktop-frontend:/usr/src/app 62 | restart: always 63 | 64 | groot-events-service: 65 | build: groot-events-service 66 | ports: 67 | - "8002:8002" 68 | depends_on: 69 | - groot-api-gateway 70 | volumes: 71 | - ./groot-events-service:/usr/src/app 72 | restart: always 73 | environment: 74 | TZ: "America/Chicago" 75 | 76 | groot-gigs-service: 77 | build: groot-gigs-service 78 | ports: 79 | - "8964:8964" 80 | depends_on: 81 | - db 82 | - groot-api-gateway 83 | volumes: 84 | - ./groot-gigs-service:/usr/src/app 85 | environment: 86 | GIG_DEBUG: "True" 87 | restart: always 88 | 89 | groot-groups-service: 90 | build: groot-groups-service 91 | ports: 92 | - "9001:9001" 93 | depends_on: 94 | - groot-api-gateway 95 | volumes: 96 | - ./groot-groups-service:/usr/src/app 97 | restart: always 98 | 99 | groot-meme-service: 100 | build: groot-meme-service 101 | ports: 102 | - "42069:42069" 103 | depends_on: 104 | - db 105 | - groot-api-gateway 106 | volumes: 107 | - ./groot-meme-service:/usr/src/app 108 | environment: 109 | MEME_DEBUG: "True" 110 | restart: always 111 | 112 | groot-merch-service: 113 | build: groot-merch-service 114 | ports: 115 | - "6969:6969" 116 | depends_on: 117 | - db 118 | - groot-api-gateway 119 | volumes: 120 | - ./groot-merch-service:/usr/src/app 121 | restart: always 122 | 123 | groot-notification-service: 124 | build: groot-notification-service 125 | ports: 126 | - "1122:1122" 127 | depends_on: 128 | - groot-api-gateway 129 | volumes: 130 | - ./groot-notification-service:/usr/src/app 131 | environment: 132 | NOTIFICATION_DEBUG: "True" 133 | restart: always 134 | 135 | groot-quotes-service: 136 | build: groot-quotes-service 137 | ports: 138 | - "9494:9494" 139 | depends_on: 140 | - db 141 | - groot-api-gateway 142 | volumes: 143 | - ./groot-quotes-service:/usr/src/app 144 | restart: always 145 | 146 | groot-recruiters-service: 147 | build: groot-recruiters-service 148 | ports: 149 | - "4567:4567" 150 | depends_on: 151 | - db 152 | - groot-api-gateway 153 | volumes: 154 | - ./groot-recruiters-service:/usr/src/app 155 | restart: always 156 | 157 | groot-request-service: 158 | build: groot-request-service 159 | ports: 160 | - "5656:5656" 161 | depends_on: 162 | - db 163 | - groot-api-gateway 164 | volumes: 165 | - ./groot-request-service:/usr/src/app 166 | environment: 167 | REQUEST_DEBUG: "True" 168 | restart: always 169 | 170 | groot-users-service: 171 | build: groot-users-service 172 | ports: 173 | - "8001:8001" 174 | depends_on: 175 | - db 176 | - groot-api-gateway 177 | volumes: 178 | - ./groot-users-service:/usr/src/app 179 | restart: always 180 | 181 | groot-voz: 182 | build: groot-voz 183 | ports: 184 | - "5652:5652" 185 | depends_on: 186 | - db 187 | - groot-api-gateway 188 | volumes: 189 | - ./groot-voz:/usr/src/app 190 | environment: 191 | VOZ_DEBUG: "True" 192 | restart: always 193 | 194 | volumes: 195 | db_data: 196 | groot_api_gateway_volume: 197 | -------------------------------------------------------------------------------- /scripts/database_setup.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS groot_credits_service; 2 | CREATE DATABASE IF NOT EXISTS groot_gigs_service; 3 | CREATE DATABASE IF NOT EXISTS groot_meme_service; 4 | CREATE DATABASE IF NOT EXISTS groot_merch_service; 5 | CREATE DATABASE IF NOT EXISTS groot_quote_service; 6 | CREATE DATABASE IF NOT EXISTS groot_recruiter_service; 7 | CREATE DATABASE IF NOT EXISTS groot_request_service; 8 | CREATE DATABASE IF NOT EXISTS groot_user_service; 9 | CREATE USER 'root'@'%' IDENTIFIED BY 'root'; 10 | GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; 11 | FLUSH PRIVILEGES; 12 | -------------------------------------------------------------------------------- /scripts/dev_spinup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Change directory to root groot directory 4 | scriptsdir=`dirname $0` 5 | cd "$scriptsdir/.." 6 | 7 | mkdir -p log/dev 8 | 9 | # Groot API 10 | ./groot-api-gateway/build.sh 11 | cp groot-api-gateway/build/groot-api-gateway build/groot-api-gateway 12 | 13 | # Groot Users Service 14 | cd groot-users-service 15 | bundle install 16 | cd .. 17 | 18 | # Groot Auth Service 19 | cd groot-auth-stub-service 20 | bundle install 21 | cd .. 22 | 23 | # Groot Groups Service 24 | cd groot-groups-service 25 | npm install 26 | cd .. 27 | 28 | # Groot Desktop Frontend 29 | cd groot-desktop-frontend 30 | npm install 31 | npm run build 32 | cd .. 33 | 34 | # Groot Events Service 35 | cd groot-events-service 36 | npm install 37 | cd .. 38 | 39 | # Groot Recruiters Service 40 | cd groot-recruiters-service 41 | bundle install 42 | cd .. 43 | 44 | # Groot Quotes Service 45 | cd groot-quotes-service 46 | bundle install 47 | cd .. 48 | 49 | # Groot Merch Service 50 | cd groot-merch-service 51 | bundle install 52 | cd .. 53 | 54 | # Groot Meme Service 55 | cd groot-meme-service 56 | pip install -r requirements.txt --user 57 | cd .. 58 | 59 | # Groot Credits Service 60 | cd groot-credits-service 61 | pip install -r requirements.txt --user 62 | cd .. 63 | 64 | # Groot Gigs Service 65 | cd groot-gigs-service 66 | pip install -r requirements.txt --user 67 | cd .. 68 | 69 | # Groot Voz 70 | cd groot-voz 71 | pip install -r requirements.txt --user 72 | cd .. 73 | 74 | trap 'kill %1; kill %2; kill %3; kill %4; kill %5; kill %6; kill %7; kill %8; kill %9; kill %10; kill %11; kill %12; kill %13' SIGINT 75 | 76 | ruby groot-users-service/app.rb | tee log/dev/groot-users-service.log | sed -e 's/^/[groot-users-service] /' \ 77 | & ruby groot-auth-stub-service/app.rb | tee log/dev/groot-auth-stub-service.log | sed -e 's/^/[groot-auth-stub-service] /' \ 78 | & node groot-groups-service/server.js | tee log/dev/groot-groups-service.log | sed -e 's/^/[groot-groups-service] /' \ 79 | & node groot-desktop-frontend/server.js | tee log/dev/groot-desktop-frontend.log | sed -e 's/^/[groot-desktop-frontend] /' \ 80 | & node groot-events-service/server.js | tee log/dev/groot-events-service.log | sed -e 's/^/[groot-events-service] /' \ 81 | & ruby groot-recruiters-service/app.rb | tee log/dev/groot-recruiters-service.log | sed -e 's/^/[groot-recruiters-service] /' \ 82 | & ruby groot-quotes-service/app.rb | tee log/dev/groot-quotes-service.log | sed -e 's/^/[groot-quotes-service] /' \ 83 | & ruby groot-merch-service/app.rb | tee log/dev/groot-merch-service.log | sed -e 's/^/[groot-merch-service] /' \ 84 | & python groot-meme-service/app.py | tee log/dev/groot-meme-service.log | sed -e 's/^/[groot-meme-service] /' \ 85 | & python groot-credits-service/app.py | tee log/dev/groot-credits-service.log | sed -e 's/^/[groot-credits-service] /' \ 86 | & python groot-gigs-service/app.py | tee log/dev/groot-gigs-service.log | sed -e 's/^/[groot-gigs-service] /' \ 87 | & python groot-voz/app.py | tee log/dev/groot-voz.log | sed -e 's/^/[groot-voz] /' \ 88 | & ./build/groot-api-gateway -u | tee log/dev/groot-api-gateway.log | sed -e 's/^/[groot] /' 89 | -------------------------------------------------------------------------------- /scripts/docker_settings_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Change directory to root groot directory 4 | scriptsdir=`dirname $0` 5 | cd "$scriptsdir/.." 6 | 7 | ##### SETUP CREDITS ##### 8 | echo "* Setting up CREDITS" 9 | credits="MYSQL = { 10 | 'user': 'root', 11 | 'password': 'root', 12 | 'host': 'db', 13 | 'dbname': 'groot_credits_service' 14 | } 15 | 16 | GROOT_SERVICES_URL = 'http://groot-api-gateway:8000' 17 | GROOT_ACCESS_TOKEN = '' 18 | STRIPE_SECRET_KEY = ''" 19 | echo "$credits" > groot-credits-service/settings.py 20 | 21 | ##### SETUP GIGS ##### 22 | echo "* Setting up GIGS" 23 | credits="MYSQL = { 24 | 'user': 'root', 25 | 'password': 'root', 26 | 'host': 'db', 27 | 'dbname': 'groot_gigs_service' 28 | } 29 | 30 | GROOT_SERVICES_URL = 'http://groot-api-gateway:8000' 31 | GROOT_ACCESS_TOKEN = ''" 32 | echo "$credits" > groot-gigs-service/settings.py 33 | 34 | ##### SETUP MEMES ##### 35 | echo "* Setting up MEMES" 36 | memes="MYSQL = { 37 | 'user': 'root', 38 | 'password': 'root', 39 | 'host': 'db', 40 | 'dbname': 'groot_meme_service' 41 | } 42 | 43 | GROOT_ACCESS_TOKEN = '' 44 | GROOT_SERVICES_URL = 'http://groot-api-gateway:8000' 45 | 46 | IMGUR_CLIENT_ID = '' 47 | IMGUR_CLIENT_SECRET = ''" 48 | echo "$memes" > groot-meme-service/settings.py 49 | 50 | ##### SETUP REQUEST ##### 51 | echo "* Setting up REQUEST" 52 | request="MYSQL = { 53 | 'user': 'root', 54 | 'password': 'root', 55 | 'host': 'db', 56 | 'dbname': 'groot_request_service' 57 | } 58 | " 59 | echo "$request" > groot-request-service/settings.py 60 | 61 | ##### SETUP NOTIFICATION ##### 62 | echo "* Setting up NOTIFICATION" 63 | notification="GROOT_SERVICES_URL = 'http://localhost:8000' 64 | GROOT_ACCESS_TOKEN = '' 65 | 66 | TWITTER = { 67 | 'consumer_key': '', 68 | 'consumer_secret': '', 69 | 'access_key': '', 70 | 'access_secret': '' 71 | } 72 | 73 | SLACK_API_TOKEN = '' 74 | 75 | EMAIL = { 76 | 'host': '', 77 | 'port': '', 78 | 'username': '', 79 | 'password': '' 80 | } 81 | " 82 | echo "$notification" > groot-notification-service/settings.py 83 | 84 | ##### SETUP VOZ ##### 85 | echo "* Setting up VOZ" 86 | voz="GROOT_URL = 'http://groot-api-gateway:8000' 87 | GROOT_ACCESS_TOKEN = ''" 88 | echo "$voz" > groot-voz/settings.py 89 | 90 | ##### SETUP MERCH ##### 91 | echo "* Setting up MERCH" 92 | merch_secrets="groot: 93 | access_key: '' 94 | host: 'http://groot-api-gateway:8000' 95 | 96 | merch_pi: 97 | access_key: 'INSERT_TOKEN_HERE' 98 | ip_address: 'INSERT_IPADDRESS' 99 | 100 | database: 101 | user: root 102 | password: root 103 | hostname: db 104 | name: groot_merch_service" 105 | echo "$merch_secrets" > groot-merch-service/config/secrets.yaml 106 | 107 | ##### SETUP QUOTES ##### 108 | echo "* Setting up QUOTES" 109 | quotes_secrets="groot: 110 | access_key: 'GROOT_ACCESS_KEY' 111 | host: 'http://groot-api-gateway:8000' 112 | 113 | database: 114 | user: root 115 | password: root 116 | hostname: db 117 | name: groot_quote_service" 118 | 119 | echo "$quotes_secrets" > groot-quotes-service/config/secrets.yaml 120 | 121 | ##### SETUP RECRUITERS ##### 122 | echo "* Setting up RECRUITERS" 123 | recruiters_secrets="aws: 124 | access_key_id: '' 125 | secret_access_key: '' 126 | 127 | groot: 128 | access_key: 'GROOT_ACCESS_KEY' 129 | host: 'http://groot-api-gateway:8000' 130 | 131 | jwt: 132 | secret: 'SECRET_JWT_TOKEN' 133 | 134 | database: 135 | user: root 136 | password: root 137 | hostname: db 138 | name: groot_recruiter_service 139 | 140 | test_database: 141 | user: root 142 | password: root 143 | hostname: db 144 | name: groot_recruiter_service_test" 145 | 146 | echo "$recruiters_secrets" > groot-recruiters-service/config/secrets.yaml 147 | 148 | ##### SETUP USERS ##### 149 | echo "* Setting up USERS" 150 | users_secrets="groot: 151 | access_key: 'GROOT_ACCESS_KEY' 152 | host: 'http://groot-api-gateway:8000' 153 | 154 | database: 155 | user: root 156 | password: root 157 | hostname: db 158 | name: groot_user_service" 159 | echo "$users_secrets" > groot-users-service/config/secrets.yaml 160 | 161 | ##### SETUP DESKTOP ##### 162 | echo "* Setting up DESKTOP" 163 | desktop="SESSION_TOKEN=INSERT_TOKEN_HERE 164 | STRIPE_PUBLISHABLE_KEY=CHANGEME 165 | SERVICES_URL=http://groot-api-gateway:8000" 166 | echo "$desktop" > groot-desktop-frontend/.env 167 | 168 | ##### SETUP EVENTS ##### 169 | echo "* Setting up EVENTS" 170 | events="FACEBOOK_ACCESS_TOKEN=INSERT_TOKEN_HERE 171 | FACEBOOK_ACM_PAGE_ID=INSERT_PAGE_ID_HERE" 172 | echo "$events" > groot-events-service/.env 173 | 174 | ##### SETUP GROOT ##### 175 | echo "* Setting up GROOT" 176 | groot_config="package config 177 | 178 | import ( 179 | \"github.com/acm-uiuc/arbor/proxy\" 180 | \"github.com/acm-uiuc/arbor/security\" 181 | ) 182 | 183 | const AuthPrefix = \"Basic \" 184 | const AuthURL string = \"http://groot-auth-stub-service:8008\" 185 | const AuthToken string = \"\" 186 | 187 | //Service hosts 188 | const CreditsURL = \"http://groot-credits-service:8765\" 189 | const EventsURL = \"http://groot-events-service:8002\" 190 | const GigsURL = \"http://groot-gigs-service:8964\" 191 | const GroupsURL = \"http://groot-groups-service:9001\" 192 | const HardwareURL = \"http://groot:4523/api/v1.0\" 193 | const MemesURL = \"http://groot-meme-service:42069\" 194 | const MerchURL = \"http://groot-merch-service:6969\" 195 | const NotificationURL = \"http://groot-notification-service:1122\" 196 | const QuotesURL = \"http://groot-quotes-service:9494\" 197 | const RecruiterURL = \"http://groot-recruiters-service:4567\" 198 | const RequestURL = \"http://groot-request-service:5656\" 199 | const UsersURL = \"http://groot-users-service:8001\" 200 | 201 | //Arbor configurations 202 | func LoadArborConfig() { 203 | security.AccessLogLocation = \"/var/groot-api-gateway/access.log\" 204 | security.ClientRegistryLocation = \"/var/groot-api-gateway/clients.db\" 205 | proxy.AccessControlPolicy = \"*\" 206 | }" 207 | echo "$groot_config" > groot-api-gateway/config/config.go 208 | -------------------------------------------------------------------------------- /scripts/prod_spinup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Change directory to root groot directory 4 | scriptsdir=`dirname $0` 5 | cd "$scriptsdir/.." 6 | 7 | mkdir -p log/prod 8 | 9 | # Groot API 10 | ./groot-api-gateway/build.sh 11 | cp groot-api-gateway/build/groot-api-gateway build/groot-api-gateway 12 | 13 | # Groot Users Service 14 | cd groot-users-service 15 | bundle install 16 | cd .. 17 | 18 | # Groot Groups Service 19 | cd groot-groups-service 20 | npm install 21 | cd .. 22 | 23 | # Groot Desktop Frontend 24 | cd groot-desktop-frontend 25 | npm install 26 | npm run build 27 | cd .. 28 | 29 | # Groot Events Service 30 | cd groot-events-service 31 | npm install 32 | cd .. 33 | 34 | # Groot Recruiters Service 35 | cd groot-recruiters-service 36 | bundle install 37 | cd .. 38 | 39 | # Groot Quotes Service 40 | cd groot-quotes-service 41 | bundle install 42 | cd .. 43 | 44 | # Groot Merch Service 45 | cd groot-merch-service 46 | bundle install 47 | cd .. 48 | 49 | # Groot Meme Service 50 | cd groot-meme-service 51 | pip install -r requirements.txt --user 52 | export MEME_DEBUG=false 53 | cd .. 54 | 55 | # Groot Credits Service 56 | cd groot-credits-service 57 | pip install -r requirements.txt --user 58 | export CREDITS_DEBUG=false 59 | cd .. 60 | 61 | # Groot Gigs Service 62 | cd groot-gigs-service 63 | pip install -r requirements.txt --user 64 | cd .. 65 | 66 | # Groot Voz 67 | cd groot-credits-service 68 | pip install -r requirements.txt --user 69 | export VOZ_DEBUG=false 70 | cd .. 71 | 72 | # Set Production Env Vars 73 | export NODE_ENV="production" 74 | export RACK_ENV="production" 75 | 76 | trap 'kill %1; kill %2; kill %3; kill %4; kill %5; kill %6; kill %7; kill %8; kill %9; kill %10; kill %11; kill %12' SIGINT 77 | 78 | forever -f -c ruby groot-users-service/app.rb | tee log/prod/groot-users-service.log \ 79 | & forever -f groot-groups-service/server.js | tee log/prod/groot-groups-service.log \ 80 | & forever -f groot-desktop-frontend/server.js | tee log/prod/groot-desktop-frontend.log \ 81 | & forever -f groot-events-service/server.js | tee log/prod/groot-events-service.log \ 82 | & forever -f -c ruby groot-recruiters-service/app.rb | tee log/prod/groot-recruiters-service.log \ 83 | & forever -f -c ruby groot-quotes-service/app.rb | tee log/prod/groot-quotes-service.log \ 84 | & forever -f -c ruby groot-merch-service/app.rb | tee log/prod/groot-merch-service.log \ 85 | & forever -f -c python groot-meme-service/app.py | tee log/prod/groot-meme-service.log \ 86 | & forever -f -c python groot-credits-service/app.py | tee log/prod/groot-credits-service.log \ 87 | & forever -f -c python groot-gigs-service/app.py | tee log/prod/groot-gigs-service.log \ 88 | & forever -f -c python groot-voz/app.py | tee log/prod/groot-voz.log \ 89 | & ./build/groot-api-gateway | tee log/prod/groot-api-gateway.log 90 | --------------------------------------------------------------------------------