Templatus Hotwire

screenshot of Templatus Hotwire
rails
vite
tailwind

Opinionated template for starting new web applications with Ruby on Rails and Hotwire

Overview:

Templatus is an opinionated template designed for building web applications with Ruby on Rails and Hotwire. It aims to simplify the process of setting up a new application while adhering to best practices. The template includes a technology stack for both the backend and frontend, along with various development and deployment tools.

Features:

  • Backend:
    • Ruby 3.3
    • Ruby on Rails 7.1
    • ActionCable for WebSocket communication
    • PostgreSQL for using as SQL database
    • Sidekiq for background processing
    • Redis for Caching, ActionCable, and Sidekiq
  • Frontend:
    • Hotwire for building the frontend without using much JavaScript by sending HTML instead of JSON over the wire
    • TypeScript for static type checking in Stimulus controllers and other script code
    • ViewComponent for creating reusable, testable & encapsulated view components
    • Slim for writing templates instead of ERB
    • Tailwind CSS 3 to not have to write CSS at all
    • Heroicons for beautiful hand-crafted SVG icons
    • Vite for bundling JavaScript and CSS with Hot Module Replacement (HMR) in development
  • Development:
    • Puma-dev for using .test-domain and HTTPS in development
    • Overmind for starting up the application locally (Procfile handling like Foreman)
    • dotenv to load environment variables from .env into ENV
    • Prettier for auto-formatting JavaScript and Ruby code in Visual Studio Code
    • Lookbook as development UI for ViewComponent
    • annotate for annotating models and routes
    • Live reloading
  • Linting and testing:
    • RuboCop for Ruby static code analysis
    • ESLint for JavaScript static code analysis
    • RSpec for Ruby testing
    • Factory Bot for setting up Ruby objects as test data
    • Cypress for E2E testing
  • Deployment:
    • Docker for production deployment, NOT for development
    • DockerRailsBase for fast building an optimized Docker image based on Alpine Linux
    • GitHub Actions for testing, linting, and building Docker image
    • Dependabot configuration for updating dependencies (with auto-merge)
    • Ready for serving assets via CDN like CloudFront
    • Honeybadger for error tracking in Ruby and JavaScript
    • RorVsWild for performance monitoring
    • Plausible for privacy-friendly analytics
    • Lockup to place a staging server behind a basic codeword
  • Production:
    • Lograge for single-line logging
    • Gzip compression of dynamic responses (HTML, JSON) using Rack::Deflater
    • Fine-tuned Content Security Policy (CSP)
    • Ready for PWA (manifest, service-worker)

Summary:

Templatus is a web application template designed for building Ruby on Rails applications with Hotwire. It provides a comprehensive technology stack for both the backend and frontend, along with various development and deployment tools. The template simplifies the setup process and follows best practices to ensure optimized performance and security. Overall, Templatus offers a robust foundation for building web applications with Ruby on Rails and Hotwire.

rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.

vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.