Features:
- JSON API (+ Swagger)
- Background job processing (+ Sidekiq Web App)
- Database handling
- Ruby v2.4.1
- PostgreSQL v9.5.14
- Redis 3.0
-
Make sure you can connect to PostgreSQL. At least
CREATE TABLE
priveleges are required. -
Clone repo
$ git clone [email protected]:bfoofoo/bunny-foo-foo-content.git
-
Copy and edit database config and environment variables
$ cp config/database.yml.example config/database.yml $ cp .env.example .env
Tip: to change database name, edit this value in
.env
:DB_NAME='foo'
-
Install gems
$ bundle install --without-production
-
Obtain & set up database
- Create databases
$ rails db:create:all
- Download latest production database dump from server, e.g.
unpack it anywhere you like
$ scp [email protected]:dumps/production_backup/<CURRENT DATE>/production_backup.tar ~/
$ tar xopf production_backup.tar
- Import the to PostgreSQL
$ psql -d bffadmin_development -U youruser < /path/to/dump.sql
- Run migrations
$ rails db:migrate
Tip: optionaly, you can skip steps ii. and iii. and start with a blank database, in that case run
$ rails db:seed
after last step.
- Create databases
-
To launch app, run:
$ rails s
You can access api now with base URL
http://localhost:3000
To launch Sidekiq, run
$ sidekiq
To access Sidekiq web app, visit
http://localhost:3000/sidekiq
Tip: to run core app and admin panel simultaneously, be sure to launch admin panel on different port e.g.
$ rails s -p 3001
then access admin panel via
http://localhost:3001
-
Additionaly, you may wish to install Admin Panel to manage data, see README.md from that repo.
All models should be synchronized with Admin Panel. All migrations must be created and run at this repo.
$ cap production deploy