To setup a local development environment, follow the steps given below.
- Ensure you have NodeJS, npm installed in your system.
- Fork and then clone the repository
$ git clone https://github.com/<your-username>/React-Blog-WebApp
- Copy the
.env.example
file and install dependencies inclient
folder
$ cd client
$ cp .env.example .env
$ npm install
- Copy the
.env.example
file and install dependencies inserver
folder
$ cd ..
$ cd server
$ cp .env.example .env
$ npm install
- Open the newly created
.env
files inclient
andserver
folders and populate them with your registered keys - Create a firebase project and download the
serviceAccountKey.json
from your project and copy it to/server/firebase
- In your firebase console, go to
Project Settings -> General
, scroll down and select the npm option. - From the code-block below, copy ONLY the
json object
of the form:
{
apiKey: "********",
authDomain: "********",
databaseURL: "********",
projectId: "********",
.
.
}
- Create a file
/server/firebase/firebaseConfig.js
and paste the previously copied json in the file and then export it as follows:
module.exports = {
apiKey: "********",
authDomain: "********",
.
.
}
- Copy the
databaseURL
from the json object and paste it in the appropriate field in/server/.env
file - Start the development servers
$ cd server
$ npm start
$ cd client
$ npm start
At the end of this, you should have
Client running at localhost:3000
Server running at localhost:3001