Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,31 @@ Ctrix Chat is a real-time chat application built with React and Firebase. It all
* Create a new project on the [Firebase Console](https://console.firebase.google.com/).
* Add a new web app to your Firebase project.
* Copy your Firebase configuration.
* Create a `.env` file in the root of the project and add your Firebase config:
* Create a `.env` file in the root of the project and add your Firebase config. Make sure to use the correct variables for your environment (Development or Production).

### For Development
```
REACT_APP_FIREBASE_DEV_API_KEY=your-dev-api-key
REACT_APP_FIREBASE_DEV_AUTH_DOMAIN=your-dev-auth-domain
REACT_APP_FIREBASE_DEV_PROJECT_ID=your-dev-project-id
REACT_APP_FIREBASE_DEV_STORAGE_BUCKET=your-dev-storage-bucket
REACT_APP_FIREBASE_DEV_MESSAGING_SENDER_ID=your-dev-sender-id
REACT_APP_FIREBASE_DEV_APP_ID=your-dev-app-id
```

### For Production
```
REACT_APP_FIREBASE_API_KEY=your-api-key
REACT_APP_FIREBASE_AUTH_DOMAIN=your-auth-domain
REACT_APP_FIREBASE_PROJECT_ID=your-project-id
REACT_APP_FIREBASE_STORAGE_BUCKET=your-storage-bucket
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
REACT_APP_FIREBASE_APP_ID=your-app-id
REACT_APP_GIPHY_API_KEY=your-giphy-api-key
```
* You will also need to get a Giphy API key from the [Giphy Developer Portal](https://developers.giphy.com/).
```
REACT_APP_GIPHY_API_KEY=your-giphy-api-key
```

6. **Run the development server**
```sh
Expand Down
4 changes: 2 additions & 2 deletions src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getAuth } from "firebase/auth";

const Development_Backend = {
apiKey: process.env.REACT_APP_FIREBASE_DEV_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_DEV_AUTHDOMAIN,
authDomain: process.env.REACT_APP_FIREBASE_DEV_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_DEV_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_DEV_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_DEV_MESSAGING_SENDER_ID,
Expand All @@ -14,7 +14,7 @@ const Development_Backend = {

const Production_Backend = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTHDOMAIN,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
Expand Down