Providing users with a measurable awareness of their environmental impact. Users can track daily habits and scan products to increase and improve their environmental score.
Javascript Style Convention: Prettier
View SonarCloud Project Dashboard
View Diagrams Here
The app involves two actors, one being a player(user) and the other being a clock. The player can perform various activities. They can login to the app and if they don't have an account they can create a new account. A player can also access their settings, add friends, enter usage stats which will also lead to the system to calculate the stats. They can create a new game, which in turn will start the game clock countdown and this is managed by the clock. Finally the player can scan the product barcode and in return view the environmental impact of it.
This diagram displays the process of creating, playing, and ending a game. Reading from top to bottom you can see the different decisions at each step and what happens after the user makes a decision on whether or not to perform a certain action. The diagram is pretty self-explanatory and easy to follow.
This diagram shows the basic workflow when adding usage data into SnapGreen. Several different statistics are updated including any games in progress.
This diagram is a rough draft that shows the interaction between the different main classes of the game. It also shows the different methods that perform the various actions within the app. It also highlights the dependencies between one class and another.
This diagram shows the interaction between the app, server, and database when a user tries to login. The app sends the login attempt information to the server and the server queries the database and recieves a response. The server then sends a response to the app based on whether the login attempt was valid, whether the user doesn't exist, or whether the password doesn't match.
Our team is utilizing Espresso and JUnit for Kotlin and Jest for JS testing.
View Acceptance Test Specification
View Android Unit / Integration Test Code
Our app utilizes Android Studio for front-end development and Node.js for the backend. View both
Android Studio Setup
- Install latest version of [Android Studio](https://developer.android.com/studio).
- Navigate to Tools > SDK Manager
- Download and Install Android 9.0 (Pie)
- Navigate to SDK Tools
- Download and Install Google Play Services
- Clone the repository
- Go to File > Open and select the "Client" folder from the repository.
- Wait for import and gradle sync to complete.
- If prompted, download and install the latest versions of both gradle and kotlin (may not be neccessary)
- Download the GoogleServices.json from the Firebase console.
- Place the JSON in the "app" directory
- Connect an android phone with developer mode activated and USB debugging turned on
OR Navigate to Tools > AVD Manager Select Create Virtual Device Select Pixel 3 > Pie > Finish
- Click on the play button on the top of Android Studio to build and run the app!
Node Server Setup
We recommend enabling WSL (Windows Subsystem for Linux) first--while it is possible to install these programs on Windows without doing so, the server will ultimately be hosted in a Linux environment and therefore will be expressed with Linux commands. When choosing a "flavor" of Linux to install, choose "Ubuntu 18.04 LTS" from the Microsoft store--certain commands vary depending on which variety of Linux you choose, and for this we are going with Ubuntu (for now).
How to install/enable WSL on Windows 10
Once WSL has been installed/enabled, you can start it by going to any folder in explorer, clicking in the box showing your location (e.g. "This PC > Local Disk (C:) > Users...," just above the folder contents), then typing "wsl" and hitting enter. That will put you into the Linux command line.
sudo apt update
sudo apt install nodejs
nodejs -v
sudo apt install npm
npm -v
npm install express
First, you need to install XCode (from the Apple App Store), and Homebrew (Apple's package manager for Mac). All following commands should be entered into the terminal:
ruby -e "$(curl -fsSl https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install node
node -v
npm -v
brew upgrade
brew upgrade node
node -v
npm -v
If you've installed via WSL, follow the Linux instructions below from the linux command line. Otherwise, uninstall programs as you normally would.
sudo apt remove nodejs
sudo apt purge nodejs
sudo apt autoremove
brew uninstall node
husky: Allows for pre-commits hooks (Used to run prettier styling for every JS commit) jest: Testing framework for JS nodemon: Utilized to have the server refresh automatically with every change prettier: Automatic code formatting for every JS commit
Running the server is as simple as two commands
npm install
npm run serve
You may get a warning from your firewall--go ahead and let it slide. Your terminal should announce that the server is running. Open up a browser window, and go to "localhost:8080". You should see a blank page with a button at the bottom; you should also see a message in the terminal that states "user connected." Try clicking on the button--you will see repeated messages.