Development
.env file
To get started, you need a .env
file with secrets. A script is provided to generate this file with new secrets:
If the script succeeds, it will print ".env file generation complete."
Development mode
To use development mode, activate the docker-compose override file:
Booting up
If you have Docker on your machine, run:
It can then be accessed at http://localhost:3000/
API Documentation
The Swagger docs are generated from the RSpec tests in spec/controllers/api
To rebuild the swagger docs:
Licenses
You can check the licenses of unaccepted dependencies using:
To add accepted licenses:
Specs
To run Rubocop, and listen for file changes:
Just press enter to run the whole test suite straight away.
To view and interact with a visible Chrome browser in feature tests, uncomment this line in rails_helper.rb
:
This exposes a VNC server on port 5900
. You can access it on MacOS with:
The password is 'secret'. Run a feature spec with that window open and you should see the test running.
Note: feature specs should be run from app shell, so connect first:
Code Coverage
After running the test suite, open the coverage/index.html file in a web browser to check what code is covered by the tests.
Debugging
To access a 'binding.pry' debugging point, run with:
Model Annotation
To annotate rails models with schema run
Accessing the database console
To access the MySQL database console:
Stop
Stop containers but do not remove them:
Stop containers and remove them:
Profiling performance
To print a report of time, memory and database calls:
Resolving issues
On first run new file is created:
script/first_run_complete.tmp
In some cases deleting it may help with resolving your running issues.
Caching
You can view keys in the Redis cache from the console with:
or
Documentation
The documentation can be found in the /docs
directory. When Docker is running the documentation site
is served locally at http://localhost:3002/murfin_method. Any changes made
in the /docs
directory will be immediately visible.
We also serve the documentation online at https://sardjv.github.io/murfin_method/.
To deploy changes to this site:
It may take a few minutes to update.