Space Cats is set up to deploy the application locally or via hosting services.
.env files in both the frontend and backend packages dictate the behaviour of Space Cats.
Create a .env file in the root of the backend directory and set the following variables:
NODE_ENV=PRODUCTION
FRONTEND_PROD_URL=https://space-cats.vercel.app
FRONTEND_LOCAL_URL=http://localhost:3000
The application will run locally if the NODE_ENV variable does not equal production.
It would help if you also assigned values for the variables PORT, TOKEN_KEY and MONGO_URL.
They are required for the application to run seamlessly.
Create a .env file in the root of the frontend directory and set the following variables:
REACT_BACK_END_URL=https://space-cats-production.up.railway.app
REACT_APP_ENV=PRODUCTION
The application will run locally if the REACT_APP_ENV variable does not equal production.
If the web server URL above does not work, please use backup web server instead.
To build the backend from the root directory, type in:
npm run start:backend
Likewise, to build the frontend from the root directory, use the command:
npm run start:backend
To run the backend tests from the root directory:
npm run test:backend
Likewise, to run the frontend tests from the root directory:
npm run test:frontend