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
Project ID:
4a0daac1-ea68-49b8-983f-e0e1cd9261fe
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
ok
but actually follow the guide, I didn't write it for fun, it will help you
okay maybe a little fun
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
okay let's see the receipt please
I also sent you what the railway page says
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
The React deployment now works
and you followed the guide?
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
okay so all good with your deployments? all problems there are solved?
yes, the first part is solved, I already marked it as solved
^
No, I don't see it
screenshot please
show me your dashboard now please
the dashboard
sorry
i dont see an issue, it shows you that you are on the pro plan right there
where?
i still see the trial plan
drag them
It is what I see
my guy, i put big red circles, rectangles and even arrows for you
drag them
when trying to drag them, I get this
What am I missing
okay well there you go, now thats a problem
what can I do now?
nothing at the moment
i will flag for team
ok. By the way, can you help on deploting the django/python backend on railway?
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
I did, but i don´t trus it. I followed chatgpt on it
ok
then yes, i will see what i can do, but first merge those projects
in order to merge them, if I just use axios to access the backend, now I don't know how to merge them
no i meant the projects in railway, not your code
delete the backend project from railway
I deleted it, what do I do now? The backend project uses django not flask, in fact, I have never used Flask
screenshot of dashboard please
now give that project a proper name
okay now open the project and show another screenshot
I tried to deploy the backend, I got an er
why did you try to deploy the backend in place of the frontend???
make a new service for the backend
when you say a service, what do you mean?
i mean a service
how do I create a service, an app you say?
you close the current service and click the + new button
ok, I guess it's a new app, how do I call it, manuback?
give it a proper name
"Menu Backend"
with capitals and a space, make the name look presentable
what do I choose here?
i clicked this
depends, is your backend code in a github repo? or locally
i have it loccally, but I can upload it to github? do you want mw to do it?
do you have the github cli or github desktop
i have both
cli I mean
okay then put your backend on github
ok
done, I have the project on github
okay can you share it
ok
it is public
okay, share it
what exactly do I have to do?
send me the link
GitHub
GitHub - rafaelsoteldosilva/menuback
Contribute to rafaelsoteldosilva/menuback development by creating an account on GitHub.
it uses a postgres database,
then you need to add a postgres database to your project
how mdo I do that?
+ new button
we have been over this
screenshot please
I did this, I selected Postgres Provision
now it asks for the tables
screenshot please
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?
first
you need to structure your backend properly, use this as a reference
https://github.com/railwayapp-templates/django
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?
no, you need to fix your backend's folder structure and layout, and you will use that repo i just sent as a reference
ok
let me know when thats done
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
| | | |- ...
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
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
please just fix it like I've been asking you to
I gave you that repo for reference, use it
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?
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
your project has only one level, I moved everything to one level, and it doesn't work
can I see these changes in your repo?
not yet, wait
GitHub
GitHub - rafaelsoteldosilva/menuproject
Contribute to rafaelsoteldosilva/menuproject development by creating an account on GitHub.
in order to not overwriute the previous one, I uploaded it to a new project
uh you made the structure worse
not at all like the structure of the repo I sent you for reference
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
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
GitHub
GitHub - rafaelsoteldosilva/menuproject
Contribute to rafaelsoteldosilva/menuproject development by creating an account on GitHub.
I can delete the .env folder
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!
ok