R
Railway•10mo ago
MamaRail

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
Percy
Percy•10mo ago
Project ID: N/A
MamaRail
MamaRailOP•10mo ago
where to find project id
Brody
Brody•10mo ago
build logs please https://bookmarklets.up.railway.app/log-downloader/ and please share your repo
Brody
Brody•10mo ago
screenshot of railway project please
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
friendly tip, going forward, the cropped screenshots are not ideal
MamaRail
MamaRailOP•10mo ago
do you mean entire browser screen
Brody
Brody•10mo ago
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
MamaRail
MamaRailOP•10mo ago
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
Brody
Brody•10mo ago
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)
MamaRail
MamaRailOP•10mo ago
No description
No description
MamaRail
MamaRailOP•10mo ago
yes ready
Brody
Brody•10mo ago
what are the two projects for?
MamaRail
MamaRailOP•10mo ago
both services taking me to the same project i think i messed something up
Brody
Brody•10mo ago
might be easter to start fresh? delete both projects
MamaRail
MamaRailOP•10mo ago
successfully deleted
Brody
Brody•10mo ago
show me a screenshot of the dashboard please
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
create a new empty project
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
your screen is cut off, zoom out
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
alright add a blank service to that project
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
name it this will be your server service, so include that in the name
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
go ahead and set your OPENAI_API_KEY as a service variable
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
now code change time, ready for that?
MamaRail
MamaRailOP•10mo ago
great ready
Brody
Brody•10mo ago
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 changes
MamaRail
MamaRailOP•10mo ago
pushed
Brody
Brody•10mo ago
okay perfect set the root directory on the service to /server
MamaRail
MamaRailOP•10mo ago
with small s
Brody
Brody•10mo ago
yeah since thats what the folder in the repo is named
MamaRail
MamaRailOP•10mo ago
got it done
Brody
Brody•10mo ago
go ahead and add your repo
MamaRail
MamaRailOP•10mo ago
by clicking connect repo
Brody
Brody•10mo ago
yep
MamaRail
MamaRailOP•10mo ago
i applogise would you like to wait for while my father got some problem i have fix it
Brody
Brody•10mo ago
of course, go take care of that
MamaRail
MamaRailOP•10mo ago
thanks back
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
welcome baack add your repo
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
deploy it
MamaRail
MamaRailOP•10mo ago
there is qusetion do i need another service variable for port
Brody
Brody•10mo ago
nope
MamaRail
MamaRailOP•10mo ago
No description
MamaRail
MamaRailOP•10mo ago
thts what i got
Brody
Brody•10mo ago
well thats not good build logs please https://bookmarklets.up.railway.app/log-downloader/
Brody
Brody•10mo ago
did you set the root directory to /server ?
MamaRail
MamaRailOP•10mo ago
oh
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
go generate a domain for it
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
what do you see when you visit the domain?
MamaRail
MamaRailOP•10mo ago
a json format file that says server is running its mean al is well on backend
Brody
Brody•10mo ago
perfect okay frontend time or you call it the client
MamaRail
MamaRailOP•10mo ago
great
Brody
Brody•10mo ago
we also have code changes to make with that your client is vite with vanilla js right?
MamaRail
MamaRailOP•10mo ago
yes
Brody
Brody•10mo ago
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
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
line 75 of index.js, change http://localhost:3000 to import.meta.env.VITE_SERVER_URL
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
okay i think thats good for the code side of thing go ahead and create a empty new service in your project
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
name it GPT Client
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
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 properly
MamaRail
MamaRailOP•10mo ago
No description
Brody
Brody•10mo ago
perfect, set the root directory to /client and connect your repo
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
click deploy
MamaRail
MamaRailOP•10mo ago
all set
No description
Brody
Brody•10mo ago
generate a domain for it
MamaRail
MamaRailOP•10mo ago
done
Brody
Brody•10mo ago
open the domain does your app work?
MamaRail
MamaRailOP•10mo ago
it says nothing here yet
No description
Brody
Brody•10mo ago
wait a minute
MamaRail
MamaRailOP•10mo ago
Brody
Brody•10mo ago
does it work?
MamaRail
MamaRailOP•10mo ago
yes it does but there is api key error i am not abble to copy the key from open ai
Brody
Brody•10mo ago
have you provided the correct api key to the server?
MamaRail
MamaRailOP•10mo ago
the key has changed i am not abble to copy it from api keys it was runnind day before yesterday all was set good
Brody
Brody•10mo ago
why cant you copy it?
MamaRail
MamaRailOP•10mo ago
its denying me from copyint key wait i will try
Brody
Brody•10mo ago
im fairly certain you are allowed to copy your api key 😆
MamaRail
MamaRailOP•10mo ago
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
Brody
Brody•10mo ago
happy to help!
MamaRail
MamaRailOP•10mo ago
thansk 🫶
Want results from more Discord servers?
Add your server