I have a FrontEnd in React, it is production ready, I want railway to use Production Build

I'm trying to deploy a React App on Railway, but it runs out of memory. It keeps using npm start, but I guess that it should use the production environment, but it needs a server, How can I instruct Railway to use the production build instead of the development server, since it is heavier The Project ID is 4a0daac1-ea68-49b8-983f-e0e1cd9261fe
101 Replies
Percy
Percy10mo ago
Project ID: 4a0daac1-ea68-49b8-983f-e0e1cd9261fe
Brody
Brody10mo ago
follow this guide https://help.railway.app/project-help/f9v3gkPQRy4UShk5SnoPDH/getting-your-create-react-app-running-on-railway/qHRsgxa5n57xLp1yVgk9fP this isn't the first time I've sent you this guide, please just follow the guide this time
rafael.soteldo
rafael.soteldo10mo ago
ok
Brody
Brody10mo ago
but actually follow the guide, I didn't write it for fun, it will help you okay maybe a little fun
rafael.soteldo
rafael.soteldo10mo ago
another problem I'm facing is that the page keeps telling me that I'm on the trial plan, but I'm on the Pro Plan, I have the receipt. Maybe that can also be the problem. I don't receive an answer from the support team, maybe you can help me with it
Brody
Brody10mo ago
okay let's see the receipt please
rafael.soteldo
rafael.soteldo10mo ago
I also sent you what the railway page says
Brody
Brody10mo ago
click on your name, do you see a pro account option in the drop-down? also just curious, what was the reason for buying pro
rafael.soteldo
rafael.soteldo10mo ago
The React deployment now works
Brody
Brody10mo ago
and you followed the guide?
rafael.soteldo
rafael.soteldo10mo ago
the reason of buying pro is that, now that the deployed front end works, I also have a backend (with django/python) already working theat I want to also use yes I followed the guide the page keeps saying that i'm on trial
Brody
Brody10mo ago
okay so all good with your deployments? all problems there are solved?
rafael.soteldo
rafael.soteldo10mo ago
yes, the first part is solved, I already marked it as solved
Brody
Brody10mo ago
^
rafael.soteldo
rafael.soteldo10mo ago
No, I don't see it
Brody
Brody10mo ago
screenshot please
rafael.soteldo
rafael.soteldo10mo ago
Brody
Brody10mo ago
show me your dashboard now please
rafael.soteldo
rafael.soteldo10mo ago
Brody
Brody10mo ago
the dashboard
rafael.soteldo
rafael.soteldo10mo ago
sorry
rafael.soteldo
rafael.soteldo10mo ago
Brody
Brody10mo ago
i dont see an issue, it shows you that you are on the pro plan right there
rafael.soteldo
rafael.soteldo10mo ago
where?
rafael.soteldo
rafael.soteldo10mo ago
rafael.soteldo
rafael.soteldo10mo ago
i still see the trial plan
Brody
Brody10mo ago
Brody
Brody10mo ago
drag them
rafael.soteldo
rafael.soteldo10mo ago
rafael.soteldo
rafael.soteldo10mo ago
It is what I see
Brody
Brody10mo ago
my guy, i put big red circles, rectangles and even arrows for you drag them
rafael.soteldo
rafael.soteldo10mo ago
when trying to drag them, I get this
rafael.soteldo
rafael.soteldo10mo ago
What am I missing
Brody
Brody10mo ago
okay well there you go, now thats a problem
rafael.soteldo
rafael.soteldo10mo ago
what can I do now?
Brody
Brody10mo ago
nothing at the moment i will flag for team
rafael.soteldo
rafael.soteldo10mo ago
ok. By the way, can you help on deploting the django/python backend on railway?
Brody
Brody10mo ago
i thought you did that already also, why do you have two projects for the frontend and backend? they should be in the same project, can you please fix that
rafael.soteldo
rafael.soteldo10mo ago
I did, but i don´t trus it. I followed chatgpt on it ok
Brody
Brody10mo ago
then yes, i will see what i can do, but first merge those projects
rafael.soteldo
rafael.soteldo10mo ago
in order to merge them, if I just use axios to access the backend, now I don't know how to merge them
Brody
Brody10mo ago
no i meant the projects in railway, not your code delete the backend project from railway
rafael.soteldo
rafael.soteldo10mo ago
I deleted it, what do I do now? The backend project uses django not flask, in fact, I have never used Flask
Brody
Brody10mo ago
screenshot of dashboard please
rafael.soteldo
rafael.soteldo10mo ago
Brody
Brody10mo ago
now give that project a proper name
rafael.soteldo
rafael.soteldo10mo ago
Brody
Brody10mo ago
okay now open the project and show another screenshot
rafael.soteldo
rafael.soteldo10mo ago
I tried to deploy the backend, I got an er
Brody
Brody10mo ago
why did you try to deploy the backend in place of the frontend??? make a new service for the backend
rafael.soteldo
rafael.soteldo10mo ago
when you say a service, what do you mean?
Brody
Brody10mo ago
i mean a service
rafael.soteldo
rafael.soteldo10mo ago
how do I create a service, an app you say?
Brody
Brody10mo ago
Brody
Brody10mo ago
you close the current service and click the + new button
rafael.soteldo
rafael.soteldo10mo ago
ok, I guess it's a new app, how do I call it, manuback?
Brody
Brody10mo ago
give it a proper name "Menu Backend" with capitals and a space, make the name look presentable
rafael.soteldo
rafael.soteldo10mo ago
what do I choose here?
rafael.soteldo
rafael.soteldo10mo ago
i clicked this
Brody
Brody10mo ago
depends, is your backend code in a github repo? or locally
rafael.soteldo
rafael.soteldo10mo ago
i have it loccally, but I can upload it to github? do you want mw to do it?
Brody
Brody10mo ago
do you have the github cli or github desktop
rafael.soteldo
rafael.soteldo10mo ago
i have both cli I mean
Brody
Brody10mo ago
okay then put your backend on github
rafael.soteldo
rafael.soteldo10mo ago
ok done, I have the project on github
Brody
Brody10mo ago
okay can you share it
rafael.soteldo
rafael.soteldo10mo ago
ok it is public
Brody
Brody10mo ago
okay, share it
rafael.soteldo
rafael.soteldo10mo ago
what exactly do I have to do?
Brody
Brody10mo ago
send me the link
rafael.soteldo
rafael.soteldo10mo ago
GitHub
GitHub - rafaelsoteldosilva/menuback
Contribute to rafaelsoteldosilva/menuback development by creating an account on GitHub.
rafael.soteldo
rafael.soteldo10mo ago
it uses a postgres database,
Brody
Brody10mo ago
then you need to add a postgres database to your project
rafael.soteldo
rafael.soteldo10mo ago
how mdo I do that?
Brody
Brody10mo ago
+ new button we have been over this screenshot please
rafael.soteldo
rafael.soteldo10mo ago
I did this, I selected Postgres Provision now it asks for the tables
Brody
Brody10mo ago
screenshot please
rafael.soteldo
rafael.soteldo10mo ago
I have a migration on my backend which creates the inital tables for me, I saw in the Available Variables, that the database is already created, with the name railway. Now, I suppose that I have to update the variables in my settings.py file DATABASES to be in sync with the new database. I'm I right?
Brody
Brody10mo ago
first you need to structure your backend properly, use this as a reference https://github.com/railwayapp-templates/django
rafael.soteldo
rafael.soteldo10mo ago
What do I do there, click on the button Deploy on Railway? or I have to create some sort of railway.json in the root of the directory first?
Brody
Brody10mo ago
no, you need to fix your backend's folder structure and layout, and you will use that repo i just sent as a reference
rafael.soteldo
rafael.soteldo10mo ago
ok
Brody
Brody10mo ago
let me know when thats done
rafael.soteldo
rafael.soteldo10mo ago
I have a problem here, when I did the project, I created the project then an API inside of the project, so the structure of the project is something like: - MenuBackUp | |- requirements | |- backend | | |- manage.py | | |- api | | | |- migrations (folder) | | | |- utils (folder) | | | |- models.py | | | |- serializer.py | | | |- urls.py | | | |- ... | | |- menu_back | | | |- asgi.py | | | |- settings.py | | | |- urls.py | | | |- ...
Brody
Brody10mo ago
you need to fix your backend's folder structure and layout, and you will use that repo i just sent as a reference let me know when thats done
rafael.soteldo
rafael.soteldo10mo ago
As you can see, manage.py is inside backend, requirements is inseide the root directory, these won't be any problem since I can move them, but setting should be inside backend You could say that the folder backend is the project,if we consider the folder backend as the project, it would be
Brody
Brody10mo ago
please just fix it like I've been asking you to I gave you that repo for reference, use it
rafael.soteldo
rafael.soteldo10mo ago
it means that I should do the project again, not my code of couse, since the .env (environment) is in the current root, isn't there a way to leave the project as it is now?
Brody
Brody10mo ago
just move the folders and files around, you are overthinking this use the repo I sent as a reference for where folders and files should be
rafael.soteldo
rafael.soteldo10mo ago
your project has only one level, I moved everything to one level, and it doesn't work
Brody
Brody10mo ago
can I see these changes in your repo?
rafael.soteldo
rafael.soteldo10mo ago
not yet, wait
rafael.soteldo
rafael.soteldo10mo ago
GitHub
GitHub - rafaelsoteldosilva/menuproject
Contribute to rafaelsoteldosilva/menuproject development by creating an account on GitHub.
rafael.soteldo
rafael.soteldo10mo ago
in order to not overwriute the previous one, I uploaded it to a new project
Brody
Brody10mo ago
uh you made the structure worse not at all like the structure of the repo I sent you for reference
rafael.soteldo
rafael.soteldo10mo ago
your project has a pycache that has cache files, has a static folder with an empty file .gitkeep, and the rest is in the root folder, the new project is one level also, but doesn't share the __pycache and the static with the empti .gitkeep. I also kept the .env folder that has the environment, should I delete this .env folder, I don't think that it will work at all
Brody
Brody10mo ago
please use the repo I sent as a reference, you don't have to replicate everything exactly one to one, just use generally the same folder structure https://discord.com/channels/713503345364697088/1138499770625826867/1138536730899796068 I don't know how many more times I want to repeat myself
rafael.soteldo
rafael.soteldo10mo ago
GitHub
GitHub - rafaelsoteldosilva/menuproject
Contribute to rafaelsoteldosilva/menuproject development by creating an account on GitHub.
rafael.soteldo
rafael.soteldo10mo ago
I can delete the .env folder
Brody
Brody10mo ago
still no I'm sorry but I can't keep repeating myself over and over, I have a few other help threads that need my attention, so I unfortunately won't be able to provide you with any further assistance on this thread, I hope you are able to solve this!
rafael.soteldo
rafael.soteldo10mo ago
ok
Want results from more Discord servers?
Add your server
More Posts