GetGrinnected is an iOS and Android app designed to help Grinnell students find out and attend events on and around Grinnell campus. You can sign in with your Grinnell email, favorite and follow events, and search for events that interest you.
This repository is a working, and live document, meaning that any challenges we encounter can be solved through changing these meta-rules and technical decisions (i.e. changing the database that we are using to better fit our needs). Our tools: We use google docs as a staging area for many of these textual descriptions of our product and ReadMe.md, Trello as our issue tracking tool, github for our git repository, and Discord as our means of communication.
The structure of our Repository is as follows:
written reports/- Markdown write-ups for class milestonesrequirements.md- Living requirements documentsprint #/- directory containing writeups for a specific sprintagile-planning.md- Agile planning (goal: name planned outcomes)agile-review.md- Agile review (goal: show what has been completed)sprint-journal.md- Sprint journal (goal: store written work not belonging to an agile component)
LICENSE- MIT license for all content in the repoREADME.md- The file you're reading, explaining the repo
src/- Directory for all codeandroid- Kotlin (front-end)ios- Swift (front-end)backend- Node.js (back-end)
package.jsonandpackage-lock.json- npm packages and lockfileimage-utils- images/visual elements app will use
mkdocs.yml- MKDocs configuration filedocs/- Documentation pages
test procedures/- Manual test procedures we are keeping.[COMPONENT].md- Test procedure to run for a particular COMPONENT.
These guidelines are here to make development easier and make sure we meet class requirements and standards.
We follow a feature branching pattern in this repo. These are the basics of the flow.
- Change to the main branch, and pull any new changes.
- Create a new branch for your feature. It should be named according to the pattern
<NAME>/<FEATURE>, such asalmond/deploy-api. - Work on that branch, committing and pushing as needed.
- When you are done with your feature, create a Pull Request to merge it into main. You will need approval to merge.
When you create a pull request modifying code files, it will trigger one or more CI pipelines in order to run unit tests.
Pipelines will be run based on which code files you modify. For instance, if you edit files under
src/ios/only Swift tests will be run, but if you edit bothsrc/ios/andsrc/backend/both Swift and Node.js tests will be run.
Pipelines run when pushing to any branch.
Additionally, docs have Continuous Deployment (CD) on merge into main. No other CD exists at this time.
You are expected to add unit tests where relevant to your code. Review to the sections below for instructions on adding tests for each language used.
Add tests to a file named matching the class you are testing. For instance, to test the class com.example.getgrinnected which has its class file located at the path app/src/main/java/com/example/getgrinnected/MainActivity.kt you would create a new test under the path app/src/test/java/com/example/getgrinnected/MainActivityTest.kt.
In Android Studio, if you right-click a function name you can choose "Generate > Test" in the menu that it brings up. Default settings should work, but do make sure the test gets generated in the right location.
Add tests under the test directory in a .js or .mjs file as preferred. Note that some official resources such as https://nodejs.org/en/learn/test-runner/using-test-runner use .mjs files.
There should be exactly one test file per code file, and the naming should be test_COMPONENT. For instance, api.js is tested by test/test_api.js.
When it makes sense to do so, create test suites to group tests by using describe imported from node:test.
Add a new test bundle by going to file > new > target and then searching "test". You will then select Unit Testing Bundle and choose Swift as the language and Swift Testing as the testing system. Set your other settings how you want and click finish. Now go to your test file and import your project.
Now you can add tests to your testing file using this site https://developer.apple.com/documentation/testing/definingtests as documentation.
This is an example of a good commit message.
Implement a basic homescreen in Swift
Currently, the only buttons on the homescreen are "calendar" and
"favorites", and they only go to blank pages.
Here are features you should follow in your commit messages.
- First line is a short, easily readable description. Try to keep it below 50 characters.
- First line uses imperative mode ("Implement", as compared to "Implementing" or "Implements")
- It may be helpful to think of this as answering the question "What does this commit do?"
- Any other necessary description is written below, separated by one line. (optional)
Make sure to follow style guidelines relevant to the code you are writing. Style will be reviewed as part of the merge process.
Kotlin:
- https://developer.android.com/kotlin/style-guide
- We chose this guideline because it was understandable and well formatted. We will hold each other accountable to these guidelines by reviewing each other's code and commenting when others make a mistake. We will hold ourselves responsible by individually reading the guidelines and trying to follow them to the best of our ability.
Swift:
- https://google.github.io/swift/
- We chose this guideline because it was understandable and well formatted. We will hold each other accountable to these guidelines by reviewing each other's code and commenting when others make a mistake. We will hold ourselves responsible by individually reading the guidelines and trying to follow them to the best of our ability.
Node:
- https://github.com/felixge/node-style-guide
- We chose this guideline because it was understandable and well formatted. We will hold each other accountable to these guidelines by reviewing each other's code and commenting when others make a mistake. We will hold ourselves responsible by individually reading the guidelines and trying to follow them to the best of our ability.
We use Android Studio for this.
Android Studio doesn't distinguish between building and running code. See the running section below.
We use Xcode for this.
Xcode will build and run in one step. See the running section below.
-
Clone this repo.
-
Install Node.js and NPM, the latest LTS versions of each. https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
-
In the terminal,
cdinto the repo and runnpm cito install all packages we depend on.
This builds all dependencies of the backend.
-
In Android Studio, select the drop down for build type.
-
Switch the build type to "All Tests."
-
Click the green run button.
Or, run from (mostly) the command line using Gradle.
-
In Android Studio, run something (e.g. tests, app) on a virtual device so that it sets up the virtual device.
-
Do not close Android Studio, but open a terminal in the repo.
-
Change directories to
src/android/GetGrinnected/MyApplication. -
Run
./gradlew connectedCheck.
-
In Xcode, click the Product drop down menu.
-
In the drop down menu click Test.
- From the top level of the repo, run
npm test.
All Kotlin code is currently built and run from Android Studio.
Follow these steps to build and run Android code.
-
Install Android Studio on your device: https://developer.android.com/studio/install
-
Open the
src/android/GetGrinnected/MyApplicationdirectory as a project in Android Studio. -
Set up a device to build for.
- Physical device: https://developer.android.com/studio/run/device
- Virtual device: https://developer.android.com/studio/run/managing-avds
-
On the top bar of Android studio, select the correct device to build for.
-
To the right of the device selector, make sure the dropdown menu for build job is set to 'My_Application.app'.
-
Click the green Run or Play button. When the code is built, it will automatically open the app on the selected device.
All Swift code is currently built and run from Xcode.
Follow these steps to build and run Android code.
-
Search for Xcode in the Apple app store on an apple computer and install it.
-
Open Xcode and click "Open Existing Project...". Open the
src/ios/GetGrinnecteddirectory as a project. -
If any files are missing from your Xcode UI, drag them in from the finder.
-
Install the simulator for iOS 17.5 by following these steps:
-
Window > Devices and Simulators
-
Press the + in the bottom left corner.
-
OS Version > Download more simulator runtimes
-
Press the + in the bottom left corner.
-
Look for iOS 17.5 and install it.
-
Create a new simulator using iOS 17.5.
-
-
Click on the device that is shown in the middle of the top of the Xcode window and switch it to your new simulator.
-
Product > Run
All of these run on a dedicated server, but you could technically run them locally from a computer you have administrative access to.
These instructions are written for a linux machine, but they may work on Mac. It is not reasonable for us to write instructions to run on any non-Linux operating system.
You should already have access to Reclaim Cloud, so you can use our database.
You can find the login details from the environment file used to run the database connector. This is how to access that file.
-
Log into Reclaim Cloud.
-
Open the project titled "GetGrinnected" with the subtitle "csc324--spring2025.us.reclaim.cloud"
-
Hover over the "Application Servers" area. A "Web SSH" icon should appear that is a small black terminal with green text reading
>_. Click that icon. -
In the terminal it opens, run
cd ROOT. -
Next, run
less .envto open the environment file. -
Note the lines that start with
MYSQL_. -
Use these details for your database connection, or copy the entire
.envfile to the same path in the repo you clone to run our code.
-
Set up a MySQL server with version 9.2.0.
-
Log into the server as a user that can create new databases.
-
In the mysql prompt, source the file to create the tables. Here, the path is given starting at the top level of the repository.
mysql> source src/backend/Database/GetGrinnectedDB.sql -
Create a
.envfile at the top level of the repo that has the following contents, according to the dotenv description at https://www.npmjs.com/package/dotenv.MYSQL_HOST- hostname of the system the MySQL server is running on.MYSQL_USER- user to authenticate asMYSQL_PASSWORD- that user's password.MYSQL_DATABASE- database name, GetGrinnected.
-
Optionally, the
.envfile can have the following options to allow the API to run on HTTPS with proper SSL certificates.HTTPS_PORT- the port to attempt to host HTTPS over. for port 443, node must be run withsudo.HTTP_PORT- the port to attempt to host HTTP over. for port 80, node must be run withsudo.SSL_KEY- private key for a valid SSL cert.SSL_CA- CA certificate for a valid SSL cert.SSL_CERT- Certificate for a valid SSL cert.
-
Set up a cron job that will run the correct script daily. This is what to put in the crontab, replacing the daily events path with an absolute path.
5 5 * * * /usr/bin/bash /PATH/TO/update_daily_events.sh -
Run the script manually in order to kickstart the database with events. This path is given with respect to the top of the repository.
/usr/bin/bash /PATH/TO/update_daily_events.sh
-
Run the API in a terminal. From the top of the repository, run:
node src/backend/api/api.cjs -
It announces what ports the API is running on. By default it will run HTTP on port 8080 and HTTPS on port 4443, unless otherwise specified in the .env file or environment variables.
Our issue manager is Trello. See our Trello board at https://trello.com/b/pAnl7SQ3/getgrinnected.
- Use Case 1 (Sign Up): Fully operational, changed from old version that required a password.
- Use Case 2 (Add Event): Removed from product.
- Use Case 3 (Find Event): Fully operational.
- Use Case 4 (Follow Organization): Removed from product.
- Use Case 5 (Follow-up on Event): Removed from product.
- Use Case 6 (Adding a New Account): Removed from product.