tested with docker version 1.13.0 and docker-compose version 1.10.0
- Install docker and docker compose - https://docs.docker.com/compose/install/
- Run the services:
cd Code
docker-compose up -d
docker-compose exec backend rails db:setup
- Open http://localhost:4000
- Use one of the following email, users have same password:
password
- For development
cd Code
docker-compose -f docker-compose.dev.yml up -d # run in development environment
docker-compose exec backend rails db:setup
docker-compose exec backend rails spec spinach
- 2.3.1
- Mysql version 5.7
- Elasticsearch version 2.4
-
Mysql
- use
root
andempty password
or override inconfig/database.yml
- in
production
environment set env variableDATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
- use
-
Elasticsearch
- should be run on
localhost:9200
- in
production
environment set env variableES_HOST="host:port"
- should be run on
- Setup database
cd Code/backend
rails db:environment:set RAILS_ENV=development
rails db:setup # creates database, load schema and seed data
- Install gems
bundle install
- Run test suite (must pass)
rails spec # Unit tests
rails spinach # Feature tests
- Run server on port 3000
rails s
- 7.4
- Install packages
cd Code/frontend
npm install
- Run lint and test suite (must pass)
npm run deploy:dev
- Run dev server
npm run dev
-
Open the app - http://localhost:4000
-
For development
cd Code
docker-compose -f docker-compose.dev.yml up -d # run in development environment
docker-compose exec frontend npm run test
docker-compose exec frontend npm run lint
- unit tests (rspec) - 30.29%
- integration tests (spinach) - 96.83%
- unit tests
Statements : 48.32% ( 274/567 )
Branches : 36.41% ( 79/217 )
Functions : 34.23% ( 89/260 )
Lines : 50.48% ( 265/525 )