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
Project ID:
6fffdfd2-c120-4f52-b182-47039ff22c52
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
please share your repo
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
okay no worries, how many railway services do you currently have in your project?
3 , db , api , frontend
and does the api work?
yes this is the link of the api ...
https://notary-system-backend-latest-production.up.railway.app/api/schema/swager/
can you provide build and deploy logs for the frontend please https://bookmarklets.up.railway.app/log-downloader/
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
I really do need the logs that tool produces, what issues are you having with it?
ok it may take some time of me understanding it is that good
it would be a tremendous help
ok
thank you
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
show me a screenshot of that website please
can't drag something to the bookmarks bar with a bookmarks bar
enable it
sorry how did you get this menu bar i cant see it
new tab, right click on the space under the Omni bar
i got it
now what is next
use the tool
now i can drag it but how to send the logs to you
you send them here
id try dragging the link that the arrow points to
this one
looks good
ok now i have to drag it to railway deploy logs right
you just click it
build logs too please
thank you
do you have a start command set in the service settings?
if so, remove it
yes you can see its npm run build npm run dev
not in the settings but procfile
delete the procfile
build and deploy logs again please
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
well lets worry about getting the website up before we worry about what api url its using
ok
do you have a start command set in the service settings? if so, remove it
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
build and deploy logs again please
you know what im gonna say right?
no what is
do you have a start command set in the service settings? if so, remove it
what !! how is this happening
okay well hold on then
do you have a railway.json/railway.toml in your project
no i only have .toml and coddyfile
okay then please remove the start command
i know, i wrote them
i removed start command
sorry
so are you sure you removed the start command from the service settings?
yes i did
okay then redeploy it
do i need these
nope
ok
same error ,
screenshot of your projects files please
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
just a screenshot of the projects files, you should hide anything that may be sensitive
nothing that much sensitive right now since still in build mode i can send you the whole project if you it helps
screenshot is fine please
like this
on github, does this repo have multiple branches?
no
only main branch
did the start command come back?
in your service settings
github screenshoot
no
show me please
sorry yes
you are saving when you go to clear the start command right?
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
haha no problem!
how can i make this flow : frontend : myapp.com , api : api.myapp.com .
for this example, we assume you own myapp.com okay?
no but i will , easily i can purchase it from namecheap
i mean yes lets assume
it is already taken, we are using it as an example
sorry
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
ok then in namecheap i would just create such domain and its dns , actually i will be using cloudflare for dns config
you can use either namecheap or cloudflare for dns, both work with railway just fine
thanks man
no prob 🙂