Railway App

After I posted the video on Image Optimisation, I wanted to deploy the finished app. Heroku is finished, as far as I am concerned. I then went ahead and tried various other hosts. The one that impressed me most is the newcomer on the block called Railway. Has a free tier, I opted for the developer tier which is free for the first $5.

All I needed to do was to link my Github account to Railway and Railway did the rest. No fiddling around with NodeJS configurations, or any other config. The result:
https://image-optimisation-production.up.railway.app/

Image Optimisation uses a SQLite database and surprise, surprise, all works as was hoped for.

Oh! For the video in question:

I hope that this will help other users.

PS: The link to the repository: https://github.com/ben-pleysier/Image-Optimisation

3 Likes

Only problem with Railway(at least for me) is that they only have a single US datacenter.

1 Like

Railway is barely 2 years old. They are adding new features at a great pace. Sort of reminds me of Wappler’s initial startup period. Have a look at this video where Jake Cooper hints on where they are going:

I have used them in the past but only small PoC that don’t rely on PII.
I can’t consider them for anything real due to that limitation.

https://feedback.railway.app/feature-requests/p/configurable-deployment-region

Two years is way too much for providing a EU datacenter. Some North American companies are way too stubborn with this and they don’t give a damn. Basically because they really have no consideration for personal data policies.

Bubble is the same for their shared plans. But even they offer EU locations with their most expensive dedicated plans.

Anyway, their loss.

Or in ChatGPT words:

It has been a ridiculous two years and some North American companies are still refusing to provide a data center in the European Union. These companies are being extremely stubborn and do not seem to care at all about personal data policies. It is clear that they have no regard for protecting personal data and are just being difficult for no good reason.

A ChatGPT haiku:

North American firms
Ignore EU data center need
Personal data lost

Perhaps you did not see:

1 Like

Thank you for bringing that to my attention. I must have missed it.

1 Like

How about netlify or specially vercel? We were thinking to add support for those as they have also pretty generous free tier

I was surprised at the ease with which Railway took the info from Github and presented a perfectly working website to the world. No configs necessary.

Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration. No db.

Netlify can connect to the likes of CockroachDB, but try MySQL or SQLite.

Railway did not argue about using Node/Express/SQLite. Just made it happen. I assume that Apache/PHP/Mysql will behave in the same manner.

Then there is PostgreSQL, Redis and MongoDB that are also supported.

Go to Railway, don’t login or register, just start a new project click on Provision PostgreSQL and you are presented with the database. It could not be easier.

1 Like

I have not done ANYTHING with Github.
But it is impressive that a site can be deployed this way so effortlessly.
BUT, help me out here, even if it took 10-20 minutes to manually deploy, I don’t see the “big deal”. UNLESS I had to do this multiple times quite often.
Like I said, it’s impressive, but I’m missing the practical point. Even as a newbie, I deployed my first app on DO following a tutorial and it just works thanks to the work of the dev team.
Maybe I’m missing the significance because I don’t use GitHub?

1 Like

Hi Robert,

It is not my intention for you to change your workflows. My intention for bringing up Railway is to highlight the ease with which a full stack application can be deployed. This is for the benefit of newbies who get easily confused by the number of alternatives.

The reason for using Github is two-fold. In the first instance it is a version control. Secondly, it will replace the File Transfer Protocol.

Mind you, Railway is not the only platform as a Heroku alternative. In another post I saw that someone had adopted Render. Then there is also Cycle and many others.

Out of all of these, my personal preference is Railway. Other opinions may differ.

1 Like

You could also try with any of these:

1 Like

Please see:

2 Likes

Thank you Ben. I’m one of the newbies to Wappler and I appreciate the pointer to Railway! I’m still evaluating hosting options and Railway sounds like a great fit for me. I have done quite a lot of full-code work (C#, javascript, MS SQL, HTML, CSS, etc.), so I’m not afraid of multi-step setups, but I’d rather focus on a smooth, easy workflow that I can easily hand off to others when needed, so I’ll check out Railway.

1 Like

Hi and thank you Ben, I have been deploying to Railway from Wappler using Github before you posted this video :slight_smile: it is very easy to do. Also your enviroment variables will be detected by Railway so it will ask which values to assign them when you deploy, which gives a lot of flexibility and security (I use it to have diferent salt encryption values between local development and online instances)

PROBLEM: The only thing I don’t like is that my project uses SQLite database (because I am not technical enough to work with postgres or other db) and I don’t know how to separate my local database that I use for testing from the one I like to work on production in the railway instance.

I can only think in one solution: Make Wappler ignore the SQLite database (using gitignore) so the file is not in the Github repository and therefore the Railway app does not have that file as part of the deployment. But, how to add and keep a separate SQL database in the railway instance that is always updated in its structure / scheme to work remotely?

Thanks from Mexico

p.d. I am new to Wappler, two months now, coming from Bubble development. Your videos have been my primary source of learning Ben, you are amazing.

It is probably better to use antother database like MySQL. The problem for the moment is that MySQL is misbehaving when using NodeJS as the server model. See my bug report:

Hopefully this can be fixed soon. If not soon, and you need an immediate solution, then you can use PostgreSQL which is a bit more involved than PHP.

When I have the time, I will produce a video showing how easy it is to use another databse when deploying to Railway.app

1 Like

Using Project Publisher, you can stop changes to the database

Have a look at

1 Like

Just checked them out, quite a handy service, great for PoC or protos (or services, that do not require EU datacenters)

Thanks for sharing.

EDIT: looks like new data centers are in progress (e.g. EU/Ireland).

1 Like

Thank you, Ben.

I have been testing deployments from Wappler to Railway using Github and a remote MySQL server in Railway (as per your last video). I am also utilizing different targets and environment variables in Wappler, but I have some security concerns/problems.

The setup: Wappler project, Node.js server, remote MySQL server in Railway, and deploying using Github to Railway. I am attempting to use different targets for added secrecy and to protect the production environment.

  1. DATABASE CONNECTION DETAILS AND ENVIRONMENT VARIABLE VALUES EXPOSED: When using Github, your database connection details and environment variable values are sent to Github (github-project/.wappler/targets/name-of-target/databases/name-of-database.json) and can be viewed by anyone unless your Github directory is set to private (a paid feature).
    1.a I suspect that it’s not possible to use .gitignore, as not having it in the Github directory will prevent the deployment from working in Railway. Is that correct?
    1.b Even if I use environment variables for database connection details (set in workflows > Globals > Database Connections), this only changes the config.json file which also gets published to Github (github-project/.wappler/targets/name-of-target/app/config/config.json), thus the environment values are still exposed.

  2. MAINTAINING DATABASE STRUCTURE/SCHEMA ACROSS ENVIRONMENTS: Suppose I work on a local MySQL database for the development target but my staging or production target will be a Railway MySQL. If I don’t use the setup provided above (same database connection but with different values, all of which get exposed when publishing to Github) then the database schema won’t be the same and nothing will function correctly. Is that accurate?

Gracias from Mexico

So far, I have only been experimenting with Railway and think it to be a great alternative to Heroku. I have not used either for production, I am sticking to my old-fashioned host until I am sure that Railway suits my needs.

  1. This is a BIG worry. Have a look at this discussion

I am wondering how the likes of @JonL handles this for Heroku.

  1. I think that the solution would be to use a different database for each environment. This is what I do presently: Wamp server for local development and a remote database for production.
1 Like