Backend API for a fintech money management application.
The frontend can be found at: https://github.com/sreilly64/js-moneymanagement-frontend
- Clone project and navigate to root directory where the project was cloned.
mkdir /Users/$(your_username)/Dev/
cd /Users/$(your-username)/Dev/
git clone https://github.com/sreilly64/js-moneymanagement-backend.git
cd js-moneymanagement-backend
- Ensure Postgres database is running.
psql
# CREATE DATABABASE jsmoney
- Build and test.
./mvnw clean package
- Run project locally.
export DB_URL=jdbc:postgresql://localhost:5432/jsmoney
export DB_UN=postgres
export DB_PW=password
./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=cloud"
- Create heroku account
- Download heroku cli and follow instructions on the page.
- Create database service.
- Connect to DB from local client (optional).
User the cli to create your cloud application
cd ~/js-moneymanagement-backend
$ heroku create
Create a PostgreSQL database
heroku addons:create heroku-postgresql
Login to https://data.heroku.com/ to view your cloud database. From there, select your database, navigate to the "Settings" tab and acquire your database credentials: connection URL, username, and password.
Use the credentials from the "Add a cloud database" section, to create a database connection using your favorite client.
- Login to heroku cli
$ heroku login
- From the project's root directory, issue the command to push the applications.
$ git push heroku master
- Set environment variables.
Set environment variables using the following format:
cf set-env APP_NAME ENV_VAR_NAME ENV_VAR_VALUE
heroku config:set DB_UN=<actual_user_name>
heroku config:set DB_PW=<actual_password>
heroku config:set DB_URL=<actual_url>
- Start application.
web npm start
- Tail logs
heroku logs -t
- Validate app status
heroku apps:info
- ssh into container
heroku run bash -a <APPNAME>