To start project, you have to set configuration for client and server.
This project is using dotenv library for security.
Create /client/.env and add configuration.
BUILD_PATH='../server/dist'
REACT_APP_SERVER_URL=
REACT_APP_SERVER_SOCKET=
REACT_APP_SERVER_URL: Server URL for APIREACT_APP_SERVER_SOCKET: Server URL for websocket
Create /client/src/firebase-config.js and add configuration
import firebase from "firebase";
const firebaseConfig = {
apiKey: "FIREBASE_API_KEY",
authDomain: "FIREBASE_AUTH_DOMAIN",
projectId: "FIREBASE_PROJECT_ID",
storageBucket: "FIREBASE_STORAGE_BUCKET",
messagingSenderId: "FIREBASE_MESSAGEING_SENDER_ID",
appId: "FIREBASE_APP_ID",
measurementId: "FIREBASE_MEASERMENT_ID",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
export default firebase;For more explanation, refer to the document
Create /server/.env and add configuration.
SSH_USER=
SSH_PASSWORD=
SSH_HOST=
SSH_PORT=
DB_HOST=
DB_PORT=
DB_STRING=
DB_NAME=
CLIENT_ADDR=
FILTER_APPROVED_RESTAURANT=false
This server is connecting MongoDB via SSH. You may change connection method by modifying /server/models/index.js.
SSH_USER,SSH_PASSWORD,SSH_HOST,SSH_PORT: ssh configurationDB_HOST,DB_PORT,DB_STRING,DB_NAME: MongoDB configuration with respoect to server itself. Default value may be127.0.0.1forDB_HOSTand27017forDB_PORT.CLIENT_ADDR: Deployed client address orhttp://localhost:3000for developmentFILTER_APPROVED_RESTAURANT: This configuration was for displaying only approved restaurant. However, approve system has not been implemented so setting this value astruewill not show any restaurants in the service.