Skip to content

πŸš€ Ready-to-use Rails7 API/ReactJS/OpenAPI monolithic web application template

Notifications You must be signed in to change notification settings

tonystrawberry/template.rails.react.openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Monolithic web application template with Rails & React

πŸš€ Rails 7 API / ReactJS / OpenAPI - Monolithic Web Application Template

This starter template will help you get started in a new full-stack web application.

πŸ’Ύ Versions

Ruby 3.1.2
Rails 7.0.2
PG 13

React 18.1.0
Typescript 4.6.3

OpenAPI 3.0.3

πŸ“‹ Features

πŸ‘¨πŸ»β€πŸ’» Local development

docker-compose build
docker-compose run --rm backend bundle install
docker-compose run --rm backend rails db:create rails db:migrate db:seed 
docker-compose up

docker-compose run --rm frontend npm install
docker-compose run --rm frontend npm run generate-api-client # generate API client code into `src/types/typescript-axios`

πŸ›  Access Rails console

docker-compose run --rm backend rails c

$ User.all # Fetch and show all users 

❀️ Tests

docker-compose run --rm backend /bin/bash

$ RAILS_ENV=test rspec spec/ # Run all tests inside spec folder

πŸ‘¨πŸ»β€πŸ’» Install gems

  1. Add the gem in the Gemfile.
  2. Run docker-compose run --rm backend bundle install

πŸ‘¨πŸ»β€πŸ’» Local URLs

Frontend: http://localhost:4000. Backend: http://localhost:3000.