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
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+36-68
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Table of Content
2
+
2
3
-[Table of Content](#table-of-content)
3
4
-[User Guide](#user-guide)
4
5
-[Prerequisites](#prerequisites)
@@ -13,33 +14,35 @@
13
14
# User Guide
14
15
15
16
## Prerequisites
17
+
16
18
- Node.js version 14.
17
19
- Java JDK version 11 or higher. (For running emulators)
18
20
- make command line tool. ( optional )
19
-
> 📝**NOTE** : `make` is optional here. You can open `Makefile` and type the associated command manually also, but it is recommended to use `make` so you don't need to run multiple commands.
20
-
>
21
-
21
+
> 📝**NOTE** : `make` is optional here. You can open `Makefile` and type the associated command manually also, but it is recommended to use `make` so you don't need to run multiple commands.
22
22
23
23
## Project Setup
24
+
24
25
> 📝**NOTE**: Make sure that you are using version 14 of node.
25
26
26
27
> ⚡**Tip**: You can use nvm (node version manager) tool to install multiple node versions and can switch between them easily.
28
+
27
29
1. Fork the repo as your own copy.
28
30
2. Click on `Code` button and then copy HTTPs link. ( it will look like this `https://github.com/<YOUR_USERNAME>/Codelabz.git`)
29
31
3. Clone the repo by running `git clone https://github.com/<YOUR_USERNAME>/Codelabz.git`
30
32
4. Go to the folder `cd Codelabz`.
31
33
5. Run `npm install` or `make install`( this will install all the dependencies in your project)
32
-
6. Create a `.env` file in root of directory.
34
+
6. Create a `.env` file in root of directory.
33
35
7. Setup firebase and get your own set of keys. ( follow steps in [Firebase Setup](#firebase-setup) section to setup firebase )
34
36
8. Copy all the key fields from `.env.sample` and place your own set of values there.
35
-
9. Setup husky ( follow steps in [Husky Setup](#husky-setup) section to setup firebase )
36
-
10. Run `npm run dev`.
37
-
11. Visit [http://127.0.0.1:5173/](http://127.0.0.1:5173/) in your preferred browser.
37
+
9. Run `npm run dev`.
38
+
10. Visit [http://127.0.0.1:5173/](http://127.0.0.1:5173/) in your preferred browser.
38
39
39
-
>📝**NOTE** : Above steps are enough for you to get started with the Codelabz app. If you want to access the database you need to start the emulators.For setup husky follow [Husky Setup](#husky-setup)
40
+
>📝**NOTE** : Above steps are enough for you to get started with the Codelabz app. If you want to access the database you need to start the emulators.For setup husky follow [Husky Setup](#husky-setup)
40
41
41
42
### Using Docker-Compose
42
-
You can also use docker-compose to setup your project. Simply create your `.env` file and run
43
+
44
+
You can also use docker-compose to setup your project. Simply create your `.env` file and run
45
+
43
46
```
44
47
docker-compose up
45
48
```
@@ -50,74 +53,38 @@ This will setup your project along with firebase emulator in a docker environmen
50
53
51
54
52
55
53
-
## Husky Setup
54
-
55
-
1.install Husky and lint-staged by running the following command
56
-
```
57
-
npm install husky lint-staged --save-dev
58
-
```
59
-
2. create lint-staged.config.js file in root directory and add following code
60
-
```
61
-
module.exports = {
62
-
'**/*': ['npm run lint', 'npm run format', 'git add'],
63
-
};
64
-
65
-
```
66
-
3.Modify package.json file according to the code given below
67
-
```
68
-
{
69
-
"name": "your-project-name",
70
-
"version": "version",
71
-
"dependencies": {
72
-
// your dependencies
73
-
},
74
-
"scripts": {
75
-
"lint": "eslint .",
76
-
"format": "prettier --write .",
77
-
// ... other scripts
78
-
},
79
-
"husky": {
80
-
"hooks": {
81
-
"pre-commit": "lint-staged"
82
-
}
83
-
}
84
-
}
85
-
86
-
```
87
-
88
-
89
56
## Firebase Setup
90
57
91
58
1. Sign in to https://console.firebase.google.com/.
92
-
2. Click **Add Project** and necessary information about the project.(Below mentioned the Steps to add project to firebase)
93
-
- To add Firebase resources to an existing Google Cloud project, enter its project name or select it from the dropdown menu.
94
-
- To create a new project, enter the desired project name. You can also optionally edit the project ID displayed below the project name
95
-
- Firebase generates a unique ID for your Firebase project based upon the name you give it. If you want to edit this project ID, you must do it now as it cannot be altered after Firebase provisions resources for your project. Visit Understand Firebase Projects to learn about how Firebase uses the project ID.
59
+
2. Click **Add Project** and necessary information about the project.(Below mentioned the Steps to add project to firebase)
60
+
- To add Firebase resources to an existing Google Cloud project, enter its project name or select it from the dropdown menu.
61
+
- To create a new project, enter the desired project name. You can also optionally edit the project ID displayed below the project name
62
+
- Firebase generates a unique ID for your Firebase project based upon the name you give it. If you want to edit this project ID, you must do it now as it cannot be altered after Firebase provisions resources for your project. Visit Understand Firebase Projects to learn about how Firebase uses the project ID.
96
63
3. Agree to the terms and click **Create Project**.
97
64
4. After creating the project, click **Add Firebase to your web app**.
98
-
- In the center of the Firebase console's project overview page, click the Web icon to launch the setup workflow.
99
-
- If you've already added an app to your Firebase project, click Add app to display the platform options.
100
-
- Enter your app's nickname.
101
-
- This nickname is an internal, convenience identifier and is only visible to you in the Firebase console.
102
-
- Click Register app.
65
+
- In the center of the Firebase console's project overview page, click the Web icon to launch the setup workflow.
66
+
- If you've already added an app to your Firebase project, click Add app to display the platform options.
67
+
- Enter your app's nickname.
68
+
- This nickname is an internal, convenience identifier and is only visible to you in the Firebase console.
69
+
- Click Register app.
103
70
5. Copy the firebase configuration.
104
71
6. Follow the below steps to setup firebase functions
105
-
- Go to functions directory (`cd functions`) and install dependencies (`npm install`)
106
-
- Create a folder `private` inside functions directory
107
-
- Then you have to generate a private key file for your service account. Follow the below steps to get private key:
108
-
1. In the Firebase console, open Settings > Service Accounts.
109
-
2. Click Generate New Private Key, then confirm by clicking Generate Key.
110
-
3. Securely store the JSON file containing the key and rename it to `cl-dev-pk.json`
111
-
4. Move the `cl-dev-pk.json` to `Codelabz/functions/private`
72
+
- Go to functions directory (`cd functions`) and install dependencies (`npm install`)
73
+
- Create a folder `private` inside functions directory
74
+
- Then you have to generate a private key file for your service account. Follow the below steps to get private key:
75
+
1. In the Firebase console, open Settings > Service Accounts.
76
+
2. Click Generate New Private Key, then confirm by clicking Generate Key.
77
+
3. Securely store the JSON file containing the key and rename it to `cl-dev-pk.json`
78
+
4. Move the `cl-dev-pk.json` to `Codelabz/functions/private`
112
79
7. Paste the configuration `.env` file. **(this will be found in the project settings section of firebase cloud)**
113
-
8. You can find your `<FIREBASE_DATABASE_URL>` in the Realtime Database section of the Firebase console. Depending on the location of the database, the database URL will be in one of the following forms:
114
-
-`https://DATABASE_NAME.firebaseio.com`**(for databases in us-central1)**
115
-
-`https://DATABASE_NAME.REGION.firebasedatabase.app`**(for databases in all other locations)**
80
+
8. You can find your `<FIREBASE_DATABASE_URL>` in the Realtime Database section of the Firebase console. Depending on the location of the database, the database URL will be in one of the following forms:
81
+
-`https://DATABASE_NAME.firebaseio.com`**(for databases in us-central1)**
82
+
-`https://DATABASE_NAME.REGION.firebasedatabase.app`**(for databases in all other locations)**
116
83
9. You can get your `<FIREBASE_VAPID_KEY>` from Cloud-Messaging tab
117
-
- navigate to the setting of your project Open the Cloud Messaging tab.
118
-
- scroll to the Web configuration section.
119
-
- In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated. You get your Vapid key form there.
120
-
10. As you're using emulator, set `<USE_EMULATOR>` to "true"
84
+
- navigate to the setting of your project Open the Cloud Messaging tab.
85
+
- scroll to the Web configuration section.
86
+
- In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated. You get your Vapid key form there.
87
+
10. As you're using emulator, set `<USE_EMULATOR>` to "true"
121
88
11. You can get your `<CYPRESS_PROJECT_ID>` as cypress project id from [cypress cloud](https://cloud.cypress.io)
122
89
123
90
You should fill in these values in their relevant fields in the `.env` file.
@@ -129,6 +96,7 @@ Run your firebase emulator by running the following command.
129
96
```
130
97
make emulator-import
131
98
```
99
+
132
100
This will run the emulator with the `testdata`. Check out [TESTDATA.md](./TESTDATA.md) for more info.
0 commit comments