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
21 changes: 0 additions & 21 deletions .eslintrc.cjs

This file was deleted.

30 changes: 15 additions & 15 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
bug:
- '(bug|Bug)'
- "(bug|Bug)"
documentation:
- '(documentation|Documentation)'
- "(documentation|Documentation)"
firebase:
- '(firebase|Firebase|firestore|Firestore|emulator|Emulator|storage|Storage)'
'UI/UX':
- '(UI|ui|UX|ux|screen|width|icon|height|button|page|css|CSS|margin|padding)'
'help wanted':
- 'help'
'good first issue':
- 'good first issue'
'CI/CD':
- 'CI/CD'
- "(firebase|Firebase|firestore|Firestore|emulator|Emulator|storage|Storage)"
"UI/UX":
- "(UI|ui|UX|ux|screen|width|icon|height|button|page|css|CSS|margin|padding)"
"help wanted":
- "help"
"good first issue":
- "good first issue"
"CI/CD":
- "CI/CD"
dependency:
- '(dependency|dependencies|npm)'
- "(dependency|dependencies|npm)"
Urgent:
- '(Urgent|urgent|important)'
- "(Urgent|urgent|important)"
broken:
- '(broken|Broken|not working)'
- "(broken|Broken|not working)"
feature:
- '(Feature|feature|add|Add|ADD)'
- "(Feature|feature|add|Add|ADD)"
6 changes: 3 additions & 3 deletions .github/workflows/label_issues.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Issue Labeler'
name: "Issue Labeler"
on:
issues:
types: [opened, edited]
Expand All @@ -15,8 +15,8 @@ jobs:
- uses: actions/checkout@v2
- uses: github/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labels.yml
enable-versioned-regex: 0
include-title: 1
body-missing-regex-label: 'no-body'
body-missing-regex-label: "no-body"
34 changes: 23 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ Before you begin, ensure you have the following installed on your system:

2. **Clone Your Fork:**
Open your terminal and run:

```bash
git clone https://github.com/<YOUR_USERNAME>/Codelabz.git
```

Replace `<YOUR_USERNAME>` with your GitHub username.

3. **Navigate to the Project Folder:**
Expand All @@ -58,10 +60,13 @@ Before you begin, ensure you have the following installed on your system:
### Install Dependencies

Install all project dependencies by running one of the following commands:

```bash
npm install
```

Or, if you prefer using the make command:

```bash
make install
```
Expand All @@ -86,6 +91,7 @@ After completing the quick start guide, follow these additional steps for a comp
### Using Docker-Compose (Optional)

If you prefer a containerized environment, you can use Docker Compose:

1. Ensure your `.env` file is properly set up.
2. Run:
```bash
Expand All @@ -97,7 +103,6 @@ If you prefer a containerized environment, you can use Docker Compose:

## Firebase Setup


Codelabz uses Firebase for backend services. Follow these steps to configure your Firebase project:

### Firebase Web App Configuration
Expand Down Expand Up @@ -145,9 +150,8 @@ EMAIL_USER=your-email-username
EMAIL_PASS=your-email-password
SMTP_SERVER=gmail
```
(Adjust according to your SMTP provider’s details.)


(Adjust according to your SMTP provider’s details.)

### Firebase Emulator Setup

Expand All @@ -165,14 +169,18 @@ SMTP_SERVER=gmail
```shell
make emulator
```

Or, if you don't have the make command:
```bash
firebase emulators:start
```

```bash
firebase emulators:start
```

**Export Emulator Data (Optional):**
```bash
make emulator-export
```

```bash
make emulator-export
```

---

Expand All @@ -181,17 +189,21 @@ Or, if you don't have the make command:
### Development Server

To start the development server:

```bash
npm run dev
```

