- Ruby (v. 2.6.3)
- Rails (v. 6.0.3.5)
- PostgreSQL
Clone the project using SSH or HTTPS.
git clone git@github.com:CMSgov/dpc-app.git
For HTTPS:
https://github.com/CMSgov/dpc-app.gitNote: This clones the whole DPC App including the Java API and the Ruby on Rails Web App.
- Change into the directory
dpc-app/dpc-admin gem install bundler --no-document- Run
bundle install - Run
npm install
Create a .env file in the root director.
Note: If you need to change the database configuration, it can be overridden using the DB_USER, DB_PASS, and DATABASE_URL environment variables. Example:
DB_USER=postgres
DB_PASS=password
DATABASE_URL=postgresql://localhost/dpc-website_development
You also need to set the Github ENV variables to enable Github OAuth login for internal users:
GITHUB_APP_ID=xxx
GITHUB_APP_SECRET=yyy
GITHUB_ORG_TEAM_ID=123
If you want to switch to the sandbox environment, add the ENV variable:
ENV=sandbox
The database is shared with the Ruby on Rails Web app (found in dpc-app/dpc-web). If you already set up the database for the web app, you will only need to run rake db:migrate. If you have not set up the database run: rails db:create db:migrate db:seed.
Once the database and credentials are set up, run rails s or rails server. The app should be live at http://localhost:3000/.
To run the Admin App and Web App simultaneously, follow the above instructions to spin up the Admin app. Then in another terminal window, redirect to dpc-app/dpc-web and follow the instructions for that application.
The Web app will automatically run on http://localhost:3500/.
To test the rails app, run rspec spec in the terminal.
Navigate to /dpc-app
DPC Admin: localhost:3000
Admin Letter Opener: localhost:3000/letter_opener
DPC Web: localhost:9000
Admin Letter Opener: localhost:3900/letter_opener
Port mappings can be changed in:
docker-compose.portals.yml
Helpful make commands:
make start-portals : Starts Web,Admin,Portal and db
make stop-portals : Stops Web,Admin,Portal and db
make down-portals : Removes Web,Admin,Portal, db and docker network.