@@ -19,166 +19,44 @@ This causes issues with modern React libraries like **TanStack Router** that rel
1919- Hot reload of bundles without server restart
2020- Support for async operations during SSR
2121
22- ## Getting a Free License
22+ ## Installation
2323
24- React on Rails Pro is a commercial product, but ** free licenses are available for open-source projects and evaluation ** .
24+ React on Rails Pro is available on RubyGems and npm .
2525
26- ### To request a free license:
27-
28- 1 . ** Email** : Contact [ team@shakacode.com ] ( mailto:team@shakacode.com ) or [ justin@shakacode.com ] ( mailto:justin@shakacode.com )
29- 2 . ** Subject** : "React on Rails Pro License Request"
30- 3 . ** Include** : Your GitHub username and project name
31-
32- You'll receive:
33-
34- - Access to the private GitHub Package registry
35- - Instructions for creating a Personal Access Token
36-
37- ### Creating a GitHub Personal Access Token
38-
39- Once you have access:
40-
41- 1 . Go to [ GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)] ( https://github.com/settings/tokens )
42- 2 . Click "Generate new token (classic)"
43- 3 . Name it something like "React on Rails Pro"
44- 4 . Select the ** ` read:packages ` ** scope
45- 5 . Click "Generate token"
46- 6 . ** Copy the token immediately** (you won't see it again)
47-
48- ## Local Development Setup
49-
50- ### Step 1: Configure Environment Variables
51-
52- Create a ` .env ` file in the demo root (this file is gitignored):
53-
54- ``` bash
55- # .env (DO NOT COMMIT THIS FILE)
56- REACT_ON_RAILS_PRO_TOKEN=ghp_your_github_token_here
57- ```
58-
59- ### Step 2: Configure Bundler for GitHub Packages
60-
61- ``` bash
62- bundle config set --local rubygems.pkg.github.com YOUR_GITHUB_USERNAME:ghp_your_token_here
63- ```
64-
65- Or use environment variable (recommended):
66-
67- ``` bash
68- bundle config set --local rubygems.pkg.github.com ${GITHUB_ACTOR} :${REACT_ON_RAILS_PRO_TOKEN}
69- ```
70-
71- ### Step 3: Install the Ruby Gem
26+ ### Step 1: Install the Ruby Gem
7227
7328``` bash
7429bundle install
7530```
7631
77- ### Step 4: Configure npm for Node Renderer
78-
79- ``` bash
80- cd react-on-rails-pro
81-
82- # Copy the example .npmrc
83- cp .npmrc.example .npmrc
32+ The Gemfile already includes ` gem "react_on_rails_pro" ` .
8433
85- # Edit .npmrc and replace YOUR_GITHUB_TOKEN with your actual token
86- ```
87-
88- Your ` .npmrc ` should look like:
89-
90- ```
91- always-auth=true
92- //npm.pkg.github.com/:_authToken=ghp_your_token_here
93- @shakacode-tools:registry=https://npm.pkg.github.com
94- ```
95-
96- ### Step 5: Install Node Renderer
34+ ### Step 2: Install Node Renderer
9735
9836``` bash
9937cd react-on-rails-pro
10038npm install
10139```
10240
103- ### Step 6 : Start Development Server
41+ ### Step 3 : Start Development Server
10442
10543``` bash
10644bin/dev
10745```
10846
10947This starts all processes including the Node Renderer on port 3800.
11048
111- ## CI/CD Setup (GitHub Actions)
112-
113- For public repositories, use GitHub Secrets to store your token securely.
114-
115- ### Step 1: Add Repository Secrets
116-
117- Go to your repository's ** Settings > Secrets and variables > Actions** and add:
118-
119- | Secret Name | Value |
120- | -------------------------- | ------------------------------------------ |
121- | ` REACT_ON_RAILS_PRO_TOKEN ` | Your GitHub PAT with ` read:packages ` scope |
122-
123- ### Step 2: Configure GitHub Actions Workflow
124-
125- ``` yaml
126- # .github/workflows/ci.yml
127- name : CI
128-
129- on : [push, pull_request]
130-
131- jobs :
132- test :
133- runs-on : ubuntu-latest
134-
135- env :
136- REACT_ON_RAILS_PRO_TOKEN : ${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}
137-
138- steps :
139- - uses : actions/checkout@v4
140-
141- - name : Set up Ruby
142- uses : ruby/setup-ruby@v1
143- with :
144- bundler-cache : true
145-
146- - name : Configure Bundler for GitHub Packages
147- run : |
148- bundle config set --local rubygems.pkg.github.com ${{ github.actor }}:${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}
149-
150- - name : Install dependencies
151- run : bundle install
152-
153- - name : Set up Node Renderer
154- run : |
155- cd react-on-rails-pro
156- echo "//npm.pkg.github.com/:_authToken=${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}" > .npmrc
157- echo "@shakacode-tools:registry=https://npm.pkg.github.com" >> .npmrc
158- npm install
159-
160- - name : Start Node Renderer
161- run : |
162- cd react-on-rails-pro
163- npm run node-renderer &
164- sleep 5 # Wait for renderer to start
165-
166- - name : Run tests
167- run : bin/rails test
168- ` ` `
169-
17049## Configuration Reference
17150
17251### Environment Variables
17352
174- | Variable | Default | Description |
175- | --------------------------- | ------------------------ | ----------------------------- |
176- | ` REACT_ON_RAILS_PRO_TOKEN` | - | GitHub PAT for package access |
177- | `RENDERER_URL` | `http://localhost:3800` | Node Renderer URL |
178- | `RENDERER_PASSWORD` | `tanstack-demo-renderer` | Renderer authentication |
179- | `RENDERER_PORT` | `3800` | Node Renderer port |
180- | `RENDERER_LOG_LEVEL` | `debug` | Logging verbosity |
181- | `NODE_RENDERER_CONCURRENCY` | `3` | Number of worker threads |
53+ | Variable | Default | Description |
54+ | --------------------------- | ------------------------ | ------------------------ |
55+ | ` RENDERER_URL ` | ` http://localhost:3800 ` | Node Renderer URL |
56+ | ` RENDERER_PASSWORD ` | ` tanstack-demo-renderer ` | Renderer authentication |
57+ | ` RENDERER_PORT ` | ` 3800 ` | Node Renderer port |
58+ | ` RENDERER_LOG_LEVEL ` | ` debug ` | Logging verbosity |
59+ | ` NODE_RENDERER_CONCURRENCY ` | ` 3 ` | Number of worker threads |
18260
18361### Rails Configuration
18462
19472
19573## Troubleshooting
19674
197- # ## "Package not found" errors
198-
199- Ensure your token has the `read:packages` scope and you have access to the shakacode-tools organization.
200-
20175### Node Renderer won't start
20276
20377Check that:
20478
205- 1. `.npmrc` has the correct token
206- 2. `npm install` completed successfully in `react-on-rails-pro/`
207- 3. Port 3800 is not already in use
79+ 1 . ` npm install ` completed successfully in ` react-on-rails-pro/ `
80+ 2 . Port 3800 is not already in use
20881
20982### SSR returns errors
21083
@@ -217,4 +90,3 @@ Check the Node Renderer logs. Common issues:
21790
21891- [ React on Rails Pro Documentation] ( https://www.shakacode.com/react-on-rails-pro/ )
21992- [ ShakaCode Support] ( mailto:team@shakacode.com )
220- - [GitHub Issue : SSR Timer Limitations](https://github.com/shakacode/react_on_rails/issues/2299)
0 commit comments