Skip to content

Commit

Permalink
Merge pull request #80 from unasuke/setup-docs
Browse files Browse the repository at this point in the history
Update setup document
  • Loading branch information
fugakkbn authored Nov 11, 2023
2 parents 25a4775 + f263e9b commit dc13359
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -30,6 +30,6 @@ CLOUDFLARE_R2_BUCKET_NAME=sample-r2-bucket-name
# VAPID_SUBJECT_MAILTO is optional on development and test environments.
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT_MAILTO=
# VAPID_SUBJECT_MAILTO=

APPLICATION_URL="http://localhost:3000"
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -28,8 +28,33 @@ It's built with Ruby on Rails.
The app is built with Ruby on Rails 7. It uses `importmap-rails`, `turbo-rails`, `stimulus-rails` and `tailwindcss-rails` for front end development.

## Setup dev environment
### Environment variables
See [`.env.sample`](.env.sample) for required/optional environment variables.

### Create GitHub App
Current implementation requires GitHub App when you create a user.

<https://github.com/settings/apps/new>

* Callback URL: `http://localhost:3000/auth/github/callback`
* Webhook: inactive
* Permissions: Allow read-only access for "Organization permissions" -> "Members"

Then, fill these environment variables.

* App ID -> `GITHUB_APP_ID`
* Client ID -> `GITHUB_KEY`
* Client secret -> `GITHUB_SECRET`
* Private key (encoded) -> `GITHUB_PRIVATE_KEY` (See [`.env.sample`](.env.sample))

### Load seed data

```shell
$ bin/rails db:seed
```

After that, you can see 2023's event talks and speakers.

## Setup dev environment with docker
```bash
$ cp .env.sample .env
4 changes: 2 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -66,8 +66,8 @@
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true

config.x.webpush.vapid_public_key = ENV.fetch("VAPID_PUBLIC_KEY")
config.x.webpush.vapid_private_key = ENV.fetch("VAPID_PRIVATE_KEY")
config.x.webpush.vapid_public_key = ENV["VAPID_PUBLIC_KEY"]
config.x.webpush.vapid_private_key = ENV["VAPID_PRIVATE_KEY"]
config.x.webpush.vapid_subject_mailto = ENV.fetch("VAPID_SUBJECT_MAILTO", "mailto:mail@kaigionrails.example")

config.application_url = ENV.fetch("APPLICATION_URL", "http://localhost:3000")

0 comments on commit dc13359

Please sign in to comment.