Skip to content

APysnack/live-rap-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

implements:
ruby on rails
devise user authentication
graphql/graphiql/apollo graphql
styled components
material ui
formik
redux
redux-persist
and more

(extra dependencies made need to be installed):

  1. Clone the git repository

$ git clone [email protected]:APysnack/live-rap-center.git


  1. Change directory into the live rap center folder

$ cd live-rap-center


  1. Generate a secret hash

$rake secret

copy the output (if the output you get is longer than 32 characters, only copy the first 32 characters.)


4.Generate rails credentials and add your secret in a text editor (I use vim in this example, use whatever editor you're comfortable with)

$EDITOR=vim rails credentials:edit

paste the secret as shown below. Do not modify the secret_key_base. Note there are exactly 2 spaces of indentation before jwt_secret_key:

Screen Shot 2022-05-26 at 8 00 58 AM


  1. Be sure to store this secret somewhere secure in case you need access to it in the future

  1. Install rails gems

$bundle install


  1. Run the rails migrations

$bundle exec rake db:migrate


  1. You should now be able to run $rails s and see a blank page at localhost:3000 with the word "main" on it. Keep the server terminal open.

  1. Open a new terminal, cd to the live-rap-center/client folder

  1. Install yarn dependencies

$yarn install


  1. Start the client

$yarn start

This should start up the client on localhost:4000


Deploy Steps

  1. Get AWS credentials and set ecr login
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 655948565243.dkr.ecr.us-east-1.amazonaws.com
  1. Build and push server container image
docker build --platform linux/amd64 --tag 655948565243.dkr.ecr.us-east-1.amazonaws.com/lrc_server .
docker push 655948565243.dkr.ecr.us-east-1.amazonaws.com/lrc_server:latest
  1. Build and push sidekiq container image
docker build --platform linux/amd64 --tag 655948565243.dkr.ecr.us-east-1.amazonaws.com/sidekiq_jobs -f SidekiqDockerfile .
docker push 655948565243.dkr.ecr.us-east-1.amazonaws.com/sidekiq_jobs:latest
  1. Use Cloudformation template to create CFN Stack

  2. Update development.rb and database.yml, respectively

config.active_storage.service = :amazon
development:
  <<: *default
  host: <%= ENV.fetch('AWS_RDS_HOST') %>
  username: <%= ENV.fetch('AWS_RDS_USERNAME') %>
  password: <%= ENV.fetch('AWS_RDS_PASSWORD') %>
  database: <%= ENV.fetch('AWS_RDS_NAME') %>
  port: <%= ENV.fetch('AWS_RDS_PORT') %>
  1. initialize the RDS DB
SEED_FILE=production rake db:reset
  1. Ensure that your client .env file has the new cloudfront distribution id and correct server url
cd client
yarn update
  1. Update sidekiq AWS service to desired tasks: 1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published