Simple web-based scrabble for you and your friends with zero friction authentication.
Features:
- Zero friction authentication
- Fully usable on Mobile and Desktop
- Does not attempt to validate or spellcheck any words for you. You are provided a simple search input which links to a dictionary.
Demo or play at https://scrabble.westonganger.com
Authentication is designed to be zero friction and works as follows:
- User chooses any username
- Username is stored in session
- User can then create or join any game given a Game ID or Game Name
Developed as a Rails engine. So you can add to any existing app or create a brand new app with the functionality.
First add the gem to your Gemfile
### Gemfile
gem "scrabble_with_friends", git: "https://github.com/westonganger/scrabble_with_friends.git"
Then install and run the database migrations
bundle install
bundle exec rake scrabble_with_friends:install:migrations
bundle exec rake db:migrate
### config/routes.rb
scrabble_with_friends_subdomain = "scrabble_with_friends"
mount ScrabbleWithFriends::Engine,
at: "/", as: "scrabble_with_friends",
constraints: Proc.new{|request| request.subdomain == scrabble_with_friends_subdomain }
not_engine = Proc.new{|request| request.subdomain != scrabble_with_friends_subdomain }
constraints not_engine do
# your app routes here...
end
### config/routes.rb
### As sub-path
mount ScrabbleWithFriends::Engine, at: "/scrabble_with_friends", as: "scrabble_with_friends"
### OR as root-path
mount ScrabbleWithFriends::Engine, at: "/", as: "scrabble_with_friends"
Web push notifications are available and can be enabled by setting the vapid public/private keys in the config
# config/initializers/scrabble_with_friends.rb
ScrabbleWithFriends.config do |config|
config.web_push_vapid_public_key = "some-vapid-public-key"
config.web_push_vapid_private_key = "some-vapid-private-key"
end
You can generate the web_push vapid keys using the following:
require 'web-push'
generated_vapid_key = WebPush.generate_key
public_key = generated_vapid_key.public_key
# => "BC1mp...HQ"
private_key = generated_vapid_key.private_key
# => "XhGUr...Kec"
Run migrations using: rails db:migrate
Run server using: bin/dev
or rails s
bundle exec rspec
We can locally test different versions of Rails using ENV['RAILS_VERSION']
export RAILS_VERSION=7.0
bundle install
bundle exec rspec
Created & Maintained by Weston Ganger - @westonganger