TimeSynk is a Rails app that makes it easy to find time to game with friends. Input your available times and TimeSynk will find the best time for everyone to play together.
- Create groups and invite friends
- Propose and vote on games to play
- Setup one-off or recurring availability schedules and use different schedules for different games or groups
- See scheduled game sessions and everyone's available times at a glance
- Ruby 3.3.5
- Node 20.13
- Yarn 1.22
- SMTP Credentials
- IGDB API Credentials.
-
Clone the repository
-
Install dependencies
bundle install yarn install
-
Setup
.env.developmentenvironment variables.Variable Description RAILS_MAX_THREADS Number of threads per Rails worker (default: 5) PORT Listening Port (default: 3000) MAINTENANCE_MODE Set to 'true' to enable maintenance mode,
preventing non-admins from using the site. (default: false)MAILER_ADDRESS SMTP server address for sending emails MAILER_HOST Default host for email links MAILER_FROM Default sender email address IGDB_CLIENT IGDB API client ID IGDB_SECRET IGDB API client secret MAILER_USERNAME SMTP authentication username MAILER_PASSWORD SMTP authentication password TIMESYNK_DATABASE_USER Database server username (default: postgres) TIMESYNK_DATABASE_PASSWORD Database server password (default: postgres) TIMESYNK_DATABASE_PASSWORD Database server password (default: postgres) REDIS_URL Redis server URL
-
Start Postgres and Redis databases.
docker compose -f docker-compose.dev.yml up -d
-
Setup database. Games are fetched from IGDB.
bin/rails db:setup bin/rails csv:fetch_games bin/rails db:import_games
-
Start the Rails server
bin/dev
-
Setup credentials (replace
codewith your preferred editor)VISUAL="code --wait" bin/rails credentials:edit --environment=productionThe credentials file should include:
Credential Key Description secret_key_base Rails secret key for verifying signed cookies igdb.client IGDB API client ID igdb.secret IGDB API client secret timesynk_database.user Production database username timesynk_database.password Production database password mailer.username SMTP authentication username mailer.password SMTP authentication password admin.username TimeSynk admin account username admin.password TimeSynk admin account password See
config/credentials/production.yml.examplefor an example. -
Setup
.env.productionenvironment variablesVariable Description RAILS_MAX_THREADS (Default: 5) PORT Listening Port (default: 3000) MAINTENANCE_MODE Set to 'true' to enable maintenance mode,
preventing non-admins from using the site. (default: false)MAILER_ADDRESS SMTP server address for sending emails MAILER_HOST Default host for email links MAILER_FROM Default sender email address REDIS_URL Redis server URL -
Create
/config/secrets/postgres_password.secretand/config/secrets/postgres_user.secretfiles with the production database password and username respectively. -
Run the docker container
docker compose up -d
/config/sidekiq.yml holds the schedules jobs for the application.
They update and fetch new games once a week and update popularity once a week.
If the Games table is empty when starting the application, it will be seeded with data from IGDB.
If db/seed/games.csv is present, it will be used instead. To ignore this file, run the application with IGNORE_SEED.
IGNORE_SEED=true docker compose up