2 years ago
I'm still tweaking the branding, the Deploy button etc, but <@539512869780455445> could you eyeball the meat of this and let me know if anything looks off?
0 Replies
2 years ago
currently out Christmas shopping for the day so I'll look at it when I'm back home!
2 years ago
im seeingDATABASE_HOST=postgres.railway.internal
andDATABASE_PORT=5432
on the powersync-nodejs-backend service, instead, on the postgres service set these variables PGHOST_PRIVATE=${{RAILWAY_PRIVATE_DOMAIN}}
andPGPORT_PRIVATE=${{RAILWAY_TCP_APPLICATION_PORT}}
and then reference those new variables on the powersync-nodejs-backend service
when I edit the template and make those changes, the button at the bottom says Fork Template, that doesn't seem right

2 years ago
uhhh you made this template on your team didn't you
2 years ago
that's bugged right now π¬
2 years ago
you can't delete it either I don't think
2 years ago
but try
2 years ago
welp, fix coming in 2024
2 years ago
the majority of the team is on vacation
2 years ago
haha yeah not ideal, but there's not much I can do for bugs that don't affect users workloads
yep same⦠all good, worst case if a developer uses it, I can help them update these vars in their deployed project
2 years ago
I mean it would still work just fine
I was able to update the description a bit to include some more info on what the template does, so there's that. Anyway, appreciate all the help thus far and happy holidays π
2 years ago
no problem, always happy to help when templates are involved
2 years ago
and happy holidays to you too
Thanks!
p.s. The Deploy button totally fits into the color scheme of our docs https://docs.powersync.com/integration-guides/railway-+-powersync
2 years ago
I noticed, it looks great!
@Brody Weβre gearing up to release our Open Edition by the end of May which will let customers run full-stack Postgres+PowerSync+Backend on Railway and I want to get your input on our updated Template since it seems we've had nonzero downloads of the previous one. Can I still msg you here when it's ready for a review?
(previous Template was Postgres + Backend connected to hosted PowerSync, the update will make it fully self-hosted on Railway with no external deps)
a year ago
absolutely!
a year ago
they do not, it's something you'd have to setup yourself, and I've heard mongo does not make it easy
I have a docker-compose config that sets it up, might give it a whirl
entrypoint:
- bash
- -c
- 'sleep 10 && mongosh --host mongo:27017 --eval ''rs.initiate({_id: "rs0", version: 1, members: [{ _id: 0, host : "mongo:27017" }]})'''a year ago
never hardcode the host and port like you're doing there
a year ago
mongo doesn't make it easy even in a docker compose file lol
Hi @Brody , I'm going to create a new Template with all the latest hotness. Busy checking out all the new updates to Templates since we last spoke and had a question:
Is it possible to create a configurable template that, when the user deploys it, will conditionally include either postgres, mongodb or mysql depending on some config the user specifies on the template deploy config page?
I don't think this is possible, so I'll probably create powersync-mysql, powersync-mongodb, powersync-postgres, etc templates. Just checking that I'm on the right track π
a month ago
Unfortunately from what i know it isnt possible to optionally change databases.
a month ago
This is definitely some tooling for templates though which iβd like to see
a month ago
What Noah said, you would have to create seprate templates.
a month ago
Hey @k0b13 - We would love for you to become a template partner, you already have the template, and your templates are already published by your own PowerSync workspace.
You can apply here - https://railway.com/partners
And I am also happy to answer any questions you may have!
Awesome, thanks! I'll apply. I got the new stack working yesterday in a new project, it's now just bundling, shipping and some light docs on our end before I can publish the new templates.
a month ago
Amazing! Please do apply, and we can get your partnership set up and your templates verified!
And please let me know when the templates are ready for review! π
our service accepts env vars as base64 encoded since the config is quite chonky, so encoding a config file into base64 will be one manual step to use the templates, but otherwise it's looking very promising compared to the current template
a month ago
No luck with volumes? anything I could help with?
Nope, more just that what I was thinking is something Railway doesn't support (basically creating a volume and then editing a config file on the volume from the Railway dashboard, but I know this is not a supported use case)
a month ago
Ah, yeah, not something we support, unfortunately.
I then configure it on the service (manual testing for now, will drop it into the template later)

probably trying to connect on the wrong port or something, digging around in docsβ¦
a month ago
That red info text may take you to the applicable docs.
a month ago
No problem!
Hey @Brody π
I am part of the PowerSync team and have been building the new template. Everything is working well but there is a bit of manual intervention required and I was wondering if it could be automated.
There are 5 main services:
Postgres Data Source - main database
Postgres Bucket Storage - storage database
Node.js Backend - backend api that is configured with public networking
PowerSync Service - configured with public networking
Execute Scripts (bun function) - this creates the necessary tables, seeds them and creates the powersync publication in the Postgres Data Source
When deploying the template, the PowerSync Service fails because the user must base64-encode a .yaml template file and set it as the value of the POWERSYNCCONFIGB64 environment variable.
They need insert the following values into the template and base64-encode it:
${{"Postgres Source Data".DATABASE_URL}}
${{"Postgres Bucket Storage".DATABASE_URL}}
The Node.js backend public url
The PowerSync Service public url
And then set the base-64 encoded string to the {{"PowerSync Service".POWERSYNCCONFIGB64}} environment variable.
My question is, is there a way to automate this? Perhaps by using another function?
a month ago
We don't have a function to base64 encode something, the best way I can think of would be to move away from base64 encoding and allow for configurations to be done via individual environment variables.
I think I would be able to do it in a bun function but I'm not sure how to get all of those values I need inside the template string and also I am not sure how I can set the {{"PowerSync Service".POWERSYNCCONFIGB64}} variable from a function or if it is possible.
a month ago
I would recommend allowing power sync to be configured with environment variables instead of base64 encoded yaml
a month ago
That's going to be easier for the Railway template, and anyone self hosting powersync outside of Railway as well.
Hey @Brody π
Quick question, how exactly are the arrows created? Is it just when a service references another services environment variables?
I can't find anything concrete in the documentation on this. I see at the bottom of this changelog it mentions that it's also when you have Service Groups enabled.

11 days ago
Yes, it is based on reference variables.




