This is a boilerplate for a Rails API with Rspec and React with Typescript and Jest.
The Rails API is configured to use the following:
- Ruby v3
- PostgreSQL
- Rspec
- Factory Bot
- Rubocop
- Bullet
- Bundler Audit
The React app is configured to use the following:
- Typescript
- Jest
- ESLint
Bonus: The project also includes gitflows. It has separate flows for backend
and frontend
that checks
tests, lints, and vulnerabilities
Everything is configured to run with Docker and Docker Compose.
Before running any command, make sure to look for
TODO
comments and replace the values with your own. Otherwise, the app will be created with the default values such asreact-rails-boilerplate
.
All you need to do is build the images and run the containers.
Build images:
docker compose build
Create databases:
cd backend
docker compose run --rm backend bin/rails db:create
docker compose run --rm backend bin/rails db:migrate
docker compose run --rm backend bin/rails db:seed
Run containers:
docker compose up
The Rails API will be running on localhost:3000
and the React app will be running on localhost:3001
.
- Rails API: http://localhost:3000
- React app: http://localhost:3001
I started this repo to apply and refresh my knowledge of Docker, Docker Compose, Github Workflows, React, and Rails.
Feel free to use this at your own risk.