diff --git a/.github/workflows/auto-comment-on-close.yml b/.github/workflows/auto-comment-on-close.yml deleted file mode 100644 index fa878b6..0000000 --- a/.github/workflows/auto-comment-on-close.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Comment on Issue Close - -on: - issues: - types: [closed] - -jobs: - greet-on-close: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - name: Greet User - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issue = context.payload.issue; - const issueCreator = issue.user.login; - const issueNumber = issue.number; - - const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!πŸš€`; - - github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - body: greetingMessage - }); diff --git a/.github/workflows/auto-comment-pr-merge.yml b/.github/workflows/auto-comment-pr-merge.yml deleted file mode 100644 index 8100123..0000000 --- a/.github/workflows/auto-comment-pr-merge.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Auto Comment on PR Merge - -on: - pull_request: - types: [closed] - -permissions: - issues: write - pull-requests: write - -jobs: - comment: - runs-on: ubuntu-latest - permissions: - pull-requests: write - if: github.event.pull_request.merged == true - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Add Comment to Issue - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - COMMENT=$(cat <' if not addressing any issue." - echo "##[error]Fixes #NEW must be included in the description." - exit 1 - fi - - echo "PR description is valid." - - - name: Output result - run: echo "All checks passed." + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '14' + + - name: Validate PR Description + id: pr-check + run: | + # Fetch PR information + PR_DESCRIPTION=$(jq -r .pull_request.body < "$GITHUB_EVENT_PATH") + PR_TITLE=$(jq -r .pull_request.title < "$GITHUB_EVENT_PATH") + + # Define file paths for the output variables + PR_VALID_FILE=$(mktemp) + ERROR_MESSAGE_FILE=$(mktemp) + SUCCESS_MESSAGE_FILE=$(mktemp) + + # Default value for PR_VALID + PR_VALID="true" + + # Check if PR description is empty + if [ -z "$PR_DESCRIPTION" ] || [ "$PR_DESCRIPTION" == "null" ]; then + echo "Empty PR description" + PR_VALID="false" + echo '❌ Error: PR description is empty!' > "$ERROR_MESSAGE_FILE" + fi + + # Check for issue reference in the description + ISSUE_PATTERN="(Fixes|Close|Closes|Closed|Fix|Fixed|Resolve|Resolves) #[0-9]+" + if [[ ! "$PR_DESCRIPTION" =~ $ISSUE_PATTERN ]]; then + echo "Invalid or missing issue reference" + PR_VALID="false" + echo '❌ Error: PR must reference an issue with the format Fixes ,Close ,Closes ,Closed ,Fix ,Fixed ,Resolve ,Resolves #Issue_Number' > "$ERROR_MESSAGE_FILE" + fi + + # If both checks pass + if [ "$PR_VALID" == "true" ]; then + echo 'βœ… Success: PR is valid!' > "$SUCCESS_MESSAGE_FILE" + fi + + # Save the outputs to environment files + echo "PR_VALID=$PR_VALID" >> $GITHUB_ENV + echo "ERROR_MESSAGE=$(cat $ERROR_MESSAGE_FILE)" >> $GITHUB_ENV + echo "SUCCESS_MESSAGE=$(cat $SUCCESS_MESSAGE_FILE)" >> $GITHUB_ENV + + - name: Post comment on PR + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prValid = process.env.PR_VALID; + const errorMessage = process.env.ERROR_MESSAGE; + const successMessage = process.env.SUCCESS_MESSAGE; + const prNumber = context.payload.pull_request.number; + + if (prValid === 'false') { + github.rest.issues.createComment({ + issue_number: prNumber, + owner: context.repo.owner, + repo: context.repo.repo, + body: errorMessage + }); + core.setFailed(errorMessage); + } else { + github.rest.issues.createComment({ + issue_number: prNumber, + owner: context.repo.owner, + repo: context.repo.repo, + body: successMessage + }); + } + + - name: Fail if validation failed + if: env.PR_VALID == 'false' + run: exit 1 diff --git a/.github/workflows/pr_merge.yaml b/.github/workflows/pr_merge.yaml new file mode 100644 index 0000000..06156fb --- /dev/null +++ b/.github/workflows/pr_merge.yaml @@ -0,0 +1,34 @@ +name: Merge Thank You + +# Created by @smog-root + +on: + pull_request_target: + types: [closed] # Trigger when a PR is closed + +permissions: + issues: write + pull-requests: write + +jobs: + post_merge_message: + if: github.event.pull_request.merged == true # Only run if the PR was merged + runs-on: ubuntu-latest + + steps: + - name: Post thank you message + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # Ensure token is used + script: | + const prNumber = context.payload.pull_request.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + + // Post a thank you message upon PR merge + await github.rest.issues.createComment({ + owner: owner, + repo: repo, + issue_number: prNumber, + body: `πŸŽ‰πŸŽ‰ Thank you for your contribution! Your PR #${prNumber} has been merged! πŸŽ‰πŸŽ‰` + }); \ No newline at end of file diff --git a/.github/workflows/pr_raise.yml b/.github/workflows/pr_raise.yml new file mode 100644 index 0000000..20deceb --- /dev/null +++ b/.github/workflows/pr_raise.yml @@ -0,0 +1,39 @@ +name: Auto Comment on PR + +# Created by @smog-root + +on: + pull_request_target: + types: [opened] + +permissions: + issues: write + pull-requests: write + +jobs: + comment: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Add Comment to Pull Request + run: | + COMMENT=$(cat < + + + # BitBox [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub issues](https://img.shields.io/github/issues/Anuj3553/BitBox.svg)](https://github.com/Anuj3553/BitBox/issues) [![GitHub stars](https://img.shields.io/github/stars/Anuj3553/BitBox.svg)](https://github.com/Anuj3553/BitBox/stargazers) [![GitHub forks](https://img.shields.io/github/forks/Anuj3553/BitBox.svg)](https://github.com/Anuj3553/BitBox/network) + + + +

