Next.js on Rails is an opinionated template for quickly setting up a project with Next.js as the frontend and Ruby on Rails as the backend API.
It follows the best practices of Next.js and Ruby on Rails. It is actively maintained and is a great starting point for new projects.
We have added Docker support to this template. You can find the Dockerfile in the docker
directory.
For a quick start, you can run the following command:
docker-compse up
- User Authentication using JWT
- User Authorization using Pundit
- Organizations support(Feature in progress)
- Interactor Pattern for API using interactor gem
- premailer-rails for styling emails with stylesheets
- pagy for faster pagination
- jb for a fast JSON API builder
- MiniTest for testing
- SimpleCov for code coverage
- User Signup and Login
- User Profile
- All basic components under
components/shared
- DaisyUI for creating additional components
- react-cookie πͺ for sharing tokens in SSR
- zustand as minimal state management library
- @headlessui/react for accessibile components like
modal/dialog
- Ruby 3.0.3
- Node >= 16.x.x
# run in the root directory
$ bundle install
# create database, migrate & seed
$ rails db:prepare
# install packages and come back to root directory
$ cd frontend && npm install && cd ..
# run the application using Foreman
# services are defined in the Procfile
$ foreman start
$ docker-compose up
Contributions are appreciated! It can be as simple as fixing a typo.
If you're facing any difficulty, create issues in the github repo and I will be happy to help.