Overview:
Templatus (Vue edition) is an opinionated template designed for building web applications using Ruby on Rails and Vue.js 3. It simplifies the setup process of a new application while following best practices. The template includes a range of features and technologies for both the backend and frontend development, as well as tools for testing, linting, and deployment.
Features:
Backend:
- Ruby 3.2 and Ruby on Rails 7.0
- ActionCable for WebSocket communication
- PostgreSQL for using as SQL database
- Sidekiq for background processing
- Redis for Caching, ActionCable, and Sidekiq
Frontend:
- Vite for bundling JavaScript and CSS with Hot Module Replacement (HMR) in development
- Vue 3 as frontend framework
- Vue Router 4 for frontend routing
- Pinia for frontend state management
- Tailwind CSS 3 for styling
- Heroicons for SVG icons as Vue components
- Rails Request.JS for AJAX requests with default headers
Development:
- Puma-dev for using .test TLD (instead of localhost:3000) and https in development
- Foreman for starting up the application locally
- dotenv to load environment variables from .env into ENV
- TypeScript for writing strongly-typed JavaScript
- Prettier for auto-formatting TypeScript and Ruby code in Visual Studio Code
- RuboCop for Ruby static code analysis
- RSpec for Ruby testing
- ESLint for TypeScript static code analysis
- Jest for TypeScript unit testing
- Cypress for E2E testing
Deployment:
- Docker for production deployment
- 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
- Ready for serving assets via CDN like CloudFront
- Honeybadger for error tracking in Ruby and TypeScript
- Plausible for privacy friendly analytics
Production:
- Lograge for single-line logging
- Gzip and Brotli compression of dynamic responses (HTML, JSON) using Rack::Deflater, Rack::Brotli
- Fine-tuned Content Security Policy (CSP)
- Ready for PWA (manifest, service-worker)
Installation:
To install the Templatus (Vue edition) template, follow these steps:
- Clone the repository:
git clone https://github.com/templatus/templatus-vue.git
- Change into the project directory:
cd templatus-vue
- Install Ruby 3.2 and Rails 7.0 if not already installed.
- Install dependencies:
bundle install
andyarn install
- Set up the database:
rails db:create db:migrate
- Start the development server:
rails s
- Open your browser and go to
http://localhost:3000
to view the application.
Summary:
Templatus (Vue edition) is a comprehensive template for building web applications with Ruby on Rails and Vue.js 3. It provides a wide range of features and technologies for both the backend and frontend development, as well as tools for testing, linting, and deployment. With optimized performance and security in mind, the template offers a streamlined setup process and follows best practices.