Made 2 parallel railway services, one serving the frontend and the other serving the backend
Its frontend railway service - https://4vinn-cypher.up.railway.app/
Its backend railway service - https://4vinn-cypher-be.up.railway.app/
For that, I restructured my repo into a monorepo, that looks like this:
.
├── .gitignore
├── README
├── frontend/
│ ├── public
│ ├── src
│ ├── package.json
│ └── package-lock.json
└── backend/
├── server.js
├── actions.js
├── package.json
└── package-lock.json
Created separate
package.jsonfor each backend and frontend, updated scipts/dependencies accordingly
Now, The
package-lock.jsonfile is used by npm to lock down the versions of dependencies to ensure consistent builds across different environments.
Regenerated thepackage-lock.jsonin each folder usinginstall --package-lock-only.
npm install:
When you run npm install:
-
It looks at your package.json file and installs the dependencies specified there.
-
If there's a package-lock.json file, it uses it to ensure that the exact versions of the dependencies are installed.
-
It creates or updates the node_modules folder in your project directory, which contains all the installed dependencies.
It also generates a package-lock.json file if one does not exist or updates it to reflect the current state of installed dependencies.
Made a railway service named "Cypher Code Editor - Frontend". Set the root dir to /frontend. Connected the github repo. Setuped the service variables. Generated a domain.
Made a railway service named "Cypher Code Editor - Backend". Set the root dir to /backend. Connected the github repo. Generated a domain.
On frontend service, set service variable to call the backend domain.
Other links:
_hidden_