Make sure you have the following installed on your system:
- Ruby version 3.1.2
- Bundler
- Clone the repository:
git clone git@github.com:yaroslavrick/small_api_wraper.git
- Move into the project directory:
cd simple-api-wrapper
- Install dependencies using Bundler:
bundle install
- Create .env and .database.yml file from examples and update the values:
cp .env.example .env
cp config/database.example.yml config/database.yml
- Setup Docker services (PostgreSQL and Redis):
docker-compose up
Ensure that the ports configured in .env
do not conflict with your running services.
- Create the database:
bundle exec rails db:create
- Run database migrations:
bundle exec rails db:migrate
- (Optional) Run seed data to create some sample data:
bundle exec rails db:seed
To start the app, run the following command:
bin/dev
Once the server is running, open your web browser and go to http://localhost:3000 to access the app.
ruby my_program.rb new --type education --participants 1 --price_min 0.1 --price_max 30 --accessibility_min 0.1 --accessibility_max 0.5
ruby my_program.rb list
Make sure you have local server running to have console app working.
To run the test suite, use the following command:
bundle exec rspec