Might not be very efficient if you're hosting it on places like heroku and railway where they give you long links, but if you get a domain and everything, it works 😃👍
- To run the backend server, go into the
backend
folder, and runinstall_deps.bat
. Once the installation of the required modules is complete, go into thesrc
folder and runrun.bat
. - To run the frontend server, go into the
frontend
folder, and runinstall_deps.bat
. Once the required modules have been installed, open a new terminal window and runnpm start
in the same directory as thepackage.json
file.
Limitations:
- Will reset database, every time API restarts.
- API goes to sleep after a certain amount of inactivity.
Procedure:
- Download the heroku CLI
- Download Git (Make sure to 'add to PATH')
- Once downloaded, open up your terminal and type
heroku login
- Make a new file called
Procfile
(with no extension) and in that file, typeweb: node index.js
- Make sure to change the port of your express API to
process.env.PORT
- You must have the
node_modules
folder when deploying. - Open a new terminal and navigate to the directory with the API in it.
- Type
git init
- Type
git add .
- Type
git commit -m "anything you want, or you could just leave this as is"
- Type
heroku create
orheroku create {any name you would like
- Then type
git push heroku main
, if that doesn't work typegit push heroku master
Procedure:
- Create a github repository, and upload the files for frontend and backend in separate branches.
- Create an account at https://railway.app/, and link your github account (https://railway.app/account).
- Go to the dashboard (https://railway.app/dashboard), and click
New Project
. - Click
Deploy From Repo
- Select the github repository you saved your code to, and select the correct branch
- Click
Deploy
, sit back, and relax - Don't forget to change the baseURL in the
config.json
in thefrontend
'ssrc
folder to your newly railway-hosted API URL.