Giter Club home page Giter Club logo

app-boilerplate's Introduction

README

  1. Create rails app in a new folder Follow steps here: https://docs.docker.com/samples/rails/
  • Create folder with app name
  • Create Dockerfile, Gemfile, Gemfile.lock, entrypoint.sh, docker-compose.yml as per https://docs.docker.com/samples/rails/
  • Change Gemfile to 7.0
  • Change Dockerfile to Ruby 3.0.0
  • Run docker-compose run --no-deps web rails new . --force -T --database=postgresql --api
  1. Pull in boilerplate that contains React setup (/frontend), Nginx config (/config), tmp (/tmp) make sure this is empty though and replace docker-compose.yml. React setup contains:
  • Vite server
  • Redux toolkit
  • React Router
  • NOTE: May need to alter frontend Dockerfile to install vite globally RUN npm install -g vite
  • NOTE: Make sure that node_modules is not copied over from frontend folder
  • NOTE: May need to manually run $ dco run frontend npm install which will install packages on container
  1. Copy rails files from rails app created in Step 1 to backend folder. Some notes:
  • Copy .gitignore, /backend/.gitignore and /backend/.dockerignore files from boilerplate
  • Remove docker-compose.yml from rails folder
  • Copy config/database.yml from boilerplate (Make sure to replace db name)
  • Update Dockerfile from boilerplate
  • NOTE: You may have to remove the /tmp folder if you have db issues when creating the database
  • NOTE: You'll have to namespace rails routes to api/v1 in order to view on NGINX server

Check

Run the following

  • $ dco build
  • $ dco up

Make sure the following is working:

  • http://localhost:4000/: This should show React frontend
  • http://localhost:4000/: This should show Rails backend
  • http://localhost:8080/: This should show React frontend on NGinx server
  • http://localhost:8080/api: This should show Rails backend on NGinx server

  1. Add MUI and fonts by running the following: dco run frontend npm install @mui/material @emotion/react @emotion/styled dco run frontend npm install @fontsource/roboto (Be sure to import fonts in entrypoint)

  2. Add sidekiq

  • Add gem "sidekiq" to Gemfile
  • Update config/application.rb with config.active_job.queue_adapter = :sidekiq
  • Add sidekiq initializer
  • Add sidekiq routes
  • Update docker-compose.yml

NOTE: The following events will require a docker re-build:

  • Adding/removing gems from Gemfile
  • Altering appRouter

To Run

dco build dco up

app-boilerplate's People

Watchers

James Cloos avatar Sunny Israni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.