From 9c4ead74cccb206e097d109092d78c114cc8f1bb Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 19 May 2026 20:49:51 +0530 Subject: [PATCH] feat: add custom 404 error page --- CONTRIBUTING.md | 186 +++++++++++++++++++++--------------------- src/Routes/Router.tsx | 2 + src/pages/404.tsx | 28 +++++++ 3 files changed, 123 insertions(+), 93 deletions(-) create mode 100644 src/pages/404.tsx diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b61d616..c211844 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,130 +1,130 @@ -# 🌟 Contributing to GitHub Tracker + # 🌟 Contributing to GitHub Tracker -Thank you for showing interest in **GitHub Tracker**! πŸš€ -Whether you're here to fix a bug, propose an enhancement, or add a new feature, we’re thrilled to welcome you aboard. Let’s build something awesome together! + Thank you for showing interest in **GitHub Tracker**! πŸš€ + Whether you're here to fix a bug, propose an enhancement, or add a new feature, we’re thrilled to welcome you aboard. Let’s build something awesome together! -
+
-## πŸ§‘β€βš–οΈ Code of Conduct + ## πŸ§‘β€βš–οΈ Code of Conduct -Please make sure to read and adhere to our [Code of Conduct](https://github.com/GitMetricsLab/github_tracker/CODE_OF_CONDUCT.md) before contributing. We aim to foster a respectful and inclusive environment for everyone. + Please make sure to read and adhere to our [Code of Conduct](https://github.com/GitMetricsLab/github_tracker/CODE_OF_CONDUCT.md) before contributing. We aim to foster a respectful and inclusive environment for everyone. -
+
-## πŸ›  Project Structure + ## πŸ›  Project Structure -```bash -github_tracker/ -β”œβ”€β”€ backend/ # Node.js + Express backend -β”‚ β”œβ”€β”€ routes/ # API routes -β”‚ β”œβ”€β”€ controllers/ # Logic handlers -β”‚ └── index.js # Entry point for server -β”‚ -β”œβ”€β”€ frontend/ # React + Vite frontend -β”‚ β”œβ”€β”€ components/ # Reusable UI components -β”‚ β”œβ”€β”€ pages/ # Main pages/routes -β”‚ └── main.jsx # Root file -β”‚ -β”œβ”€β”€ public/ # Static assets like images -β”‚ -β”œβ”€β”€ .gitignore -β”œβ”€β”€ README.md -β”œβ”€β”€ package.json -β”œβ”€β”€ tailwind.config.js -└── CONTRIBUTING.md -``` + ```bash + github_tracker/ + β”œβ”€β”€ backend/ # Node.js + Express backend + β”‚ β”œβ”€β”€ routes/ # API routes + β”‚ β”œβ”€β”€ controllers/ # Logic handlers + β”‚ └── index.js # Entry point for server + β”‚ + β”œβ”€β”€ frontend/ # React + Vite frontend + β”‚ β”œβ”€β”€ components/ # Reusable UI components + β”‚ β”œβ”€β”€ pages/ # Main pages/routes + β”‚ └── main.jsx # Root file + β”‚ + β”œβ”€β”€ public/ # Static assets like images + β”‚ + β”œβ”€β”€ .gitignore + β”œβ”€β”€ README.md + β”œβ”€β”€ package.json + β”œβ”€β”€ tailwind.config.js + └── CONTRIBUTING.md + ``` ---- + --- -## 🀝 How to Contribute + ## 🀝 How to Contribute -### 🧭 First-Time Contribution Steps + ### 🧭 First-Time Contribution Steps -1. **Fork the Repository** 🍴 - Click "Fork" to create your own copy under your GitHub account. + 1. **Fork the Repository** 🍴 + Click "Fork" to create your own copy under your GitHub account. -2. **Clone Your Fork** πŸ“₯ - ```bash - git clone https://github.com//github_tracker.git - ``` + 2. **Clone Your Fork** πŸ“₯ + ```bash + git clone https://github.com//github_tracker.git + ``` -3. **Navigate to the Project Folder** πŸ“ - ```bash - cd github_tracker - ``` + 3. **Navigate to the Project Folder** πŸ“ + ```bash + cd github_tracker + ``` -4. **Create a New Branch** 🌿 - ```bash - git checkout -b your-feature-name - ``` + 4. **Create a New Branch** 🌿 + ```bash + git checkout -b your-feature-name + ``` -5. **Make Your Changes** ✍ - After modifying files, stage and commit: + 5. **Make Your Changes** ✍ + After modifying files, stage and commit: - ```bash - git add . - git commit -m "✨ Added [feature/fix]: your message" - ``` + ```bash + git add . + git commit -m "✨ Added [feature/fix]: your message" + ``` -6. **Push Your Branch to GitHub** πŸš€ - ```bash - git push origin your-feature-name - ``` + 6. **Push Your Branch to GitHub** πŸš€ + ```bash + git push origin your-feature-name + ``` -7. **Open a Pull Request** πŸ” - Go to the original repo and click **Compare & pull request**. - ---- + 7. **Open a Pull Request** πŸ” + Go to the original repo and click **Compare & pull request**. + + --- -## 🚦 Pull Request Guidelines + ## 🚦 Pull Request Guidelines -### **Split Big Changes into Multiple Commits** -- When making large or complex changes, break them into smaller, logical commits. -- Each commit should represent a single purpose or unit of change (e.g. refactoring, adding a feature, fixing a bug). ---- -- βœ… Ensure your code builds and runs without errors. -- πŸ§ͺ Include tests where applicable. -- πŸ’¬ Add comments if the logic is non-trivial. -- πŸ“Έ Attach screenshots for UI-related changes. -- πŸ”– Use meaningful commit messages and titles. + ### **Split Big Changes into Multiple Commits** + - When making large or complex changes, break them into smaller, logical commits. + - Each commit should represent a single purpose or unit of change (e.g. refactoring, adding a feature, fixing a bug). + --- + - βœ… Ensure your code builds and runs without errors. + - πŸ§ͺ Include tests where applicable. + - πŸ’¬ Add comments if the logic is non-trivial. + - πŸ“Έ Attach screenshots for UI-related changes. + - πŸ”– Use meaningful commit messages and titles. ---- + --- -## 🐞 Reporting Issues + ## 🐞 Reporting Issues -If you discover a bug or have a suggestion: + If you discover a bug or have a suggestion: -➑️ [Open an Issue](https://github.com/GitMetricsLab/github_tracker/issues/new/choose) + ➑️ [Open an Issue](https://github.com/GitMetricsLab/github_tracker/issues/new/choose) -Please include: + Please include: -- **Steps to Reproduce** -- **Expected vs. Actual Behavior** -- **Screenshots/Logs (if any)** + - **Steps to Reproduce** + - **Expected vs. Actual Behavior** + - **Screenshots/Logs (if any)** ---- + --- -## 🧠 Good Coding Practices + ## 🧠 Good Coding Practices -1. **Consistent Style** - Stick to the project's linting and formatting conventions (e.g., ESLint, Prettier, Tailwind classes). + 1. **Consistent Style** + Stick to the project's linting and formatting conventions (e.g., ESLint, Prettier, Tailwind classes). -2. **Meaningful Naming** - Use self-explanatory names for variables and functions. + 2. **Meaningful Naming** + Use self-explanatory names for variables and functions. -3. **Avoid Duplication** - Keep your code DRY (Don't Repeat Yourself). + 3. **Avoid Duplication** + Keep your code DRY (Don't Repeat Yourself). -4. **Testing** - Add unit or integration tests for any new logic. + 4. **Testing** + Add unit or integration tests for any new logic. -5. **Review Others’ PRs** - Help others by reviewing their PRs too! + 5. **Review Others’ PRs** + Help others by reviewing their PRs too! ---- + --- -## πŸ™Œ Thank You! + ## πŸ™Œ Thank You! -We’re so glad you’re here. Your time and effort are deeply appreciated. Feel free to reach out via Issues or Discussions if you need any help. + We’re so glad you’re here. Your time and effort are deeply appreciated. Feel free to reach out via Issues or Discussions if you need any help. -**Happy Coding!** πŸ’»πŸš€ + **Happy Coding!** πŸ’»πŸš€ diff --git a/src/Routes/Router.tsx b/src/Routes/Router.tsx index 40a7861..9804659 100644 --- a/src/Routes/Router.tsx +++ b/src/Routes/Router.tsx @@ -6,6 +6,7 @@ import Contributors from "../pages/Contributors/Contributors"; import Signup from "../pages/Signup/Signup.tsx"; import Login from "../pages/Login/Login.tsx"; import ContributorProfile from "../pages/ContributorProfile/ContributorProfile.tsx"; +import Custom404 from "../pages/404.tsx"; import Home from "../pages/Home/Home.tsx"; const Router = () => { @@ -19,6 +20,7 @@ const Router = () => { } /> } /> } /> + } /> ); }; diff --git a/src/pages/404.tsx b/src/pages/404.tsx new file mode 100644 index 0000000..c6d4bcd --- /dev/null +++ b/src/pages/404.tsx @@ -0,0 +1,28 @@ +import { Link } from "react-router-dom"; + +export default function Custom404() { + return ( +
+
+

+ 404 +

+ +

+ Page Not Found +

+ +

+ The page you are looking for does not exist or has been moved. +

+ + + Go Back Home + +
+
+ ); +} \ No newline at end of file