To log in to postgres user:
sudo su postgres
Type your sudo password
.
To create a database user for the project:
createuser -P -s airsoft
Type CHANGE-ME
.
Change back to your normal user:
exit
To setup the database:
rails db:setup
Other useful commands are rails db:create
, db:migrate
, db:seed
and db:reset
.
To compile the contents of app/javascript
:
bin/webpack
To run compile server:
bin/webpack-dev-server
These are necessary when you change some JS or CSS that are bundled to the app.
Create the persistent database volume:
docker volume create --name=airsoft_database`
Run only database container:
docker-compose up --build
Use the -d
switch to run it detached in the background.
The database is accessible on port 5433
, so you must update the port in config/database.yml
.
After creating the database container you have to set up the database from the console.
Create an Outh Client at https://auth.sch.bme.hu with the follwing callback url:
http://localhost:3000/users/auth/authsch/callback
Run rails credentials editor
rails credentials:edit --environment development
or if it complains about default editor not being set
EDITOR=nano rails credentials:edit --environment development
copy the following yaml, and replace with OAuth credentials
authsch:
api_key: <authsch client id>
secret: <authsch secret>
and then save the file. It will generate a key and encrypted crededentials file. These should be ommited from git commits.
The project uses rubocop to enforce good quality code. On the local machine you can run rubocop to detect mistakes with
rubocop
And you can automatically fix minor mistakes with
rubocop -a
- Front page background image by Michael Mráz on Unsplash.
- Default post thumbnail image by Daniel Stuben on Unsplash.