The Berkeley ReEntry Student Program is an application developed by UC Berkeley's CS169L students for the ReEntry Program at UC Berkeley. The application provides an easy-to-use interface for ReEntry students to sign-up for and use resources provided by UC Berkeley's ReEntry program.
Working
- Community space check-in
- Appointments
- Scholarships
- Courses
- Events
This repo is forked from https://github.com/saasbook/berkeley-reentry-student-program
https://sp25-03-reentry-181cb67be4ca.herokuapp.com/
https://reentry-student-program-b0fde1ef8035.herokuapp.com/
- Clone the repository locally and then make your own branch!!
- Install Ruby version 3.2.7 and switch to that version
- For rvm:
rvm install 3.2.7
rvm use 3.2.7
- For rvm:
- You must have PostgreSQL installed locally to run the rails server.
- For Mac:
- Install PostgreSQL:
brew install postgresql
- Start PostgreSQL server:
brew services start postgresql
- Install PostgreSQL:
- For Windows:
- Install PostgreSQL: download installer from postgresql.org
- Start PostgreSQL server:
pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" start
- For Linux:
- Install PostgreSQL:
sudo apt install postgresql postgresql-contrib
- Start PostgreSQL server:
sudo service postgresql start
- Install PostgreSQL:
- For Mac:
- Install the dependencies using bundle
bundle config set --local without 'production'
bundle install
- Setup the database
rake db:create && rake db:schema:load && rake db:migrate && rake db:seed
- Follow these instructions to create & setup a new Heroku app on the CLI
- Add database to the Heroku app.
- Go to the Resources page of your Heroku app.
- Add Heroku Postgres as an add-on service.
Our code requires 4 environment variables to work correctly in production & local environments.
Local Development: You must set a non-empty string for the environment variables ADMIN
, STAFF
, GOOGLE_CLIENT_ID
, and GOOGLE_CLIENT_SECRET
- For Mac and Linux: With Terminal open, run
open ~/.bash_profile
- Note: If you are using a different shell, add the following exports to the appropriate shell profile e.g. for zsh, run
open ~/.zshrc
- At the bottom of the text file, add the following:
export ADMINS=string
&export STAFF=string
where string is a comma-separated list of Berkeley email addresses (these do not have to be real); i.e.person@berkeley.edu,person2@berkeley.edu
- Additionally, add
export GOOGLE_CLIENT_ID=some_value
&export GOOGLE_CLIENT_SECRET=some_value
where some_value is some arbitrary string (these do not need to be valid to run the app locally, since google authentication is stubbed-out unless it is run on production).
- Note: If you are using a different shell, add the following exports to the appropriate shell profile e.g. for zsh, run
- For Windows: follow these instructions to set environment variables
- Set
ADMINS
&STAFF
, where the value of each is a comma-separated list of Berkeley email addresses (these do not have to be real); i.e.person@berkeley.edu,person2@berkeley.edu
. - Set
GOOGLE_CLIENT_ID
&GOOGLE_CLIENT_SECRET
to some arbitrary string (these do not need to be valid to run the app locally, since google authentication is stubbed-out unless it is run on production).
- Set
For Production: Add the ADMIN
, STAFF
, GOOGLE_CLIENT_ID
, and GOOGLE_CLIENT_SECRET
environment variables to Heroku via the command line (assuming there is a Heroku app set up in your directory)
- Follow these instructions (web app) to obtain a google client secret & a google client ID. For the callback URL, use https://your-app-name.herokuapp.com/auth/google_oauth2/
- Use the command
heroku config:set VARIABLE=value
to set the environment variables. - Add
ADMINS
&STAFF
set to a comma-separated list of verified administrators and staff members for the app. For testing purposes, these variables can both be set to the string”none”
- Add
GOOGLE_CLIENT_SECRET
&GOOGLE_CLIENT_ID
as provided by the instructions above. - Note: The environment variables can be manually entered in the Heroku app's Settings under "Config Vars".
- Attach "Heroku Postgres" as an add-on to the Heroku app's Resource tab.
- Using a terminal, run
heroku run rake db:schema:load
andheroku run rake db:migrate
to load the database.- Note: If you do not have command-line access to run these commands, you can run rake commands directly in the Heroku app's console.
In order for the GitHub Actions build to pass, you must add a CC_TEST_REPORTER_ID
as a repository secret on GitHub. To do this, first sign up for an account with codeclimate.com (quality, not velocity). Then, connect your repository and navigate to repo settings on the CodeClimate dashboard. Finally, copy the test reporter ID
under the test coverage tab, and add it as a new repository secret under repository settings on GitHub.
RuboCop is a Ruby code style checker (linter) and formatter.
- You can run
rubocop -a
to make safe fixes andrubocop -A
to make unsafe auto-refactors. - You can also run
rubocop --auto-gen-config
to configure some finer settings.
New Relic APM is a monitoring service that monitors your apps performance. You can add the monitoring service on Heroku by going to the Resources page of your Heroku app.
The app relies on Canvas/Bcourse to authenticate users. If you are testing the authentication in a sandbox Canvas environment, you must have access to the sandbox environment to be able to authenticate. Request access to the sandbox environment from the professors.
Authentication
The Canvas URL and redirect URI are stored in the config/credentials.yml.enc
file. If you click on the Login with Canvas
button on the homepage and cancel the authentication, you will be redirected to the redirect URI stored in the config/credentials.yml.enc
file. For local testing, use the mock login instead and do not use the Login with Canvas
button.
Mock Login/Authentication
To make the mock authentication for Canvas visible and usable, add the following to your terminal profile to create a local environment variable:
export MOCK_CANVAS_LOGIN=true
Setting the environment variable to false will disable the mock login. Be sure to not set this environment variable to true in the production environment.
Spring 2025