Skip to content

a todo application use stimulus_reflex、ViewComponent、ViewComponentReflex and esbuild on ruby on rails framework

Notifications You must be signed in to change notification settings

jisuanjixue/stimulus_reflex_todos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Templatus (view_component_reflex edition)

Template is an opinionated template to build web applications with Ruby on Rails and view_component_reflex. It simplifies the process of setting up a new application while following best practices.

Live demo available at

Backend

  • Ruby 3.2.0
  • Ruby on Rails 7.0.4
  • ActionCable for WebSocket communication PostgreSQL for use as SQL database
  • Sidekiq for background processing
  • Redis for Caching, ActionCable, and Sidekiq
  • stimulus_reflex Build reactive applications with the Rails tooling you already know and love
  • Puma is a simple, fast, multi-threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications.

Frontend

  • view_component_reflex for About Call component methods right from your markup, It builds upon stimulus_reflex and view_component:
  • ViewComponent for creating reusable, testable & encapsulated view components
  • stimulus_reflex for build reactive applications with the Rails tooling you already know and love
  • Tailwind CSS 3 to not have to write CSS at all
  • https://flowbite.com/ Build websites even faster with components on top of Tailwind CSS.
  • esbuild An extremely fast bundler for the web
  • stimulus-use A collection of composable behaviors for your Stimulus Controllers

Development

  • Foreman for starting up the application locally
  • 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
  • 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
  • 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
  • Lockup to place a staging server behind a basic codeword

Getting started

Install for development

  1. Clone the repo locally:
git clone https://github.com/jisuanjixue/stimulus_reflex_todos
cd stimulus_reflex_todos
  1. Install PostgreSQL, Redis, ruby, gem, javascript node module etc Setup the application to install gems and NPM packages and create the database::
bin/setup
  1. Start the application locally:
bin/dev

Then open http://localhost:3000 in your browser.

Running linters

RuboCop:

bin/rubocop

ESLint:

bin/yarn lint

Running tests locally

Ruby tests:

bin/rspec
open coverage/index.html

JavaScript unit tests:

bin/yarn test

E2E tests with Cypress:

bin/cypress open

This opens Cypress and starts Rails in development environment, but with CYPRESS=true, so the test database is used. This allows code editing without class reloading and recompiling assets.

To run Cypress in headless mode:

bin/cypress run

Test deployment locally

docker network create public
docker-compose up

About

a todo application use stimulus_reflex、ViewComponent、ViewComponentReflex and esbuild on ruby on rails framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published