You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a Firebase project and selectthe web app
58
57
59
58
1. Add your Firebase config to `.env.development`. Note that `NEXT_PUBLIC_MEASUREMENT_ID` is optional
60
59
61
60
1. Make sure you have enabled the following Firebase services:
62
61
63
-
- Authentication. Enable the Google sign-in method.
64
-
- Cloud Firestore. Create a database and set its location to your nearest region.
65
-
- Cloud Storage. Create a storage bucket.
62
+
- Authentication. Enable the Google sign-in method.
63
+
- Cloud Firestore. Create a database and set its location to your nearest region.
64
+
- Cloud Storage. Create a storage bucket.
66
65
67
66
1. Install Firebase CLI globally
68
67
69
-
```bash
70
-
npm i -g firebase-tools
71
-
```
68
+
```bash
69
+
npm i -g firebase-tools
70
+
```
72
71
73
72
1. Log in to Firebase
74
73
75
-
```bash
76
-
firebase login
77
-
```
74
+
```bash
75
+
firebase login
76
+
```
78
77
79
78
1. Get your project ID
80
79
81
-
```bash
82
-
firebase projects:list
83
-
```
80
+
```bash
81
+
firebase projects:list
82
+
```
84
83
85
84
1. Select your project ID
86
85
87
-
```bash
88
-
firebase use your-project-id
89
-
```
86
+
```bash
87
+
firebase use your-project-id
88
+
```
90
89
91
90
1. At this point, you have two choices. Either run this project using the Firebase on the cloud or locally using emulator.
92
91
93
-
1. Using the Firebase Cloud Backend:
92
+
1. Using the Firebase Cloud Backend:
94
93
95
-
1. Deploy Firestore rules, Firestore indexes, and Cloud Storage rules
94
+
1. Deploy Firestore rules, Firestore indexes, and Cloud Storage rules
96
95
97
-
```bash
98
-
firebase deploy --except functions
99
-
```
96
+
```bash
97
+
firebase deploy --except functions
98
+
```
100
99
101
-
1. Run the project
100
+
1. Run the project
102
101
103
-
```bash
104
-
npm run dev
105
-
```
102
+
```bash
103
+
npm run dev
104
+
```
106
105
107
-
1. Using Firebase Local Emulator:
106
+
1. Using Firebase Local Emulator:
108
107
109
-
1. Install [Java JDK version 11 or higher](https://jdk.java.net/) before proceeding. This is required to run the emulators.
108
+
1. Install [Java JDK version 11 or higher](https://jdk.java.net/) before proceeding. This is required to run the emulators.
110
109
111
-
1. Set the environment variable `NEXT_PUBLIC_USE_EMULATOR` to `true`in`.env.development`. This will make the app use the emulators instead of the cloud backend.
110
+
1. Set the environment variable `NEXT_PUBLIC_USE_EMULATOR` to `true`in`.env.development`. This will make the app use the emulators instead of the cloud backend.
112
111
113
-
1. At this point, you can run the following command to have a fully functional Twitter clone running locally:
112
+
1. At this point, you can run the following command to have a fully functional Twitter clone running locally:
114
113
115
-
```bash
116
-
npm run dev:emulators
117
-
```
114
+
```bash
115
+
npm run dev:emulators
116
+
```
118
117
119
118
>**_Note_**: When you deploy Firestore indexes rules, it might take a few minutes to complete. So before the indexes are enabled, you will get an error when you fetch the data from Firestore.<br><br>You can check the status of your Firestore indexes with the link below, replace `your-project-id` with your project ID: https://console.firebase.google.com/u/0/project/your-project-id/firestore/indexes
120
119
121
120
Optional:
122
121
123
-
- If you want to get trending data from Twitter API, you need to create a Twitter developer account and get your API keys. Then add your API keys to `.env.development`. I hope Elon Musk doesn't make this API paid 😅.
124
-
- If you want to make the user stats synced with the deleted tweets, you need to enable the Cloud Functions for Firebase. Then deploy the Cloud Functions.
122
+
- If you want to get trending data from Twitter API, you need to create a Twitter developer account and get your API keys. Then add your API keys to `.env.development`. I hope Elon Musk doesn't make this API paid 😅.
123
+
- If you want to make the user stats synced with the deleted blabs, you need to enable the Cloud Functions for Firebase. Then deploy the Cloud Functions.
0 commit comments