This web application allows a patient who arrives at a clinic select which treatment they want to receive.
It also permits admin to provide translations (into French or Malagasy) of the treatment names.
Framework used: Ruby on Rails
Database: sqlite3
The following tools need to be installed:
- Ruby [2.5.1]
- Rails [4.2.10]
git clone https://github.com/VolatianaYuliana/rails-project
and then enter the project directory
cd rails-project
And run the following commands to install the dependencies:
bundle install
rake db:create db:migrate
I have already added treatments in the /db/seeds.rb file with the treaments list you provided. Run the following command to seed the databasa with those treatments:
rake db:seed
But if you want to seed it with your own initial data, do the following steps:
- add your initial data in the /db/seeds.rb file.
- run the command:
rake database:repopulate
You can start the rails server using the following command:
rails s -p 4001
And now you can visit the site with the URL http://localhost:4001
Add the data in the /db/seeds.rb.
I created a cron that repopulates the database monthly. If you want to modify the period according to your need, modify the file /config/schedule.rb.
Visit the URL http://localhost:4001/admin and log in to provide translations of the treatments using the following credentials:
- login: admin
- password: admin
Treatments translated will be diplayed according to the user browser language. If no translation was provided, the treatment will be displayed with english as a default value.