Let’s create an application for managing Tasks that are created by different users. Let’s use React UI for quick data response. The app consists of CRUD operations of Tasks, User Authentication using JWT-Tokens, User Authorization for their particular tasks.
Technology stack
Here’s the list of technology stack we use in our application.
| Layer | Technology | Purpose |
|---|---|---|
| Backend | Ruby on Rails 8.1+ | REST API |
| Database | PostgreSQL | Persistent storage |
| Frontend | React | UI |
| Language | TypeScript | Static typing |
| Build tool | Vite | Frontend development/build |
| UI library | Fluent UI React v9 | Components and styling |
| HTTP | Fetch API initially | API communication |
| Server cache | TanStack Query | API data caching |
| Global state | Redux Toolkit | Shared client-side state |
| Testing backend | RSpec | API and model tests |
| Testing frontend | Vitest + React Testing Library | Component tests |
| Containers | Docker + Docker Compose | Containerization |
| CI/CD | GitHub Actions | Automation and deployment |
Check our ruby current version.
$ ruby -v
ruby 3.4.1 (2024-12-25 revision 48d4efcb85)
Check the security patches and updates of our version.
https://www.ruby-lang.org/en/downloads/releases
Then update the latest compatible version.
$ mise use -g ruby@3.4.12
(2026-10-23 revision 366f5fdc00)
To uninstall Ruby using mise, run mise uninstall ruby@ to delete a specific installed version.
$ mise uninstall ruby@3.4.1
Install latest ruby version that you need.
Switch between versions globally:
$ mise use -g ruby@3.4.12
$ mise use -g ruby@4.0.9
Check all needed versions exists:
ruby -v
gem -v
rails -v
node -v
npm -v
psql --version
Check Postgres versions available here: https://www.postgresql.org/download/macosx/
Download the one of the latest one if you have currently installed the old version.
$ brew install postgresql@18
Installing postgresql@18
==> Pouring postgresql@18--18.7.arm64_tahoe.bottle.tar.gz
Warning: postgresql@18 was installed but not linked because postgresql@14 is already linked.
To link this version, run:
brew link postgresql@18
$ brew link postgresql@18
Unlinking /opt/homebrew/Cellar/postgresql@14/14.17_1... 2165 symlinks removed.
Linking /opt/homebrew/Cellar/postgresql@18/18.7... 812 symlinks created.
$ psql --version
psql (PostgreSQL) 18.7 (Homebrew)
Update node js:
$ node -v
v24.14.0
install the latest Long-Term Support release
$ nvm install --lts
Installing latest LTS version.
Downloading and installing node v26.13.1...
Downloading https://nodejs.org/dist/v26.13.1/node-v26.13.1-darwin-arm64.tar.xz...
Computing checksum with sha256sum
Checksums matched!
Now using node v26.13.1 (npm v11.20.0)
Create app folder:
$ mkdir rails-react-task-manager
$ cd rails-react-task-manager
$ git init -b main
We want to manage the backend, frontend, Docker configuration and CI/CD workflows in one repository.
Update ruby gems:
A new release of RubyGems is available: 4.0.20 → 4.0.24!
See https://github.com/ruby/rubygems/blob/v4.0.24/CHANGELOG.md for the changes since 4.0.20.
Run `gem update --system 4.0.24` to update your installation
Install Rails:
check rails newest versions: https://rubygems.org/gems/rails/versions
$ gem install rails -v '~> 8.1.0'
Note: Pessimistic version constraint. Using -v “~> 8.1.0” installs the latest patch release within the 8.1 series (such as 8.1.4.1) while avoiding unintended jumps to future minor or major versions
Reopen the shell and check:

