R
Railway10mo ago
MiguelSc

problems with deploy

I don't know what's happening that won't let me deploy my server
No description
75 Replies
Percy
Percy10mo ago
Project ID: N/A
MiguelSc
MiguelScOP10mo ago
GitHub
GitHub - MiguelSc66/VS-Proyect
Contribute to MiguelSc66/VS-Proyect development by creating an account on GitHub.
Brody
Brody10mo ago
you have your Google client id and key in a .env file in a public repo, please go and re-generate them after that's done we will tackle deploying both frontend and backend onto railway properly
MiguelSc
MiguelScOP10mo ago
delete them, they are useless
Brody
Brody10mo ago
okay whatever works for you can you show me a screenshot of your railway project just so I know what we are working with
MiguelSc
MiguelScOP10mo ago
Yes, do you need the project configuration in railway?
Brody
Brody10mo ago
a screenshot will suffice for right now, I'll of course have more questions as we go
MiguelSc
MiguelScOP10mo ago
No description
MiguelSc
MiguelScOP10mo ago
I have the start command in npm run start, the build command is empty, and the path is server I have two because I was trying various things in different
Brody
Brody10mo ago
two is needed because you have both a backend and a frontend
MiguelSc
MiguelScOP10mo ago
Yes, but the front is the least important thing, the important thing is the backend and the database because the only thing I can't connect now is that
Brody
Brody10mo ago
fair enough, but there are some very big pitfalls people (including you) will run into when deploying the frontend how you have it currently, but yes let's do the backend first do you have all the needed database variables setup on the service?
MiguelSc
MiguelScOP10mo ago
Before I had everything set up, but I accidentally deleted the railwey server and I don't remember how to configure it, that's why I have this problem now haha yes, PORT y DB_DEPLOY DB_DEPLOY = URL
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
remove the PORT variable, not sure whats thats doing there
MiguelSc
MiguelScOP10mo ago
ok
Brody
Brody10mo ago
can you explain your start script to me? npm run server && npm run api it should just be node index.js
MiguelSc
MiguelScOP10mo ago
It was an old code and I left it as it was and added that last bit to test if it worked that they recommend that you accommodate
Brody
Brody10mo ago
okay, please make the change i suggested
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
remove the start command you have set in the service settings please
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
set the root directory to /server
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
deploy the changes
MiguelSc
MiguelScOP10mo ago
[Region: us-west1] ============== Using Nixpacks ============== context: 4a43c7f96e3e643f43d3cf9b92568d73 Nixpacks build failed ╔════════ Nixpacks v1.21.2 ═══════╗ ║ setup │ nodejs_18, npm-9_x ║ ║─────────────────────────────────║ ║ start │ ║ ╚═════════════════════════════════╝ Error: No start command could be found
Brody
Brody10mo ago
retake this screenshot please also, going forward, always use this to send logs please https://bookmarklets.up.railway.app/log-downloader/
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
not quite the same screenshot
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
you have not yet set a root directory please do that I think you set a watch path? please undo that, you need to set a root directory
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
retake this screenshot please
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
okay looks like it's deploying
MiguelSc
MiguelScOP10mo ago
Thank you very much, everything works again, I have a question about this: npm WARN config production Use --omit=dev instead.
[email protected] start
node index.js
Model loaded: Model loaded: Model loaded: Model loaded: Model loaded: Associations defined. Server listening on port: 5849 Everything is fine, it's just that, but I want to know if it could become a problem later on. it would be the npm thing
Brody
Brody10mo ago
that warning? it's truly of no concern
MiguelSc
MiguelScOP10mo ago
Thank you very much, if it weren't for your help I would have gone bald from stress jaja
Brody
Brody10mo ago
well we still need to do the frontend, because as it stands, you're about to deploy a development server, that's going to be costly and have terrible performance
MiguelSc
MiguelScOP10mo ago
okay, let's check it
Brody
Brody10mo ago
okay after dinner
MiguelSc
MiguelScOP10mo ago
Okey perfect If you want, send me the request and write to me privately when you are ready. but mention me and I will come
Brody
Brody10mo ago
rename that failed service to something that relates to your frontend, it is going to be the frontend service now
MiguelSc
MiguelScOP10mo ago
okey
Brody
Brody10mo ago
and then a screenshot of when thats done please
MiguelSc
MiguelScOP10mo ago
But does railwey serve to build a front end?
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
you are skipping steps here, railway does not serve anything itself, railway is going to run your start script, and your start script starts a development server
MiguelSc
MiguelScOP10mo ago
do we use vercel?
Brody
Brody10mo ago
heck no, we shill railway here
MiguelSc
MiguelScOP10mo ago
sorry
Brody
Brody10mo ago
theres ways to do nearly everything, so lets get railway to run a production grade server instead first off, do you have any start or build commands set in the frontend service?
MiguelSc
MiguelScOP10mo ago
I think if npm run build, it compiles everything with webpack
Brody
Brody10mo ago
that is correct, we just have to have a way to serve those files, and we will do so like this https://github.com/brody192/create-react-app-starter copy the nixpacks.toml and Caddyfile from this repo into your client folder
MiguelSc
MiguelScOP10mo ago
Client or Server?
Brody
Brody10mo ago
client
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
push the changes
MiguelSc
MiguelScOP10mo ago
ready
Brody
Brody10mo ago
let me know if something goes wrong
MiguelSc
MiguelScOP10mo ago
okey I think everything turned out well
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
open it up
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
haha i meant open the frontend's domain
MiguelSc
MiguelScOP10mo ago
No description
MiguelSc
MiguelScOP10mo ago
No description
MiguelSc
MiguelScOP10mo ago
No description
Brody
Brody10mo ago
working now?
MiguelSc
MiguelScOP10mo ago
the console shows that, but the link doesn't show anything
Brody
Brody10mo ago
send the link please
MiguelSc
MiguelScOP10mo ago
Brody
Brody10mo ago
it works?
MiguelSc
MiguelScOP10mo ago
now yes haha
Brody
Brody10mo ago
great!
Want results from more Discord servers?
Add your server