R
Railway•14mo ago
Devmoha

deploy drf api and react vite app in railway app

i have drf api and react vite app for notary system i built now the api is being deployed and live in railway app but the react vite is not i tried to use caddy but it just show the vite+react starter page not my actual website please help , thanks
93 Replies
Percy
Percy•14mo ago
Project ID: 6fffdfd2-c120-4f52-b182-47039ff22c52
Devmoha
Devmoha•14mo ago
6fffdfd2-c120-4f52-b182-47039ff22c52 after some research i made , i used caddyfile and .toml file and copied the code from github link i found but still i have the error application failed to respond
Brody
Brody•14mo ago
please share your repo
Devmoha
Devmoha•14mo ago
its notary system for private company but please share me the general roadmap of solving my problem , i want api : api.myapp.com , frontend: myapp.com . but before that i want use railway generated domains it private repo for context i am using two different repo , one for api , one for frontend react vite app
Brody
Brody•14mo ago
okay no worries, how many railway services do you currently have in your project?
Devmoha
Devmoha•14mo ago
3 , db , api , frontend
Brody
Brody•14mo ago
and does the api work?
Brody
Brody•14mo ago
can you provide build and deploy logs for the frontend please https://bookmarklets.up.railway.app/log-downloader/
Devmoha
Devmoha•14mo ago
yep let me understand this sorry , i have not understood bookmarklet but this is the error i am getting in logs /bin/bash: npm: command not found /bin/bash: npm: command not found /bin/bash: npm: command not found /bin/bash: npm: command not found /bin/bash: npm: command not found /bin/bash: npm: command not found and in the frontend so far i have copied .toml file and coddyfile , one thing i have not changed is the link of the api my frontend is directing or looking is still the local one . CRASHED Deployment has crashed
Brody
Brody•14mo ago
I really do need the logs that tool produces, what issues are you having with it?
Devmoha
Devmoha•14mo ago
ok it may take some time of me understanding it is that good
Brody
Brody•14mo ago
it would be a tremendous help
Devmoha
Devmoha•14mo ago
ok
Brody
Brody•14mo ago
thank you
Devmoha
Devmoha•14mo ago
1. Drag the bookmarklet to your bookmarks bar , please clarify what drag is meaning in this context , i have made bookmarklet as my favorites in my browser
Brody
Brody•14mo ago
show me a screenshot of that website please
Devmoha
Devmoha•14mo ago
No description
Brody
Brody•14mo ago
can't drag something to the bookmarks bar with a bookmarks bar
Brody
Brody•14mo ago
No description
Brody
Brody•14mo ago
enable it
Devmoha
Devmoha•14mo ago
sorry how did you get this menu bar i cant see it
Brody
Brody•14mo ago
new tab, right click on the space under the Omni bar
Devmoha
Devmoha•14mo ago
i got it now what is next
Brody
Brody•14mo ago
use the tool
Devmoha
Devmoha•14mo ago
now i can drag it but how to send the logs to you
Brody
Brody•14mo ago
you send them here
Brody
Brody•14mo ago
id try dragging the link that the arrow points to
Devmoha
Devmoha•14mo ago
No description
Devmoha
Devmoha•14mo ago
this one
Brody
Brody•14mo ago
looks good
Devmoha
Devmoha•14mo ago
ok now i have to drag it to railway deploy logs right
Brody
Brody•14mo ago
you just click it
Brody
Brody•14mo ago
build logs too please
Brody
Brody•14mo ago
thank you do you have a start command set in the service settings? if so, remove it
Devmoha
Devmoha•14mo ago
yes you can see its npm run build npm run dev not in the settings but procfile
Brody
Brody•14mo ago
delete the procfile
Devmoha
Devmoha•14mo ago
i did now i pushed the update https://web-production-51976.up.railway.app/ , link of the frontend
Brody
Brody•14mo ago
build and deploy logs again please
Devmoha
Devmoha•14mo ago
one thing i think is causing the error is my app is not directing the exact api link rather its links to the local one which is not working any more
Brody
Brody•14mo ago
well lets worry about getting the website up before we worry about what api url its using
Devmoha
Devmoha•14mo ago
ok
Brody
Brody•14mo ago
do you have a start command set in the service settings? if so, remove it
Devmoha
Devmoha•14mo ago
let me check wow there was start command and i did not write it but now i removed https://web-production-51976.up.railway.app/ server Error
Brody
Brody•14mo ago
build and deploy logs again please
Brody
Brody•14mo ago
you know what im gonna say right?
Devmoha
Devmoha•14mo ago
no what is
Brody
Brody•14mo ago
do you have a start command set in the service settings? if so, remove it
Devmoha
Devmoha•14mo ago
what !! how is this happening
Brody
Brody•14mo ago
okay well hold on then do you have a railway.json/railway.toml in your project
Devmoha
Devmoha•14mo ago
no i only have .toml and coddyfile
Brody
Brody•14mo ago
okay then please remove the start command i know, i wrote them
Devmoha
Devmoha•14mo ago
i removed start command sorry
Brody
Brody•14mo ago
so are you sure you removed the start command from the service settings?
Devmoha
Devmoha•14mo ago
No description
Devmoha
Devmoha•14mo ago
yes i did
Brody
Brody•14mo ago
okay then redeploy it
Devmoha
Devmoha•14mo ago
do i need these
Brody
Brody•14mo ago
nope
Devmoha
Devmoha•14mo ago
ok
Brody
Brody•14mo ago
screenshot of your projects files please
Devmoha
Devmoha•14mo ago
one suspect i have is this "Using the nixpacks.toml config file in your code". when i click it goes https://github.com/Dev-Moa/Notary-system-frontend/settings/main, which 404 link , may be this one needs the one defined in my project which file please specifically
Brody
Brody•14mo ago
just a screenshot of the projects files, you should hide anything that may be sensitive
Devmoha
Devmoha•14mo ago
nothing that much sensitive right now since still in build mode i can send you the whole project if you it helps
Brody
Brody•14mo ago
screenshot is fine please
Devmoha
Devmoha•14mo ago
No description
Devmoha
Devmoha•14mo ago
like this
Brody
Brody•14mo ago
on github, does this repo have multiple branches?
Devmoha
Devmoha•14mo ago
no only main branch
Brody
Brody•14mo ago
did the start command come back? in your service settings
Devmoha
Devmoha•14mo ago
github screenshoot
No description
Devmoha
Devmoha•14mo ago
no
Brody
Brody•14mo ago
show me please
Devmoha
Devmoha•14mo ago
sorry yes
Brody
Brody•14mo ago
you are saving when you go to clear the start command right?
No description
Devmoha
Devmoha•14mo ago
no i was not saving but see before you send the screenshoot i have this tick save button and now i saved it lets see the result and now its up and running wow thanks million times man you are patient and also you know what you are tellings
Brody
Brody•14mo ago
haha no problem!
Devmoha
Devmoha•14mo ago
how can i make this flow : frontend : myapp.com , api : api.myapp.com .
Brody
Brody•14mo ago
for this example, we assume you own myapp.com okay?
Devmoha
Devmoha•14mo ago
no but i will , easily i can purchase it from namecheap i mean yes lets assume
Brody
Brody•14mo ago
it is already taken, we are using it as an example
Devmoha
Devmoha•14mo ago
sorry
Brody
Brody•14mo ago
in your railway service for the frontend, in its settings you would add myapp.com to the custom domains, then in the railway service for the backend (in its settings too) you would add api.myapp.com to the custom domains
Devmoha
Devmoha•14mo ago
ok then in namecheap i would just create such domain and its dns , actually i will be using cloudflare for dns config
Brody
Brody•14mo ago
you can use either namecheap or cloudflare for dns, both work with railway just fine
Devmoha
Devmoha•14mo ago
thanks man
Brody
Brody•14mo ago
no prob 🙂
Want results from more Discord servers?
Add your server