Skip to content

Commit c962f28

Browse files
committed
Merge branch 'release/1.5.6'
2 parents fc45615 + f2936f2 commit c962f28

File tree

7 files changed

+181
-8
lines changed

7 files changed

+181
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
docs/.vitepress/cache
33
docs/.vitepress/dist
4+
.vscode/

docs/.vitepress/config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ function boringStackGuide() {
377377
{
378378
text: 'Render',
379379
link: 'boring-stack/render'
380+
},
381+
{
382+
text: 'Railway',
383+
link: 'boring-stack/railway'
380384
}
381385
]
382386
},

docs/boring-stack/file-uploads.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ prev:
1111
link: '/boring-stack/session'
1212
next:
1313
text: 'Deploy on Render'
14-
link: '/boring-stack/render'
14+
link: '/boring-stack/railway'
1515
editLink: true
1616
---
1717

docs/boring-stack/railway.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
head:
3+
- - meta
4+
- property: 'og:image'
5+
content: https://docs.sailscasts.com/boring-stack-social.png
6+
title: Deploy on Railway
7+
titleTemplate: The Boring JavaScript Stack 🥱
8+
description: Deploy your app on Railway
9+
prev:
10+
text: 'Render'
11+
link: '/boring-stack/render'
12+
next:
13+
text: Type checking JS files
14+
link: '/boring-stack/render'
15+
editLink: true
16+
---
17+
18+
# Deploy on Railway
19+
20+
Let's deploy your app on [Railway](https://railway.com) :rocket:
21+
22+
You have two options to deploy your app on Railway...
23+
24+
- Use the **[One-click deploy](#one-click-deploy-with-railway-templates)** if you're just starting out.
25+
- Or follow the **[GitHub Repo](#github-repo)** steps if you’ve already started building your app.
26+
27+
## One-click deploy mellow-vue
28+
29+
Simply click the button, and Railway will set up everything you need to get your new app live using the `mellow-vue` Railway template.
30+
31+
[![Deploy Mellow Vue on Railway](https://railway.com/button.svg)](https://railway.com/template/mellow-vue?referralCode=orSqKL)
32+
33+
This template includes:
34+
35+
- **Mellow Vue**: The Boring Stack Mellow template with Vue.js.
36+
- **PostgreSQL**: A pre-configured PostgreSQL database.
37+
- **Redis**: A pre-configured Redis instance.
38+
39+
## One-click deploy mellow-react
40+
41+
Simply click the button, and Railway will set up everything you need to get your new app live using the `mellow-react` Railway template.
42+
43+
[![Deploy Mellow React on Railway](https://railway.com/button.svg)](https://railway.com/template/Yqisvu?referralCode=orSqKL)
44+
45+
This template includes:
46+
47+
- **Mellow React**: The Boring Stack Mellow template with React.js.
48+
- **PostgreSQL**: A pre-configured PostgreSQL database.
49+
- **Redis**: A pre-configured Redis instance.
50+
51+
## One-click deploy mellow-svelte
52+
53+
Simply click the button, and Railway will set up everything you need to get your new app live using the `mellow-svelte` Railway template.
54+
55+
[![Deploy Mellow Svelte on Railway](https://railway.com/button.svg)](https://railway.com/template/K-dheh?referralCode=orSqKL)
56+
57+
This template includes:
58+
59+
- **Mellow Svelte**: The Boring Stack Mellow template with Svelte.js.
60+
- **PostgreSQL**: A pre-configured PostgreSQL database.
61+
- **Redis**: A pre-configured Redis instance.
62+
63+
## GitHub Repo
64+
65+
Push your app to a repo on GitHub.
66+
67+
## Create database
68+
69+
Create the database you want to use for production on Railway and take note of the connection url.
70+
::: info Database creation guides
71+
See guides for [MySQL](https://docs.railway.com/guides/mysql), [PostgreSQL](https://docs.railway.com/guides/postgresql), and, [MongoDB](https://docs.railway.com/guides/mongodb) on the Railway docs.
72+
:::
73+
74+
## Create Redis instance
75+
76+
Create the production Redis instance and take note of the connection url.
77+
::: info Redis instance guide
78+
See the [guide to create a Redis instance](https://docs.railway.com/guides/redis) on the Railway docs.
79+
:::
80+
81+
## Set up database
82+
83+
Depending on the database you want to use for production, [set up that adapter](/boring-stack/database) in `config/environment/production.js`
84+
::: code-group
85+
86+
```js [PostgreSQL]
87+
module.exports = {
88+
datastores: {
89+
default: {
90+
adapter: 'sails-postgresql',
91+
url: process.env.DATABASE_URL
92+
}
93+
}
94+
}
95+
```
96+
97+
```js [MySQL]
98+
module.exports = {
99+
datastores: {
100+
default: {
101+
adapter: 'sails-mysql',
102+
url: process.env.DATABASE_URL
103+
}
104+
}
105+
}
106+
```
107+
108+
```js [MongoDB]
109+
module.exports = {
110+
datastores: {
111+
default: {
112+
adapter: 'sails-mongo',
113+
url: process.env.DATABASE_URL
114+
}
115+
}
116+
}
117+
```
118+
119+
:::
120+
121+
::: warning
122+
Don't forget to install the adapter if you haven't already. See the [database](/boring-stack/database) docs for more info.
123+
:::
124+
125+
## Set up Redis
126+
127+
::: info
128+
[Create a new Redis instance](https://docs.railway.com/guides/redis) on Railway by following the Railway docs.
129+
:::
130+
Set up the Redis adapter in `config/environment/production.js`
131+
132+
```js
133+
module.exports = {
134+
session: {
135+
secret: process.env.REDIS_SECRET
136+
adapter: '@sailshq/connect-redis',
137+
url: process.env.REDIS_URL
138+
}
139+
}
140+
```
141+
142+
## Create a web service
143+
144+
Create a new [Web Service](https://docs.railway.com/quick-start) on Railway, and give Railway permission to access the repo of your app.
145+
146+
If necessary, use the following values during creation:
147+
148+
- **Runtime**: `Node`
149+
- **Build command**: `npm i`
150+
- **Start command**: `npm start`
151+
152+
However, Railway is capable of configuring things automatically for you.
153+
154+
## Set environment variables
155+
156+
Add the following evironment variables to your web service:
157+
158+
- `DATABASE_URL`: This should point to the connection string of the database you created.
159+
- `REDIS_URL`: This should point to the connection string to the Redis instance you created.
160+
- `SESSION_SECRET`: A unique production session secret to override the one in `config/session.js`.
161+
162+
That’s it! Your app will be live on your Railway URL as soon as the build finishes :tada:
163+
164+
## Celebrate with a :star:
165+
166+
::: tip Star The Boring JavaScript Stack repo on GitHub :star:
167+
Let's celebrate deploying your app on Railway by giving **The Boring JavaScript Stack** [a star on GitHub](https://github.com/sailscastshq/boring-stack).
168+
:::

docs/boring-stack/render.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ title: Deploy on Render
77
titleTemplate: The Boring JavaScript Stack 🥱
88
description: Deploy your app on Render
99
prev:
10-
text: 'Session'
11-
link: '/boring-stack/session'
10+
text: 'File uploads'
11+
link: '/boring-stack/file-uploads'
1212
next:
13-
text: Type checking JS files
14-
link: '/boring-stack/type-checking-js-files'
13+
text: Railway
14+
link: '/boring-stack/railway'
1515
editLink: true
1616
---
1717

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sailscasts-docs",
3-
"version": "1.5.5",
3+
"version": "1.5.6",
44
"private": true,
55
"description": "The official docs hub for Sailscasts",
66
"scripts": {

0 commit comments

Comments
 (0)