This is a small web-application aiming at providing accessible information on the German national tennis youth rankings.
This application is developed using
- Ruby 3.0.4
- Rails 7.0.2.3
- SQLite3 (for development and test)
- bundler package manager (for rubygems)
- Yarn package manager (for web assets)
To setup a developement environment, run the following steps before starting rails server
# run database migrations
rake db:migrate
# install bundle
bundle install
# install web assets
yarn install --update-files
Now everything is ready for starting a development server!
To run the test suites, run rake test
The project also includes guard and an guard configuration. To start guard and run tests automatically on code changes, simply open a terminal and start guard while in the project folder.
To import data in the system, you need to create a csv file from the official ranking list pdf using a tool like tabula. The file needs to be in the format
ranking-position, lastname, firstname, nationality, dtb_id federation, club, score
which is the standard order and format tabula (which I am using) is retrieving by default. An example file can be found in test/fixtures/files
The system has an easy mechanism to upload csv-files for importing into the database. Access to this funtionality is, however, restricted. In order to use it, you need to add a user into the database manually - there is no way of editing this on the ui:
- make sure your database is up to date by running
rake db:migrate
- open a rails console by running
rails console
- Add a user by running
User.create(name: 'Example User', email: '[email protected]', password: 'password', password_confirmation: 'password')
with your preferred data
The password cannot be empty and should be at least 6 characters!
The project includes a Dockerfile and a docker-compose configuration to run a production environment. To start the stack, you need adapt docker-compose.yml to fit your needs, build the image and run DATABASE_PASSWORD=your_password docker-compose up
to set a password for the postgresql container and the application. Next you need to run the database migrations and add an admin user (see above).
After starting the stack, you can access the application by calling http://127.0.0.1:3000
in a browser.
If you want to deploy the application standalone, you need to set some environment variables in order to fill required information for the imprint on the about page. You can also hardcode the values in config/config.yml.
- DOMAIN - the domain the application is deployed to
- IMPRINT_NAME - name for the imprint
- IMPRINT_STREET - street and street number for the imprint
- IMPRINT_ZIPCODE - zip code for imprint
- IMPRINT_CITY - city for imprint
- IMPRINT_PHONE - phone number for imprint
- IMPRINT_MAIL - email address for imprint