RocketContents

+ + +- [🎯 Overview](#-overview) +- [πŸ“¦ Built With](#-built-with) +- [πŸš€ Features](#features) +- [πŸ› οΈ Getting Started](#-getting-started) + - [πŸ”§ Prerequisites](#-prerequisites) + - [βš™οΈ Installation](#-installation) + - [▢️ Running the Project](#️-running-the-project) +- [🀝 Contributing](#-contributing) +- [πŸ“§ Contact](#-contact) +- [πŸ“ Acknowledgments](#-acknowledgments) +- [πŸ† Main Contributors](#-main-contributors) + + -## 🎯 Overview +

RocketOverview

+ **BitBox** is a platform designed to make it easy for developers to upload, share, and collaborate on projects. Users can showcase their work, connect with others, and learn from the community's shared knowledge. + + ## πŸ“¦ Built With - **React.js** - **Node.js** - **TailwindCSS** ---- + -## πŸš€ Features +

RocketFeatures

- **Project Upload**: Easily upload your projects to the platform. - **Project Discovery**: Explore a wide range of projects shared by other users. - **Collaboration**: Share feedback and collaborate with developers. - **Learning**: Learn from shared projects and contribute to community knowledge. ---- + ## πŸ› οΈ Getting Started @@ -67,12 +94,14 @@ npm run dev ```sh cd server -nodemon index.js +cp .env.sample .env +npm run dev ``` ---- + + -## 🀝 Contributing +

Rocket Contribution

We welcome contributions! Follow these steps to contribute: @@ -84,18 +113,45 @@ We welcome contributions! Follow these steps to contribute: ⭐ **Don't forget to give this project a star if you found it helpful!** ⭐ ---- + + + +

Detective Contact

-## πŸ“§ Contact +### Project Admin⚑ + + + + + +

HARSHIT SINGH

+ +
+ +### Project Mentors✨ + + + + + + +

GUNJESH KUMAR + +

+ +

NEHA BARNWAL +

+ +
For any inquiries, feel free to reach out: - **Anuj Verma** Email: [anuj3553@gmail.com](mailto:anuj3553@gmail.com) -**Project Link**: [BitBox GitHub Repository](https://github.com/Anuj3553/BitBox) +- **Project Link**: [BitBox GitHub Repository](https://github.com/Anuj3553/BitBox) ---- + ## πŸ“ Acknowledgments @@ -112,11 +168,16 @@ For any inquiries, feel free to reach out: -## πŸ† Main Contributors + + +

CrownMain Contributor

+ - **Anuj Verma** Email: [anuj3553@gmail.com](mailto:anuj3553@gmail.com) + + **Highlighted Main Contributors:** ```diff diff --git a/client/index.html b/client/index.html index 9b9baeb..2b2c01d 100644 --- a/client/index.html +++ b/client/index.html @@ -43,4 +43,22 @@ src="https://kit.fontawesome.com/1eb8db9042.js" crossorigin="anonymous" > + + +
+ + + + diff --git a/client/package-lock.json b/client/package-lock.json index 5156d5b..8f4f28d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -2975,6 +2975,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==", + "dev": true, "license": "MIT", "dependencies": { "@types/react": "*" diff --git a/client/src/App.jsx b/client/src/App.jsx index 3fc55f6..ea9e35f 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -1,36 +1,41 @@ -import React, { useEffect, useState } from 'react'; // Import useState and useEffect -import './App.css'; -import './index.css'; -import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; +import React, { useEffect, useState } from "react"; // Import useState and useEffect +import "./App.css"; +import "./index.css"; +import { + BrowserRouter as Router, + Routes, + Route, + useLocation, +} from "react-router-dom"; import PropTypes from "prop-types"; -import LoadingBar from 'react-top-loading-bar'; -import About from './component/About'; -import Alert from './component/Alert'; -import Footer from './component/Footer'; -import Home from './component/Home'; -import Login from './component/Login'; -import Navbar from './component/Navbar'; -import Signup from './component/Signup'; -import ProjectState from './context/ProjectState'; -import ProfileState from './context/ProfileState'; -import CodeOfConduct from './component/Footers/Codeofconduct'; -import Feedback from './component/Footers/Feedback'; -import ContactUs from './component/Footers/Contactus'; -import PrivacyPolicy from './component/Footers/Privacypolicy'; -import TermOfUse from './component/Footers/TermOfUse'; -import Community from './component/Community'; -import MyProfile from './component/MyProfile'; -import ScrollTop from './component/ScrollTop'; -import EditProfile from './component/EditProfile'; -import Contributers from './component/Contributers'; -import Discussion from './component/Discussion'; -import { useAtom } from 'jotai'; -import { modeAtom } from './atom/Atom'; -import ForgotPassword from './component/forgotpass'; -import VerifyEmail from './component/Verify'; -import NotFound from './component/NotFound'; -import MiniChatbot from './component/MiniChatbot' -import ProgressBar from './component/ProgressBar/ProgressBar'; +import LoadingBar from "react-top-loading-bar"; +import About from "./component/About"; +import Alert from "./component/Alert"; +import Footer from "./component/Footer"; +import Home from "./component/Home"; +import Login from "./component/Login"; +import Navbar from "./component/Navbar"; +import Signup from "./component/Signup"; +import ProjectState from "./context/ProjectState"; +import ProfileState from "./context/ProfileState"; +import CodeOfConduct from "./component/Footers/Codeofconduct"; +import Feedback from "./component/Footers/Feedback"; +import ContactUs from "./component/Footers/Contactus"; +import PrivacyPolicy from "./component/Footers/Privacypolicy"; +import TermOfUse from "./component/Footers/TermOfUse"; +import Community from "./component/Community"; +import MyProfile from "./component/MyProfile"; +import ScrollTop from "./component/ScrollTop"; +import EditProfile from "./component/EditProfile"; +import Contributers from "./component/Contributers"; +import Discussion from "./component/Discussion"; +import { useAtom } from "jotai"; +import { modeAtom } from "./atom/Atom"; +import ForgotPassword from "./component/ForgotPassword"; +import VerifyEmail from "./component/Verify"; +import NotFound from "./component/NotFound"; +import MiniChatbot from "./component/MiniChatbot"; +import ProgressBar from "./component/ProgressBar/ProgressBar"; // Main Layout Component @@ -38,19 +43,19 @@ const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => { const location = useLocation(); // Use location inside Router // Define routes where the footer or navbar should not be shown - const hideNavbarRoutes = ['/login', '/signup']; - const hideFooterRoutes = ['/login', '/signup']; + const hideNavbarRoutes = ["/login", "/signup", "/forgot-password"]; + const hideFooterRoutes = ["/login", "/signup", "/forgot-password"]; return ( <> {/* Conditionally render the Navbar */} {!hideNavbarRoutes.includes(location.pathname) && ( { {/* Conditionally render the Footer */} {!hideFooterRoutes.includes(location.pathname) && ( -