Skip to content

Ruby on Rails web app of wikis with I18n translation

License

Notifications You must be signed in to change notification settings

kuro-vale/kuro-wiki

Repository files navigation

Kuro-wiki

PWD Ruby on Rails CI

This is a web app made with Ruby on Rails, I made it for learning purposes only, some of the features are I18n translation, bootstrap frontend, pagination and basic authentication.

The thematic of this app is Wikipedia.

Screenshots

Home

Screenshot_20230105_124404

Wikis

Screenshot_20230105_124512

Creating a Wiki

Screenshot_20230105_124643

Adding Translation

Screenshot_20230105_124740

Deploy

Follow any of these methods and open http://localhost:3000/ to see the WebApp.

Docker

Run the command below to quickly deploy this project on your machine, see the docker image for more info.

docker run -d -p 3000:3000 kurovale/kuro-wiki:sqlite

Quick setup

  1. git clone https://github.com/kuro-vale/kuro-wiki.git
  2. Set environment variables
  • DEV_DATABASE_URL="postgres://username:password@host:port/dev-database"
  • TEST_DATABASE_URL="postgres://username:password@host:port/test-database"
  • PROD_DATABASE_URL="postgres://username:password@host:port/prod-database"
  1. Run bundle install && yarn build && yarn build:css
  2. Migrate and seed database bin/rails db:migrate && bin/rails db:seed
  3. Run bin/rails server

Add locales

To add new locale follow these steps:

  1. Add your locale to I18n.available_locales in config/application.rb
  2. Generate migration to your locale example: bin/rails generate migration AddJapaneseToWiki title_jp body_jp
  3. Run bn/rails db:migrate
  4. Create your locales dictionaries in config/locales, example devise.jp.yml and jp.yml
  5. Optional, edit application.html.erb and add a link to change locale in line 19