# Getting Started with Crime Mapping Web Application

## Development Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

### `npm run deploy`

Run this command to deploy the app to Firebase. **NOTE:** you have to be logged into your Firebase account to run this command

## Deployment to Firebase Scripts

Run the following commands if you want to deploy the app to Firebase

### `Setup Firebase Credentials`

Create a `.env` file in the root of the project

Add the following variables and obtain the credentials from Firebase and Google Cloud Console

```
REACT_APP_FB_API_KEY=<key>
REACT_APP_FB_AUTH_DOMAIN=<domain>
REACT_APP_FB_PROJECT_ID=<project id>
REACT_APP_FB_STORAGE_BUCKET=<bucket>
REACT_APP_FB_MESSAGE_SENDER_ID=<sender id>
REACT_APP_FB_APP_ID=<app id>
REACT_APP_FB_MEASUREMENT_ID=<measurement id>
REACT_APP_GOOGLE_API_KEY=<google api key>
```

### `npm run fb:install`

**NOTE:** Run this command if you need to install the Firebase CLI. If you have it installed, you can skip this step.

### `npm run fb:login`

Run this command to log into your Firebase account from the CLI.

### `npm run fb:logout`

Run this command to log out of your Firebase account from the CLI.

### `npm run fb:deploy`

Once logged in, you can run this command to deploy the app to your logged in Firebase account.
