Deployment Failed during build process
when i try to deploy my project forntend and backend from github
need help to fix this issue
94 Replies
Project ID:
N/A
where to find project id
screenshot of railway project please
friendly tip, going forward, the cropped screenshots are not ideal
do you mean entire browser screen
for any future screenshots if you could, i would very much appreciate that
can you go ahead and detach the repo from the service? and then alt + shift + enter
should i push it again?
becoz i am new to this thats why i have to carefully listen to your instruction to understand it better
you didnt change anything in the repo yet?
plus, you removed the repo, pushing would do nothing (we want that though)
so theres a few things we need to change in your code, are you ready for that? (simple things)
yes ready
what are the two projects for?
both services taking me to the same project i think i messed something up
might be easter to start fresh? delete both projects
successfully deleted
show me a screenshot of the dashboard please
create a new empty project
your screen is cut off, zoom out
alright add a blank service to that project
name it
this will be your server service, so include that in the name
go ahead and set your
OPENAI_API_KEY
as a service variablenow code change time, ready for that?
great ready
your server's package.json, rename the
server
script to dev
.
add a new script called start
with the command node index.js
and then let me know when you have pushed those changespushed
okay perfect
set the root directory on the service to
/server
with small s
yeah since thats what the folder in the repo is named
got it
done
go ahead and add your repo
by clicking connect repo
yep
i applogise would you like to wait for while my father got some problem i have fix it
of course, go take care of that
thanks
back
welcome baack
add your repo
done
deploy it
there is qusetion
do i need another service variable for port
nope
thts what i got
well thats not good
build logs please https://bookmarklets.up.railway.app/log-downloader/
did you set the root directory to
/server
?oh
go generate a domain for it
done
what do you see when you visit the domain?
a json format file that says server is running
its mean al is well on backend
perfect
okay frontend time
or you call it the client
great
we also have code changes to make with that
your client is vite with vanilla js right?
yes
https://github.com/brody192/vite-react-template
(this is vite + react, but it should work all the same)
copy the nixpacks.toml and Caddyfile from this repo into your client folder
done
line 75 of index.js, change
http://localhost:3000
to import.meta.env.VITE_SERVER_URL
done
okay i think thats good for the code side of thing
go ahead and create a empty new service in your project
name it
GPT Client
done
set a service variable on the client
VITE_SERVER_URL
to https://${{GPT Server.RAILWAY_PUBLIC_DOMAIN}}
then click on its eye icon and make sure it renders properlyperfect, set the root directory to
/client
and connect your repodone
click deploy
all set
generate a domain for it
done
open the domain
does your app work?
it says nothing here yet
wait a minute
its running now
https://gpt-client.up.railway.app/
does it work?
yes it does but there is api key error
i am not abble to copy the key from open ai
have you provided the correct api key to the server?
the key has changed i am not abble to copy it from api keys
it was runnind day before yesterday all was set good
why cant you copy it?
its denying me from copyint key
wait i will try
im fairly certain you are allowed to copy your api key 😆
its not becoz of some security reason that what chat gpt answering ne by the way in all this i forgot to say you Thanks for your precious time and support in guiding me on each and every step
happy to help!
thansk 🫶