Online Conference System written in Ruby on Rails
See Notion (Member only)
- Docker Compose V2 (bundled with Docker Desktop or follow the official doc)
- Auth0 application keys
- Retrieve ECR credential
# Login AWS with SSO to retrieve ECR credential. If you are not assigned to GAFA account or you don't know how to use AWS SSO, please ask Dreamkast team.
aws configure sso
aws ecr get-login-password --region ap-northeast-1 --profile dreamkast-core-XXXXX | docker login --username AWS --password-stdin https://607167088920.dkr.ecr.ap-northeast-1.amazonaws.com
- Create
.env
. This is an example.
tee .env <<EOF
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
AUTH0_DOMAIN=
SENTRY_DSN=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=ap-northeast-1
DREAMKAST_API_ADDR="http://localhost:8080"
S3_BUCKET=dreamkast-test-bucket
S3_REGION=
MYSQL_HOST=db
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_DATABASE=dreamkast
REDIS_URL=redis://redis:6379
RAILS_MASTER_KEY=
SQS_FIFO_QUEUE_URL=http://localstack:4566/000000000000/default
EOF
You need to ask Dreamkast team to get full-filled file.
- docker compose up
docker compose -f compose-dev.yaml up -d
Wait until the dreamkast app to start (almost 3 minutes)
After that, access to http://localhost:8080
in your browser.
This repository works with
- Ruby
- Node.js
- Yarn
- Docker Compose (for MySQL and Redis)
- AWS CLI
the version is controlled by .node-version
and .ruby-version
file.
nodenv
and rbenv
are recommended to install those.
You need to install shared-mime-info
- macOS:
brew install shared-mime-info
- Ubuntu, Debian:
apt-get install shared-mime-info
$ yarn install --check-files
$ bundle install
Then, create .env-local
file and fill these values. If you don't know correct values, please ask us.
export AUTH0_CLIENT_ID=
export AUTH0_CLIENT_SECRET=
export AUTH0_DOMAIN=
export SENTRY_DSN=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export S3_BUCKET=
export S3_REGION=
export MYSQL_HOST=db
export MYSQL_USER=user
export MYSQL_PASSWORD=password
export MYSQL_DATABASE=dreamkast
export REDIS_URL=redis://redis:6379
export RAILS_MASTER_KEY=
export SQS_FIFO_QUEUE_URL=http://localhost:9324/queue/default
Next, configure awscli and logged in registry using it.
source .env-local
aws ecr get-login-password | docker login --username AWS --password-stdin http://607167088920.dkr.ecr.ap-northeast-1.amazonaws.com/
Then, setup databases, ui and load balancer by running Docker Compose
$ docker compose pull ui
$ docker compose up -d fifo-worker db redis nginx localstack ui
Run the application and builder js and css
$ bundle exec foreman start -f Procfile.dev "$@" -e .env
$ bundle exec rails db:migrate
$ bundle exec rails db:seed
https://github.com/pocke/rbs_rails
Generate RBS files for Rails (e.g. ActiveRecord models) to undersig/rbs_rails/
. You don't need update files by this rake task because these are auto geretated files.
$ rake rbs_rails:all
If you want to generate RBS for your application code, you can use rbs prototype
. This command generate prototype RBS file by your code. You can edit generated RBS file.
$ rbs prototype rb ./app/models/access_log.rb > sig/app/models/access_log.rbs
AUTH0_DOMAIN=dreamkast.us.auth0.com
CLIENT_ID=<CLIENT ID>
CLIENT_SECRET=<CLIENT SECRET>
AUDIENCE=https://event.cloudnativedays.jp/
TOKEN=$(curl --url https://${AUTH0_DOMAIN}/oauth/token \
--header 'content-type: application/json' \
--data "{\"client_id\":\"${CLIENT_ID}\",\"client_secret\":\"${CLIENT_SECRET}\",\"audience\":\"${AUDIENCE}\",\"grant_type\":\"client_credentials\"}" | jq -r .access_token)
DREAMKAST_DOMAIN='event.cloudnativedays.jp'
※ Don't retrieve JWT token frequently due to Auth0 limitation. We recommend store generated token into environment variable. Generated token is available 1 day.
curl -X GET -H "Authorization: Bearer $TOKEN" https://$DREAMKAST_DOMAIN/api/v1/talks/1/video_registration
curl -X PUT -H "Authorization: Bearer $TOKEN" https://$DREAMKAST_DOMAIN/api/v1/talks/1/video_registration -d '{
"url": "https://foobar"
}'
You can set these values in status.
- unsubmitted
- submitted
- confirmed
- invalid_format
curl -X PUT -H "Authorization: Bearer $TOKEN" https://$DREAMKAST_DOMAIN/api/v1/talks/1/video_registration -d '{
"status": "confirmed",
"statistics": {
"file_name": "XX",
"resolution_status": "OK",
"resolution_type": "FHD",
"aspect_status": "OK",
"aspect_ratio": "16:9",
"duration_status": "OK",
"duration_description": "Appropriate media duration.",
"size_status": "OK",
"size_description": "Appropriate media size."
}
}'
git config pre-commit.ruby "bundle exec ruby"
git config pre-commit.checks "[rubocop]"