Skip to content

Latest commit

 

History

History
65 lines (39 loc) · 1.64 KB

File metadata and controls

65 lines (39 loc) · 1.64 KB

🐈‍⬛ SPACE CATS - LOCAL SETUP

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.

🐈‍⬛ SPACE CATS - BACKEND ENVIRONMENT VARIABLES

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.

🐈‍⬛ SPACE CATS - FRONTEND ENVIRONMENT VARIABLES

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.

🐈‍⬛ SPACE CATS - BUILDING THE APPLICATION

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

🐈‍⬛ SPACE CATS - TESTING THE APPLICATION

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