This is a Ruby on Rails (5.2) application backed by MySQL. There are two ways to run it locally:
- Setup a local development environment with the steps below.
- Use a pre-made Docker setup. We don't maintain an official Docker repo, but you can try this version kindly maintained by @unused.
- Ruby: We recommend Ruby >=2.4 (and this will soon become a requirement). We recommend using RVM
- MySQL: Install via your system's package manager or follow the official Installation instructions
- Yarn: Yarn handles front-end dependencies. See Yarn's installation instructions.
Something like this will then get a working database setup:
mysql -e "CREATE USER 'exercism_reboot'@'localhost' IDENTIFIED BY 'exercism_reboot'" -u root -p
mysql -e "create database exercism_reboot_development" -u root -p
mysql -e "create database exercism_reboot_test" -u root -p
mysql -e "ALTER DATABASE exercism_reboot_development CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" -u root -p
mysql -e "ALTER DATABASE exercism_reboot_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" -u root -p
mysql -e "GRANT ALL PRIVILEGES ON exercism_reboot_development.* TO 'exercism_reboot'@'localhost'" -u root -p
mysql -e "GRANT ALL PRIVILEGES ON exercism_reboot_test.* TO 'exercism_reboot'@'localhost'" -u root -p
Bundle is used to handle the project's Ruby dependancies. You can install it via
gem install bundler
Firstly, you need to set a server identity, which you can do like this:
echo "host" > server_identity
Then we've put a rake task together that should set everything else up. You can run it like this:
bundle install
bundle exec rake exercism:setup
To run a webserver, simple run:
bundle exec rails s
Something like this will get a working webserver on http://lvh.me:3000 Note: Teams will be avaliable on http://teams.lvh.me:3000
We recommend using lvh.me
which is a DNS redirect to localhost, but which we honour cookies on.
To delete a user, run user.destroy.
The user record is deleted, as well as associated objects except the ff:
- Discussion posts where they are a mentor.
- Maintainer records where their user record is associated.
For when @iHiD breaks things.
user_track_ids.each do |id|
ut = UserTrack.find(id)
CreateSolution.(ut.user, ut.track.exercises.core.first) if ut.solutions.size == 0
end