This is the Ruby on Rails web-app powering projekteuler.de. It allows visitors to view and suggest German translations of the maths puzzles found on projecteuler.net.
-
Download this repository, e.g., with
git clone
. -
Make sure NodeJS >= 18 is installed.
-
Navigate inside the repository folder.
-
Use bundler to install all required gems. $ bundle install
-
Setup the database:
$ bin/rails db:setup
-
Start the server:
$ bin/rails server
-
Open
http://localhost:3000
in your browser. You should see the web app up and running! -
Start playing with the web app. By default, the database will contain some users and translations. The user
admin
can review translations, while the usertranslator
has submitted some translations. You can login as any user by clicking the Login button and entering their name. This is simply a mock OAuth login; in production mode, GitHub is used for login. -
If you ever want to reset the database to the original state, run
rails db:reset
.
Do you have a suggestion for an improvement for the web app? Please create an issue for it.
Do you want to implement this improvement yourself? Follow these steps:
- Fork this repository on GitHub.
- Create a new branch for your improvement
- Implement your improvement, and create tests for it if applicable.
- Submit a pull request.
- Make sure NodeJS is installed.
- Set up a MySQL database.
- Copy all files from this repository.
- Make sure the Rails environment is set to
production
. - Set up the following environment variables:
RAILS_MASTER_KEY
: The master key for decryption of the Rails credentialsDATABASE_NAME
: The name of the MySQL databaseDATABASE_USERNAME
: The username for the MYSQL databaseDATABASE_PASSWORD
: The password for the MYSQL databaseDATABASE_HOST
: The host of the MYSQL databaseDATABASE_PORT
: The port of the MYSQL databaseGITHUB_CLIENT_ID
: The client ID of your GitHub OAuth App (that you will need to create)GITHUB_CLIENT_SECRET
: The client secret of the GitHub OAuth App
- Install all required gems with
bundle install
. - Load the database schema with
bin/rails db:schema:load
. - Precompile all assets with
bin/rails assets:precompile
. - Start the server, e.g., with
bin/rails server
.
Anytime you update the files, you should run bin/rails db:migrate
, bin/rails log:clear tmp:clear
, bin/rails assets:precompile
and then restart the server.
This project is released under the MIT License.