We have noted that any template that is kept in code needs to be maintained, but are generally not. Therefore instead of maintaining a template we are going to utilize another method of pointing to existing code repos for our current understanding of best practices.
As you utilize this documentation please update it with the latest information
You will want to generate your new application using rails new
For ORCID@Princeton we utilized this tutorial for integrating vite with rails. The tutorial suggest utilizing tailwind as your javascript framework, but after trying it we decided against it and just went with bootstrap.
We utilize rspec instead of minitest so remove minitest and add rspec. Here is an example of this on ORCID@princeton
We utilize lando (which is a layer above docker) for running dependencies like the database and solr. Here is an example of a lando config file for just a database and one that has solr
We utilize a rake task for starting the servers and a script to set the lando information in the Rails environment
We utilize simplecov to check that our code remains covered as we develop it. Here is a rake task to check our coverage.
We utilize rubocop and bixby (from the samvera community) to make sure our code looks consistant. Add in the bixby gem and create an initial rubocop install. Here is an example rubocop configuration file from OCID@Pricneton
We utilize eslint to make sure our javascript looks consistent. Here is an example eslint configuration file from OCRID@Princeton
We generally start with the airbnb base and a few other packages installed with yarn.
We utilize circle ci for continuos integration. Here is a tutorial for implementing continuos integration. And here is the config file from OCID@Princeton. Note the coverage is initially set to zero on line 112!
We utilize capistrano to deploy to the production and staging servers. Here is an example commit for adding in capistrano to ORCID@princeton which was created following the install instructions here
If you followed the instructions for a new rails application from the vite tutorial you should already have vite install.
Make sure you remove sprockets so that vite is handling all your assets.