2019-06-20 20:48:19 +02:00
# README
2020-05-18 16:52:28 +02:00
## First-time setup
Install dependencies with `bundle install` and `yarn --cwd client install` (or enter client directory and execute `yarn install` )
Build docker image with `docker build -t roraccounting .`
2020-09-04 07:46:17 +03:00
2020-05-18 11:35:34 +02:00
## Running
2020-09-04 07:46:17 +03:00
2020-05-18 16:52:28 +02:00
Start docker container with Postgres DB (if not already running) : `yarn run dev-db` or
`docker run --name gangstadb -d -p 5432:5432 -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=roraccounting_development roraccounting`
2020-09-04 07:46:17 +03:00
Start backend server : `BASIC_AUTH_USERNAME=user BASIC_AUTH_PASSWORD=pass yarn run server` or `BASIC_AUTH_USERNAME=user BASIC_AUTH_PASSWORD=pass PORT=3001 bundle exec rails s`
2020-05-18 16:52:28 +02:00
Start frontend with : `yarn run client` or `PORT=3000 yarn --cwd client start`
2020-09-04 07:46:17 +03:00
### Note about authentication
Authentication is currently basic auth, note ENV variables in starting backend server commands! At the moment, loading
from .ENV file is not supported
## Heroku Deploy Procedure
2020-09-04 08:14:50 +03:00
1. Login to Heroku with : `heroku login`
2020-09-04 07:46:17 +03:00
2020-09-04 08:14:50 +03:00
2. Create new heroku app from local repository with : `heroku create app-name-here`
3. Head to the settings tab of the new Heroku app. Under the `Buildpacks` click on `Add buildpack` button and select `nodejs` and `ruby` . Click `Save changes`
Reorder buildpacks so that `heroku/nodejs` is first.
4. Add `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` ENV variables to the Heroku (settings tab)
5. Push repository to the Heroku with : `git push heroku master`
2020-09-04 07:46:17 +03:00
(For testing purposes)
Deploy non-master branch from local repository to the heroku : `git push heroku other-branch:master`