Launch Rails with 1 shell command!
Ruby on Rails
in Minutes!Copy & Paste in your terminal
❤️ Linux / MacOS
git clone https://github.com/the-teacher/rails7-startkit.git && \
cd rails7-startkit && \
ruby bin/setup
💙 Windows
git clone https://github.com/the-teacher/rails7-startkit.git & cd rails7-startkit & ruby bin/setup
Rails App in a Docker container with some popular preinstalled tools.
Save hours, days or weeks on setting up a typical Rails app.
Logotype | Description | Why it was added |
---|---|---|
Main |
||
Docker | Helps to keep all required services in containers. To have fast and predictable installation process in minutes. Docker Images are here. | |
Ruby 3.2 | Most recent version of Ruby | |
Rails 7 | Most recent version of Rails | |
PostgresSQL | Most popular relational database | |
Cache and Delayed Jobs |
||
Redis | In-memory data store. For caching and as a dependency of Sidekiq | |
Sidekiq | Job Scheduler and Async Tasks Executor. Can be used as a stand alone tool or as ActiveJob backend | |
whenever | Linux Cron based periodical tasks | |
Full Text Search |
||
Elasticsearch | The world’s leading Search engine | |
Chewy | Ruby Connector to Elasticsearch | |
Front-end |
||
Bootstrap | Old but Gold Framework for Web | |
ES Build | An extremely fast bundler for the web | |
Import Maps | Rails' recommended way to process JavaScript | |
Sprockets | Rack-based asset packager | |
Application Configuration |
||
gem "dotenv" | ENV variables management tool | |
gem "config" | Configuration management tool | |
Application Level |
||
Nginx | Web Server. Reverse Proxy. Load Balancer. Caching, Streaming etc. | |
Puma | Application Web Server. To launch Rails app | |
Devise | Authentication solution for Rails + Emails confirmations | |
ActiveStorage | Default Cloud Storage Solution for Rails | |
Faker | Fake data for development and testing | |
Kaminari | Pagination solution | |
Sanitize | Sanitization of a dangerous users' input | |
mailcatcher | Email previewer for development | |
Code Quality |
||
RSpec | Testing Framework for Rails | |
Rubocop | Ruby static code analyzer (a.k.a. linter) and formatter. | |
Breakman | Static analysis tool | Security Vulnerabilities. | |
SimpleCov | Code coverage for Ruby (and Rails) |
What I'm going to add...
Logotype | Description | Why it was added |
---|---|---|
Devise | Login with Facebook and Google |
All trademarks, logos and brand names are the property of their respective owners.
Copy & Paste in your terminal
❤️ Linux / MacOS
git clone https://github.com/the-teacher/rails7-startkit.git && \
cd rails7-startkit && \
ruby bin/setup
💙 Windows
git clone https://github.com/the-teacher/rails7-startkit.git & cd rails7-startkit & ruby bin/setup
You will see something like that:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rails 7. StartKit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What was done:
1. Pull all required Images
2. Launching ElasticSearch Container
3. Launching Mailcatcher Container
4. Launching PgSQL Container
5. Launching Redis Container
6. Launching Rails Container
7. Correcting Permissions for Linux
8. Installing Gems
9. Turn off some ElasticSearch settings
10. Prepare Database (Create, Migrate, Create Seeds)
11. Indexing Article Model
12. Quality: Rubocop
13. Quality: RSpec with SimpleConv
14. Quality: Breakman
15. Yarn: Install Node Packages
16. Yarn: Build JS/CSS Assets
17. Precompile Assets
18. Launching Sidekiq
19. Launching Rails App with Puma
20. Visit Rails App: http://localhost:3000
21. Visit Mail Service: http://localhost:1080
22. Visit ElasticSearch: http://localhost:9200
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Welcome to RAILS 7!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bin/
commands❤️ :warning: bin/exec
- Linux and MacOS users can skip using ruby
💙 :warning: ruby bin/exec
- Windows users should use ruby
explicitly
From the root of the project
Command | Description |
---|---|
Most important | |
ruby bin/setup | Download images, run containers, initialize data, launch all processes. |
ruby bin/open | Get in Rails Container |
rubyc bin/exec [CMD] | Execute a command ([CMD]) from Rails7StartKit module |
bin/open
commandCommand | Description |
---|---|
Get in a container | |
ruby bin/open [NAME] |
Get in a Container. [NAME]
[NAME] Values: rails ,psql , redis , elastic , mailcatcher .
Default value is: rails .
|
bin/exec
commandOn your host you have:
For demonstration, education and maintainance purposes I use a bit unsusual approach to name some files.
I _UNDERSCORE
and UPPERCASE
some files and folders to move them on the top of a folder and to make them more visible and to highlight their importance.
Data
./db
UPPERCASED
./db
├── ELASTIC
├── PGSQL
└── REDIS
Configuration Files
./config
_UNDERSCORED
and UPPERCASED
./config
├── _CONFIG.yml
├── _PUMA.rb
└── _SIDEKIQ.yml
Initialazers
./config/initializers
_UNDERSCORED
and UPPERCASED
./config/initializers/
├── _CHEWY.rb
├── _CONFIG.rb
├── _REDIS.rb
└── _SIDEKIQ.rb
As a user to own files and run Rails inside a container I use
user:group
=> lucky:lucky
=> 7777:7777
If you would like to run the project on a linux environment then:
lucky (7777)
and user lucky (7777)
RUN_AS=7777:7777
optionFor many years Rails gives you freedom to choose development tools. Different databases, different paginators, different search engines, different delayed job solutions.
It is great. But all the time you need to choose something and install it from scratch.
I think I did my choice about many solutions and tools.
I want to install my minimal pack of tools now and reuse my StartKit every time when I start a new project.
With Docker I can roll out my minimal application with all required preinstalled tools in minutes, not in hours or in days.
I didn't work with Rails last 4 or 5 years. I wanted to learn new approaches and techniques. I found that there is still no a simple way to setup a blank app with most popular tools.
So. Why not to make my own playground?
I use tools that I like or want to learn.
I use tools that I think are the most popular ones.
I'm not a DevOps, but I have a vision how to deploy this code to production.
Right now it is not described somehow. It is in my plans.
These amazing companies and teams support the project:
JetBrains.com | Hoodies.team |
---|---|