|
1 |
| -# README |
| 1 | +## Next.js + Ruby on Rails API |
2 | 2 |
|
3 |
| -This README would normally document whatever steps are necessary to get the |
4 |
| -application up and running. |
| 3 | +Next.js on Rails is an optionated template for quickly setting up a project with Next.js as the frontend and Ruby on Rails as the backend API. |
5 | 4 |
|
6 |
| -Things you may want to cover: |
| 5 | +It follows the best practices of [Next.js](https://nextjs.org/docs/getting-started/introduction) and [Ruby on Rails](https://rubyonrails.org/). It is actively maintained and is a great starting point for new projects. |
7 | 6 |
|
8 |
| -* Ruby version |
| 7 | +We have added Docker support to this template. You can find the Dockerfile in the `docker` directory. <br><br> |
9 | 8 |
|
10 |
| -* System dependencies |
| 9 | +*For a quick start, you can run the following command:* |
11 | 10 |
|
12 |
| -* Configuration |
| 11 | +```bash |
| 12 | +docker-compse up |
| 13 | +``` |
13 | 14 |
|
14 |
| -* Database creation |
| 15 | +## Features: |
| 16 | +#### Backend |
| 17 | +- User Authentication using JWT |
| 18 | +- User Authorization using Pundit |
| 19 | +- Interactor Pattern for API using interactor gem |
| 20 | +- premailer-rails for styling emails with stylesheets |
| 21 | +- pagy for faster pagination |
| 22 | +- jb for a fast JSON API builder |
| 23 | +- MiniTest for testing |
| 24 | +- SimpleCov for code coverage |
15 | 25 |
|
16 |
| -* Database initialization |
| 26 | +### Frontend |
| 27 | +- User Signup and Login |
| 28 | +- User Profile |
| 29 | +- All basic components under `components/shared` |
17 | 30 |
|
18 |
| -* How to run the test suite |
19 | 31 |
|
20 |
| -* Services (job queues, cache servers, search engines, etc.) |
| 32 | +## Setup instructions |
21 | 33 |
|
22 |
| -* Deployment instructions |
| 34 | +### Manual |
| 35 | +- Ruby 3.0.3 |
| 36 | +- Node >= 14.x.x |
23 | 37 |
|
24 |
| -* ... |
| 38 | +```bash |
| 39 | +# run in the root directory |
| 40 | +$ bundle install |
| 41 | + |
| 42 | +# create database, migrate & seed |
| 43 | +$ rails db:prepare |
| 44 | + |
| 45 | +# install packages and come back to root directory |
| 46 | +$ cd frontend && npm install && cd .. |
| 47 | + |
| 48 | +# run the application using Foreman |
| 49 | +# services are defined in the Procfile |
| 50 | +$ foreman start |
| 51 | +``` |
| 52 | + |
| 53 | +### Docker |
| 54 | +```bash |
| 55 | +$ docker-compose up |
| 56 | +``` |
| 57 | + |
| 58 | + |
| 59 | +## Contribution |
| 60 | +Contribution is welcome! It can be as simple as fixing a typo. |
| 61 | +<br><br> |
| 62 | +If you're facing any difficulty, create issues in the github repo and I will be happy to help. |
0 commit comments