Giter Club home page Giter Club logo

rails-starter-template's Introduction

Rails starter template

IN MAINTENANCE MODE

In the last couple of months the Rails landscape changed, and so did my opinionated Rails setup. I will keep this one as maintained as possible, but currently running on edge Rails with just minor changes. Those specifics will be open sourced in the future as well.

Opinionated Rails setup using Rails 7, PostgreSQL, TailwindCSS, Stimulus, Hotwire and RSpec.

We are bundling JavaScript and CSS through a Node-based setup with jsbundling-rails and cssbundling-rails.

If you want to run propshaft as the asset pipeline you can use this branch: https://github.com/peterberkenbosch/rails-starter-template/tree/propshaft. The main branch will be using Sprockets for the time being.

You need the following installed:

  • Ruby >= 3 (asdf install)
  • Node 19 (asdf install)
  • Bundler (gem install bundler)
  • Yarn (brew install yarn)
  • Overmind (brew install tmux overmind)
  • Postgresql (brew install postgresql start with: brew services start postgresql)
  • Redis (brew install redis start with: brew services start redis)

If you are using asdf (I recommend that you do :) ) you can install the required Ruby and NodeJS versions with asdf install

The Homebrew dependencies can be installed with running:

brew bundle install --no-upgrade

Additional Homebrew dependencies can be added to the Brewfile

Optional: Docker to use with the preconfigured dip.yml to setup a dockerized dev environment using dip

Getting started

Initial application setup

Run the setup script that will run the needed setup steps for the application, installing all gems and packages, database preparing etc.

$ bin/setup

Provisioning and interacting with Docker and dip

You need docker and docker-compose installed (for MacOS just use official app).

This app uses the dip CLI, a utility CLI tool for straightforward provisioning and interactions with applications configured by docker-compose.

$ gem install dip
$ dip provision

Take a look at the dip.yml file for the available commands

Development

Will run Overmind (or Foreman if Overmind is not installed), builds all assets automaticly and will start the rails server and sidekiq

$ bin/dev

When using dip:

$ dip up web

Code Guidelines

It uses StandardRB for Ruby to automatically fix code style offenses.

$ bundle exec standardrb

to automatically format Ruby with StandardRB you can run:

$ bundle exec standardrb --fix

For Javascript we use StandardJS.

$ yarn standard

to automatically format the javascript with StandardJS you can run:

$ yarn standard --fix

Running the specs

Inspired by Evil Martians - System of a Test article

To run all the specs you can run:

$ rake

or use RSpec directly with

$ bundle exec rspec

Inside the docker container we have 2 different commands. To just run the unit tests:

$ dip rspec

and to just run the system specs:

$ dip rspec system

rails-starter-template's People

Contributors

dependabot[bot] avatar mhenrixon avatar peterberkenbosch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rails-starter-template's Issues

Fix system specs in Docker

The used standalone chromium is failing for all js related system specs, however it's passing on CI. This specific docker image was used to try to have the full docker build working on Apple M1 machines. This is not working currently.

The chromium is running correctly, however all js specific specs are failing hard.

Maybe try to get a standalone firefox with cuprite.

Replace Ruby.CI

Seems that the service is not optimal, probably return to github actions for now.

Add simple rename script

Right now there are some manual steps to do for renaming the app when using it as a template for your new application. Would be good to have a simple renaming tool available to automate that.

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.