R
Railway8mo ago
jos o

Rails and Vite project start command?

Hi all, I'm trying to get a Rails/Vite/Svelte mono repo app to start in Railway I've tried bin/rails s && bin/vite dev to start it as well as using the Gem Foreman but neither have worked. the firs only started the rails server and the second crashes because it can't find the procfile that is clearly in the root directory. I'm not sure what to do here?
11 Replies
Percy
Percy8mo ago
Project ID: 0864e050-0637-4aa1-a1f4-48128bef6f69
jos o
jos oOP8mo ago
0864e050-0637-4aa1-a1f4-48128bef6f69
Brody
Brody8mo ago
well first off, you absolutely don't want to run a development server on railway as they are incredibly fragile and costly. can you describe your project structure?
jos o
jos oOP8mo ago
Brody
Brody8mo ago
looks like you have them mashed together, any reason for that?
jos o
jos oOP8mo ago
Thats how Inertia structures projects https://github.com/inertiajs/inertia-rails
GitHub
GitHub - inertiajs/inertia-rails: The Rails adapter for Inertia.js.
The Rails adapter for Inertia.js. Contribute to inertiajs/inertia-rails development by creating an account on GitHub.
Brody
Brody8mo ago
does this mean that rails is serving the frontend?
jos o
jos oOP8mo ago
hold on I think I may have figured it out? I'm doing a redeploy to test
Brody
Brody8mo ago
I'm just trying to understand the practicality of mashing two very different languages into a singular folder, instead of a isolated monorepo style if you had this kind of structure, it would be a walk in the park to deploy onto railway
.
├── backend/
│ ├── Gemfile
│ └── ...
└── frontend/
├── package.json
└── ...
.
├── backend/
│ ├── Gemfile
│ └── ...
└── frontend/
├── package.json
└── ...
jos o
jos oOP8mo ago
Inertia essentiall allows a backend to use front end frameworks as views and feed data into frontend framework components as props directly as opposed to having to do api calls and having seperate applications I did figure it out though I needed to add vite build as a build step its working as expected now
Brody
Brody8mo ago
okay I think I understand the reasoning, happy you where about to get it working
Want results from more Discord servers?
Add your server