Create a github repository
name it: rails-react-task-manager
$ git remote add origin git@github.com:<username>/rails-react-task-manager.git
Problem 1:
The first problem I faced was the command rails new already has the folders: .git, .github, .gitattributes, .gitignore etc inside rails app.
So when I try to push the rails app:
git add backend/
error: 'backend/' does not have a commit checked out
error: unable to index file 'backend/'
fatal: adding files failed
This happens because Rails automatically initializes a Git repository when you run rails new.
Solution: Keep only one Git repository
Since we’re building a monorepo, we want Git initialized only at the project root.
Remove only the nested Git metadata:
rm -rf backend/.git
| Type | When to Use It | Example |
|---|---|---|
chore | Upgrading packages, libraries, or runtime versions | chore: update Node.js version or chore(deps): bump lodash |
feat | Adding a new feature or capability for the user. | feat: add user login via OAuth |
fix | Patching a bug in the application code. | fix: resolve crash on checkout page |
refactor | Restructuring production code without changing its behavior. | refactor: simplify auth helper logic |
docs | Updating READMEs, comments, or API guides. | docs: add setup instructions |
style | Fixing formatting, whitespace, or missing semicolons. | style: format files with Prettier |
test | Adding or updating unit and integration tests. | test: add unit tests for cart total |
build / ci | Making dedicated changes to build systems or CI pipelines (used by teams that prefer stricter categories over chore). | ci: cache node_modules in pipeline |
Problem 2:
Accessing the Rails url at: http://localhost:3000/
Started GET "/" for ::1 at 2026-11-15
ActiveRecord::StatementInvalid (PG::InvalidParameterValue: ERROR: invalid value for parameter "TimeZone": "UTC"
)
Caused by: PG::InvalidParameterValue (ERROR: invalid value for parameter "TimeZone": "UTC"
)
Information for: ActiveRecord::StatementInvalid (PG::InvalidParameterValue: ERROR: invalid value for parameter "TimeZone": "UTC"
):
Solution: check which PostgreSQL server is actually running
psql --version
brew services list
brew services stop postgresql@14
brew services restart postgresql@18
# then do
rails db:prepare -t # recommended
Restart the rails server. Also check:
curl -i http://localhost:3000/up
Install RSpec
Add RSpec to Gemfile
group :development, :test do
gem "rspec-rails", "~> 8.1"
end
Install the gem
cd backend
bundle install
bundle exec rspec --version
Generate RSpec configuration
rails g rspec:install
create .rspec
create spec
create spec/spec_helper.rb
create spec/rails_helper.rb
| File | Responsibility |
|---|---|
.rspec | Default command-line options for RSpec |
spec_helper.rb | General RSpec configuration |
rails_helper.rb | Rails-specific test configuration |
Important distinction:
spec_helper.rb can be used for tests that don’t require Rails.
rails_helper.rb loads the Rails application and integrates Rails testing functionality.
Verify:
bundle exec rspec
No examples found.
Finished in 0.00022 seconds (files took 0.05449 seconds to load)
0 examples, 0 failures
Minitest is still present: Your Rails application probably already has: backend/test/. That’s because Rails generated its default Minitest structure. We’ll configure Rails generators to use RSpec automatically, so that when we generate a model, Rails creates: spec/models/task_spec.rb instead of: test/models/task_test.rb. We’ll also decide how to handle the existing Minitest files cleanly.
Configure Rails generators to use RSpec
Currently, Rails uses Minitest as its default testing framework. For example, when you generate a model: bin/rails generate model Task title:string, Rails normally generates: app/models/task.rb
test/models/task_test.rb
But we want: app/models/task.rb
spec/models/task_spec.rb
RSpec Rails integrates with Rails generators to do exactly this.
Open: backend/config/application.rb and add:
config.generators do |g|
g.test_framework :rspec
end
Important: This does not remove Minitest or disable its test runner. It changes the default generator behaviour.
We don’t want to generate our actual Task model just to test the configuration.
Instead, use Rails --pretend option:
rails g model Task title:string --pretend
invoke active_record
create db/migrate/20261115171837_create_tasks.rb
create app/models/task.rb
invoke rspec
create spec/models/task_spec.rb
Rspec Structure:
spec/
├── models/
│ └── task_spec.rb
│
├── requests/
│ └── api/
│ └── v1/
│ └── tasks_spec.rb
│
├── services/
│ └── authentication/
│
├── jobs/
├── factories/
│
├── spec_helper.rb
└── rails_helper.rb
For our Rails API, we’ll primarily use request specs instead of controller specs. A request spec tests the application from the HTTP client’s perspective. This lets us test the complete API behaviour rather than testing controller methods in isolation. RSpec Rails recommends request specs as the higher-level alternative to controller specs.
For example:
HTTP Request
↓
Router
↓
Controller
↓
Authentication
↓
Authorization
↓
Model / Database
↓
HTTP Response





