Ruby on rails Application utilizing the new york times developers API
This is are instructions on setting up your project locally. To get a local copy up and running follow these simple steps.
Kindly read the "Task Documentation.pdf" file present at the root folder of this repository, to get a good view of everything.
-
Ruby . Version used "ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]"
-
Ruby on rails . Version used "Rails 7.0.4"
- Clone master git repo
git clone https://github.com/kinyodan/danbooks.git
- cd into directory and run
bundle install
(if all is well it should be done and installed )
-
Run Migrations
rake db:migrate
-
Run below command to create the config/application.yml file where ENV variables will be added in this case the API keys
bundle exec figaro install
-
Copy the contents of the file config/loaded_application.yml(found inside the config folder) into the generated application.yml file also inside the config folder
-
Start rails server
rails s
must have docker installed https://docs.docker.com/get-docker/
-
cd into the root of the cloned repository if not already there and run below command to create the config/application.yml file where ENV variables will be added in this case the API keys
bundle exec figaro install
-
Copy the contents of the file config/loaded_application.yml(found inside the config folder) into the generated application.yml file also inside the config folder
-
Run below command
docker-compose run web rake db:create
-
Then and run below command
docker compose up
This should run docker composer and start the rails server and application will be available at localhost:3000 when process is complete.
To run test you need to have the following installed
- Rspec
- You have run bundle install to install gems
bundle install
- Run Migrations
rake db:migrate
- to run test run below commands separately on the command line so as to run the full set of tests for full test coverage
rspec
rails test
(if all is well it should be done and running )