Skip to content

Commit 46c5676

Browse files
Final Commit For Husky
1 parent 02c289d commit 46c5676

File tree

251 files changed

+14204
-13372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+14204
-13372
lines changed

.eslintrc.cjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: ["eslint:recommended", "plugin:react/recommended"],
7+
parserOptions: {
8+
ecmaFeatures: {
9+
jsx: true
10+
},
11+
ecmaVersion: 2017,
12+
sourceType: "module"
13+
},
14+
plugins: ["react"],
15+
rules: {}
16+
};

.github/ISSUE_TEMPLATE/bug_report.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/PULL_REQUEST_TEMPLATE.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
<!--- Provide a general summary of your changes in the Title above -->
22

33
## Description
4+
45
<!--- Describe your changes in detail -->
56

67
## Related Issue
8+
79
<!--- This project only accepts pull requests related to open issues -->
810
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
911
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
1012
<!--- Please link to the issue here: -->
1113

1214
## Motivation and Context
15+
1316
<!--- Why is this change required? What problem does it solve? -->
1417

1518
## How Has This Been Tested?
19+
1620
<!--- Please describe in detail how you tested your changes. -->
1721
<!--- Include details of your testing environment, and the tests you ran to -->
1822
<!--- see how your change affects other areas of the code, etc. -->
1923

2024
## Screenshots or GIF (In case of UI changes):
2125

2226
## Types of changes
27+
2328
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
29+
2430
- [ ] Bug fix (non-breaking change which fixes an issue)
2531
- [ ] New feature (non-breaking change which adds functionality)
2632
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
2733

2834
## Checklist:
35+
2936
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
3037
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
38+
3139
- [ ] My code follows the code style of this project.
3240
- [ ] My change requires a change to the documentation.
3341
- [ ] I have updated the documentation accordingly.

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm run format
6+

CONTRIBUTING.md

+36-68
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Table of Content
2+
23
- [Table of Content](#table-of-content)
34
- [User Guide](#user-guide)
45
- [Prerequisites](#prerequisites)
@@ -13,33 +14,35 @@
1314
# User Guide
1415

1516
## Prerequisites
17+
1618
- Node.js version 14.
1719
- Java JDK version 11 or higher. (For running emulators)
1820
- 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.
2222
2323
## Project Setup
24+
2425
> 📝**NOTE**: Make sure that you are using version 14 of node.
2526
2627
> **Tip**: You can use nvm (node version manager) tool to install multiple node versions and can switch between them easily.
28+
2729
1. Fork the repo as your own copy.
2830
2. Click on `Code` button and then copy HTTPs link. ( it will look like this `https://github.com/<YOUR_USERNAME>/Codelabz.git`)
2931
3. Clone the repo by running `git clone https://github.com/<YOUR_USERNAME>/Codelabz.git`
3032
4. Go to the folder `cd Codelabz`.
3133
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.
3335
7. Setup firebase and get your own set of keys. ( follow steps in [Firebase Setup](#firebase-setup) section to setup firebase )
3436
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.
3839

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)
4041
4142
### 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+
4346
```
4447
docker-compose up
4548
```
@@ -50,74 +53,38 @@ This will setup your project along with firebase emulator in a docker environmen
5053

5154

5255

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-
8956
## Firebase Setup
9057

9158
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.
9663
3. Agree to the terms and click **Create Project**.
9764
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.
10370
5. Copy the firebase configuration.
10471
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`
11279
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)**
11683
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"
12188
11. You can get your `<CYPRESS_PROJECT_ID>` as cypress project id from [cypress cloud](https://cloud.cypress.io)
12289

12390
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.
12996
```
13097
make emulator-import
13198
```
99+
132100
This will run the emulator with the `testdata`. Check out [TESTDATA.md](./TESTDATA.md) for more info.
133101

134102
if you don't want to import testdata, run

ISSUE_TEMPLATE/Bug_Report.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Device Information (please complete the following information):**
27-
- OS: [e.g. iOS8.1]
28-
- Browser [e.g. stock browser, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS8.1]
29+
- Browser [e.g. stock browser, safari]
30+
- Version [e.g. 22]
3031

3132
**Additional context**
3233
Add any other context about the problem here.

ISSUE_TEMPLATE/Feature_Request.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

0 commit comments

Comments
 (0)