Then, open your browser and navigate to [http://127.0.0.1:5173/](http://127.0.0.1:5173/).

### Storybook

To view the UI components in isolation using Storybook:

```bash
npm run storybook
```

Storybook will run on port `6006`.

### Testing with Cypress
Expand All @@ -207,7 +219,6 @@ Storybook will run on port `6006`.

---


## Troubleshooting & Additional Tips

```
Expand All @@ -216,9 +227,9 @@ macOS Users: Port 5000 can sometimes be used by macOS for AirPlay or other syste

If you failed to run the project do the following steps :


- **Node Version:**
Always use Node.js version 14. If using `nvm`, switch with:

```bash
nvm use 14
```
Expand All @@ -234,6 +245,7 @@ If you failed to run the project do the following steps :
## Need Help?

If you run into any issues or have suggestions for improvements:

- Open an issue on [GitHub](https://github.com/c2siorg/Codelabz/issues).

Thank you for contributing to **Codelabz**!
Expand Down
12 changes: 2 additions & 10 deletions cypress/e2e/components/profile/user-dashboard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ describe("User Dashboard Test | CodeLabz", () => {

it("Check Profile", function () {
cy.visit(`${this.base_url}user-dashboard/profile`);
cy.get(
'[data-testid="profile"]'
)
.should("exist")
.click();
cy.get('[data-testid="profile"]').should("exist").click();
cy.wait(2000);
cy.get("[data-testId=profilePage]").should("exist");
cy.get("[data-testid=name]").children().clear().type("testname");
Expand Down Expand Up @@ -67,11 +63,7 @@ describe("User Dashboard Test | CodeLabz", () => {
it("Check User Settings", function () {
cy.visit(`${this.base_url}user-dashboard/profile`);

cy.get(
'[data-testid="userSettings"]'
)
.should("exist")
.click();
cy.get('[data-testid="userSettings"]').should("exist").click();
cy.get("[data-testId=userSettingsPage]").should("exist");
cy.get("[data-testId=exportData]").should("exist");
cy.get("[data-testId=startExport]").should("exist");
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const reactPlugin = require("eslint-plugin-react");

module.exports = {
// root: true,
languageOptions: {
ecmaVersion: 2021,
sourceType: "module",
parserOptions: {
ecmaFeatures: { jsx: true }
}
},
plugins: { react: reactPlugin },
rules: {},
settings: { react: { version: "detect" } }
};
20 changes: 9 additions & 11 deletions functions/cloud_functions/onCreateFunctions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const { db, rtdb, admin } = require("../auth");
const transporter = require('../mail/transporter');
const templates = require('../mail/mailTemplate');


const transporter = require("../mail/transporter");
const templates = require("../mail/mailTemplate");

exports.sendVerificationEmailHandler = async user => {
try {
Expand All @@ -17,20 +15,20 @@ exports.sendVerificationEmailHandler = async user => {
.auth()
.generateEmailVerificationLink(email);

// comment line number 20 to 32 if you dont want to use email service
// comment line number 20 to 32 if you dont want to use email service

const htmlBody = templates.verificationEmail(verificationLink);
const htmlBody = templates.verificationEmail(verificationLink);

// Set up mail options for Nodemailer
const mailOptions = {
from: 'Codelabz <[email protected]>',
const mailOptions = {
from: "Codelabz <[email protected]>",
to: email,
subject: 'Welcome to CodeLabz - Verify Your Email',
html: htmlBody,
subject: "Welcome to CodeLabz - Verify Your Email",
html: htmlBody
};

await transporter.sendMail(mailOptions);

await db.collection("cl_mail").add({
to: email,
template: {
Expand Down
6 changes: 3 additions & 3 deletions functions/mail/mailTemplate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
verificationEmail: (verificationLink) => {
verificationEmail: verificationLink => {
return `
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -121,7 +121,7 @@ module.exports = {
},

// Template for welcome email after verification
welcomeEmail: (username) => {
welcomeEmail: username => {
return `
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -175,4 +175,4 @@ module.exports = {
</html>
`;
}
};
};
11 changes: 5 additions & 6 deletions functions/mail/transporter.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
const nodemailer = require('nodemailer');
const nodemailer = require("nodemailer");

// For production, use environment variables or Firebase Function config for credentials.
// Example: functions.config().email.user, functions.config().email.pass


const emailUser = process.env.EMAIL_USER || '[email protected]';
const emailPass = process.env.EMAIL_PASS || 'your-password-or-app-password';
const emailUser = process.env.EMAIL_USER || "[email protected]";
const emailPass = process.env.EMAIL_PASS || "your-password-or-app-password";

const transporter = nodemailer.createTransport({
service: process.env.SMTP_SERVER, // or "SMTP", or a custom service if you have your own SMTP server
auth: {
user: emailUser,
pass: emailPass,
},
pass: emailPass
}
});

// Export the transporter to be used in other files
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
Loading