From d794d8d2c2ad26724b0633bb1fadb936665b0817 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:11:36 +0530 Subject: [PATCH 01/10] Add Python script to fetch the repo dir contents --- .github/scripts/update_structure.py | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/scripts/update_structure.py diff --git a/.github/scripts/update_structure.py b/.github/scripts/update_structure.py new file mode 100644 index 0000000..7e0b0ef --- /dev/null +++ b/.github/scripts/update_structure.py @@ -0,0 +1,67 @@ +import os +import github +from github import Github + +def get_repo_structure(path='.', prefix=''): + structure = [] + items = sorted(os.listdir(path)) + for i, item in enumerate(items): + if item.startswith('.'): + continue + item_path = os.path.join(path, item) + if os.path.isdir(item_path): + is_last = i == len(items) - 1 + current_prefix = '└── ' if is_last else '├── ' + structure.append(f"{prefix}{current_prefix}{item}") + next_prefix = prefix + (' ' if is_last else '│ ') + structure.extend(get_repo_structure(item_path, next_prefix)) + return structure + +def update_structure_file(structure): + with open('repo_structure.txt', 'w') as f: + f.write('\n'.join(structure)) + +def update_readme(structure): + with open('README.md', 'r') as f: # updated file name + content = f.read() + + start_marker = '' + end_marker = '' + + start_index = content.find(start_marker) + end_index = content.find(end_marker) + + if start_index != -1 and end_index != -1: + new_content = ( + content[:start_index + len(start_marker)] + + '\n```\n' + '\n'.join(structure) + '\n```\n' + + content[end_index:] + ) + + with open('README.md', 'w') as f: + f.write(new_content) + print("README.md updated with new structure.") + else: + print("Markers not found in Repo-structure.md. Structure not updated.") + +def main(): + g = Github(os.environ['GH_TOKEN']) + repo = g.get_repo(os.environ['GITHUB_REPOSITORY']) + + current_structure = get_repo_structure() + + try: + contents = repo.get_contents("repo_structure.txt") + existing_structure = contents.decoded_content.decode().split('\n') + except github.GithubException: + existing_structure = None + + if current_structure != existing_structure: + update_structure_file(current_structure) + update_readme(current_structure) + print("Repository structure updated.") + else: + print("No changes in repository structure.") + +if __name__ == "__main__": + main() \ No newline at end of file From 071182df4645aec4e51db94e8e5760189e477610 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:24:28 +0530 Subject: [PATCH 02/10] Add action workflow for running python script --- .github/workflows/Update-README.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/Update-README.yml diff --git a/.github/workflows/Update-README.yml b/.github/workflows/Update-README.yml new file mode 100644 index 0000000..7de030a --- /dev/null +++ b/.github/workflows/Update-README.yml @@ -0,0 +1,38 @@ +name: Update Repository structure + +on: + schedule: + - cron: '0 * * * *' # Run every hour + workflow_dispatch: # Allow manual triggering + push: + branches: + - main + +jobs: + detect-and-update-structure: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install PyGithub + + - name: Run update script + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python .github/scripts/update-structure.py + + - name: Commit and push if changed + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git add . + git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push) \ No newline at end of file From da714adfc3db6c358cc3f330f3c56528954d6acb Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:43:52 +0530 Subject: [PATCH 03/10] Update branch in action workflow, with markdown file updated --- .github/scripts/update_structure.py | 10 +++++----- .github/workflows/Update-README.yml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/scripts/update_structure.py b/.github/scripts/update_structure.py index 7e0b0ef..c76f40c 100644 --- a/.github/scripts/update_structure.py +++ b/.github/scripts/update_structure.py @@ -21,8 +21,8 @@ def update_structure_file(structure): with open('repo_structure.txt', 'w') as f: f.write('\n'.join(structure)) -def update_readme(structure): - with open('README.md', 'r') as f: # updated file name +def update_StationGuide(structure): + with open('StationGuide.md', 'r') as f: # updated file name content = f.read() start_marker = '' @@ -38,9 +38,9 @@ def update_readme(structure): content[end_index:] ) - with open('README.md', 'w') as f: + with open('StationGuide.md', 'w') as f: f.write(new_content) - print("README.md updated with new structure.") + print("StationGuide.md updated with new structure.") else: print("Markers not found in Repo-structure.md. Structure not updated.") @@ -58,7 +58,7 @@ def main(): if current_structure != existing_structure: update_structure_file(current_structure) - update_readme(current_structure) + update_StationGuide(current_structure) print("Repository structure updated.") else: print("No changes in repository structure.") diff --git a/.github/workflows/Update-README.yml b/.github/workflows/Update-README.yml index 7de030a..6bcde75 100644 --- a/.github/workflows/Update-README.yml +++ b/.github/workflows/Update-README.yml @@ -7,6 +7,7 @@ on: push: branches: - main + - yash/fix-267 jobs: detect-and-update-structure: From 663c3683b0b3697fa4b97f7eaa46650c23c5e3e0 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:46:02 +0530 Subject: [PATCH 04/10] Updated README with markers --- README.md | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 46f3559..10777bf 100644 --- a/README.md +++ b/README.md @@ -121,24 +121,13 @@ npm run start ## Project Structure +### Project strucutre + + ``` -StationGuide/ -├── frontend/ -│ ├── src/ # React application source code -│ ├── public/ # Static assets for the frontend (e.g., images, fonts) -│ ├── package.json # Frontend dependencies -│ └── ... # Other frontend-related files (e.g., configuration files) -├── backend/ -│ ├── server.js # Express server entry point -│ ├── models/ # Data model definitions (optional) -│ ├── routes/ # API endpoints definitions -│ ├── config/ # Configuration files (e.g., database connection) -│ ├── package.json # Backend dependencies -│ └── ... # Other backend-related files (e.g., middleware) -├── .env # Environment variables for sensitive information (optional) -├── using.md # This file -└── ... # Other project configuration files (e.g., .gitignore) ``` + + From 137c24fb76de1b021d911b16eb6bd1f689ebb072 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:46:56 +0530 Subject: [PATCH 05/10] Updated file name in python script --- .github/scripts/update_structure.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/update_structure.py b/.github/scripts/update_structure.py index c76f40c..970c0ee 100644 --- a/.github/scripts/update_structure.py +++ b/.github/scripts/update_structure.py @@ -21,8 +21,8 @@ def update_structure_file(structure): with open('repo_structure.txt', 'w') as f: f.write('\n'.join(structure)) -def update_StationGuide(structure): - with open('StationGuide.md', 'r') as f: # updated file name +def update_README(structure): + with open('README.md', 'r') as f: # updated file name content = f.read() start_marker = '' @@ -38,9 +38,9 @@ def update_StationGuide(structure): content[end_index:] ) - with open('StationGuide.md', 'w') as f: + with open('README.md', 'w') as f: f.write(new_content) - print("StationGuide.md updated with new structure.") + print("README.md updated with new structure.") else: print("Markers not found in Repo-structure.md. Structure not updated.") @@ -58,7 +58,7 @@ def main(): if current_structure != existing_structure: update_structure_file(current_structure) - update_StationGuide(current_structure) + update_README(current_structure) print("Repository structure updated.") else: print("No changes in repository structure.") From e08c9a8c5e98f37172414e15e8a73d9fcab2bb4d Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:48:20 +0530 Subject: [PATCH 06/10] updated with proper name --- .github/workflows/Update-README.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Update-README.yml b/.github/workflows/Update-README.yml index 6bcde75..3dd4761 100644 --- a/.github/workflows/Update-README.yml +++ b/.github/workflows/Update-README.yml @@ -29,7 +29,7 @@ jobs: - name: Run update script env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python .github/scripts/update-structure.py + run: python .github/scripts/update_structure.py - name: Commit and push if changed run: | From 03a5c050eed1328f8a1966fb09c86df8f74a6a48 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:18:48 +0000 Subject: [PATCH 07/10] Update repo structure --- README.md | 536 +++++++++++++++++++++++---------------------- repo_structure.txt | 18 ++ 2 files changed, 295 insertions(+), 259 deletions(-) create mode 100644 repo_structure.txt diff --git a/README.md b/README.md index 10777bf..ec89f31 100644 --- a/README.md +++ b/README.md @@ -1,259 +1,277 @@ -# STATION GUIDE : YOUR PLATFORM GUIDE - - - - - - -[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) - - - - - - -Typing SVG -Welcome to repository of Station Guide - -- To get to know about Station Guide Check : - [StationGuide.md](https://github.com/dhairyagothi/StationGuide/blob/f2d4795cf3d3c57ffafb6ce007f47173d7010b1e/StationGuide.md) - -- To check UI Prototype Figma design :- [StationGuideFigma.md](https://github.com/dhairyagothi/StationGuide/blob/f2d4795cf3d3c57ffafb6ce007f47173d7010b1e/StationGuideFigma.md) - - - - - -### This project is now OFFICIALLY accepted for - -
- GSSoC 2024 Extd -
-
- - - - -## Table of Content - -- **[Using Station Guide](#using-station-guide)** -- **[Getting Started](#getting-started)** -- **[Project Structure](#project-structure)** -- **[How to Contribute](#how-to-contribute)** -- **[Code of Conduct](#code-of-conduct)** -- **[How to Fork](#how-to-fork)** -- **[Contributors](#contributors)** -- **[Contact Information](#contact-information)** - - - - -## Using Station Guide - -This project utilizes React for the frontend and Express for the backend, providing a robust foundation for your web application development. - -### Prerequisites - -To get started, you'll need the following: - -- Node.js (version 14 or later): https://nodejs.org/en/ -- npm (Node Package Manager) comes bundled with Node.js - -
- - - - -## Getting Started - -### 1. Clone the Repository - -**Understanding Cloning:** - -Cloning creates a local copy of the project on your computer, allowing you to work on it independently. This local copy is a mirror image of the original repository on GitHub or similar platforms. - -Use Git to clone this repository into your local development environment: - -```bash -git clone https://github.com/dhairyagothi/StationGuide.git -``` - -**After Cloning** -You will see this interface in your system : - -![image](https://github.com/user-attachments/assets/20961ae0-2d63-45e7-9aa4-9adc01fcc4d0) - -### 2. Running the Development Server - -#### Frontend: - -- Open a terminal or command prompt window. -- Navigate to the frontend directory: - -```Bash -cd frontend -``` - -- Start the frontend development server : - -```Bash -npm run dev -``` - -This will typically launch the React application on http://localhost:3000 (or the specified port) in your browser. - -#### Backend: - -- Open another terminal or command prompt window (separate from the frontend window). -- Navigate to the backend directory: - -```Bash -cd backend -``` - -Start the backend development server (typically using nodemon server.js or a similar command): - -```Bash -npm run start -``` - - - - -## Project Structure - -### Project strucutre - - -``` -``` - - - - - - -## How to Contribute - -Contributions are always welcome! -To ensure a smooth collaboration process, Follow these steps: - - -1. **Fork the Repository:** - - - Click the "Fork" button on the top right of the repository page. This creates a copy of the repository under your GitHub account. - -2. **Clone Your Fork:** - - - Run the following command in your terminal: - ```bash - git clone https://github.com/YOUR_USERNAME/Awesome-Github-Profiles.git - ``` - - This command downloads your fork to your local machine. - -3. **Create a Branch:** - - - Navigate into the cloned repository: - ```bash - cd Awesome-Github-Profiles - ``` - - Create a new branch for your feature or fix: - ```bash - git checkout -b your-feature-branch - ``` - -4. **Make Your Changes:** - - - Implement your changes in your local repository. Make sure your code is clean and follows the project's coding style guidelines. - -5. **Test Your Changes:** - - - If applicable, run tests to ensure that your changes do not break existing functionality. - -6. **Commit Your Changes:** - - - Commit your changes with a clear and descriptive message: - ```bash - git commit -m "Add a feature or fix a bug" - ``` - -7. **Push to Your Fork:** - - - Push your changes back to your forked repository: - ```bash - git push origin your-feature-branch - ``` - -8. **Create a Pull Request:** - - Navigate to the original repository where you want to propose your changes. - - Click on "New Pull Request" and follow the instructions to submit your changes for review. - -Please refer to the detailed [contribution guidelines](CONTRIBUTING.md) for more information. - - - - -## Code of Conduct - -To foster a positive and inclusive community, please adhere to the following guidelines: - -- **Be Respectful:** Treat everyone with respect. Engage in constructive conversations. -- **No Harassment:** Harassment, bullying, or discrimination will not be tolerated. -- **Report Issues:** If you witness or experience any unacceptable behavior, please report it to the project maintainers. - -Please read the [code of Conduct](CODE_OF_CONDUCT.md) for more clear understanding. - - - - -## How to Fork - -Forking allows you to create a personal copy of the repository, where you can experiment and make changes without affecting the original project. Here’s how to do it: - -### Navigate to the Repository: - -- Go to the Awesome GitHub Profiles repository. - -### Click on Fork: - -- On the top right corner, click the "Fork" button. - -### Select Your Account: - -- Choose your GitHub account to create the fork. - -### Clone Your Fork: - -- Use the command below to clone your fork to your local machine: - ```bash - git clone https://github.com/YOUR_USERNAME/Awesome-Github-Profiles.git - ``` -
- - - - -## Our Valuable Contributors ❤️✨ - -[![Contributors](https://contrib.rocks/image?repo=dhairyagothi/StationGuide)](https://github.com/dhairyagothi/StationGuide/graphs/contributors) - - - - - -## 👥 Team - -| ![Dhairya Gothi](https://avatars.githubusercontent.com/u/142989448?v=4&s=80)| -|:--:| -| **Dhairya Gothi**
Project Admin | -| [![LinkedIn](https://img.icons8.com/fluency/32/000000/linkedin.png)](https://www.linkedin.com/in/dhairya-gothi-65945b288/) | - -If you have questions, suggestions, or feedback, please reach out via email at dhairyag31@gmail.com. You can also join our [discussion forum](https://github.com/dhairyagothi/StationGuide/discussions). - -We value open communication and are happy to help! - - - - - -## ⭐️ Support the Project -If you find this project helpful, please consider giving it a ⭐ on GitHub! Your support helps to grow the project and reach more contributors. +# STATION GUIDE : YOUR PLATFORM GUIDE + + + + + + +[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) + + + + + + +Typing SVG +Welcome to repository of Station Guide + +- To get to know about Station Guide Check : - [StationGuide.md](https://github.com/dhairyagothi/StationGuide/blob/f2d4795cf3d3c57ffafb6ce007f47173d7010b1e/StationGuide.md) + +- To check UI Prototype Figma design :- [StationGuideFigma.md](https://github.com/dhairyagothi/StationGuide/blob/f2d4795cf3d3c57ffafb6ce007f47173d7010b1e/StationGuideFigma.md) + + + + + +### This project is now OFFICIALLY accepted for + +
+ GSSoC 2024 Extd +
+
+ + + + +## Table of Content + +- **[Using Station Guide](#using-station-guide)** +- **[Getting Started](#getting-started)** +- **[Project Structure](#project-structure)** +- **[How to Contribute](#how-to-contribute)** +- **[Code of Conduct](#code-of-conduct)** +- **[How to Fork](#how-to-fork)** +- **[Contributors](#contributors)** +- **[Contact Information](#contact-information)** + + + + +## Using Station Guide + +This project utilizes React for the frontend and Express for the backend, providing a robust foundation for your web application development. + +### Prerequisites + +To get started, you'll need the following: + +- Node.js (version 14 or later): https://nodejs.org/en/ +- npm (Node Package Manager) comes bundled with Node.js + +
+ + + + +## Getting Started + +### 1. Clone the Repository + +**Understanding Cloning:** + +Cloning creates a local copy of the project on your computer, allowing you to work on it independently. This local copy is a mirror image of the original repository on GitHub or similar platforms. + +Use Git to clone this repository into your local development environment: + +```bash +git clone https://github.com/dhairyagothi/StationGuide.git +``` + +**After Cloning** +You will see this interface in your system : + +![image](https://github.com/user-attachments/assets/20961ae0-2d63-45e7-9aa4-9adc01fcc4d0) + +### 2. Running the Development Server + +#### Frontend: + +- Open a terminal or command prompt window. +- Navigate to the frontend directory: + +```Bash +cd frontend +``` + +- Start the frontend development server : + +```Bash +npm run dev +``` + +This will typically launch the React application on http://localhost:3000 (or the specified port) in your browser. + +#### Backend: + +- Open another terminal or command prompt window (separate from the frontend window). +- Navigate to the backend directory: + +```Bash +cd backend +``` + +Start the backend development server (typically using nodemon server.js or a similar command): + +```Bash +npm run start +``` + + + + +## Project Structure + +### Project strucutre + + +``` +├── backend +│ ├── config +│ ├── controllers +│ ├── dataset +│ ├── middleware +│ ├── models +│ ├── public +│ ├── routes +│ └── utils +├── frontend +│ ├── public +│ ├── src +│ │ ├── Pages +│ │ ├── assets +│ │ │ └── svg +│ │ ├── components +│ │ ├── dataset +│ │ └── validations +``` + + + + + + +## How to Contribute + +Contributions are always welcome! +To ensure a smooth collaboration process, Follow these steps: + + +1. **Fork the Repository:** + + - Click the "Fork" button on the top right of the repository page. This creates a copy of the repository under your GitHub account. + +2. **Clone Your Fork:** + + - Run the following command in your terminal: + ```bash + git clone https://github.com/YOUR_USERNAME/Awesome-Github-Profiles.git + ``` + - This command downloads your fork to your local machine. + +3. **Create a Branch:** + + - Navigate into the cloned repository: + ```bash + cd Awesome-Github-Profiles + ``` + - Create a new branch for your feature or fix: + ```bash + git checkout -b your-feature-branch + ``` + +4. **Make Your Changes:** + + - Implement your changes in your local repository. Make sure your code is clean and follows the project's coding style guidelines. + +5. **Test Your Changes:** + + - If applicable, run tests to ensure that your changes do not break existing functionality. + +6. **Commit Your Changes:** + + - Commit your changes with a clear and descriptive message: + ```bash + git commit -m "Add a feature or fix a bug" + ``` + +7. **Push to Your Fork:** + + - Push your changes back to your forked repository: + ```bash + git push origin your-feature-branch + ``` + +8. **Create a Pull Request:** + - Navigate to the original repository where you want to propose your changes. + - Click on "New Pull Request" and follow the instructions to submit your changes for review. + +Please refer to the detailed [contribution guidelines](CONTRIBUTING.md) for more information. + + + + +## Code of Conduct + +To foster a positive and inclusive community, please adhere to the following guidelines: + +- **Be Respectful:** Treat everyone with respect. Engage in constructive conversations. +- **No Harassment:** Harassment, bullying, or discrimination will not be tolerated. +- **Report Issues:** If you witness or experience any unacceptable behavior, please report it to the project maintainers. + +Please read the [code of Conduct](CODE_OF_CONDUCT.md) for more clear understanding. + + + + +## How to Fork + +Forking allows you to create a personal copy of the repository, where you can experiment and make changes without affecting the original project. Here’s how to do it: + +### Navigate to the Repository: + +- Go to the Awesome GitHub Profiles repository. + +### Click on Fork: + +- On the top right corner, click the "Fork" button. + +### Select Your Account: + +- Choose your GitHub account to create the fork. + +### Clone Your Fork: + +- Use the command below to clone your fork to your local machine: + ```bash + git clone https://github.com/YOUR_USERNAME/Awesome-Github-Profiles.git + ``` +
+ + + + +## Our Valuable Contributors ❤️✨ + +[![Contributors](https://contrib.rocks/image?repo=dhairyagothi/StationGuide)](https://github.com/dhairyagothi/StationGuide/graphs/contributors) + + + + + +## 👥 Team + +| ![Dhairya Gothi](https://avatars.githubusercontent.com/u/142989448?v=4&s=80)| +|:--:| +| **Dhairya Gothi**
Project Admin | +| [![LinkedIn](https://img.icons8.com/fluency/32/000000/linkedin.png)](https://www.linkedin.com/in/dhairya-gothi-65945b288/) | + +If you have questions, suggestions, or feedback, please reach out via email at dhairyag31@gmail.com. You can also join our [discussion forum](https://github.com/dhairyagothi/StationGuide/discussions). + +We value open communication and are happy to help! + + + + + +## ⭐️ Support the Project +If you find this project helpful, please consider giving it a ⭐ on GitHub! Your support helps to grow the project and reach more contributors. diff --git a/repo_structure.txt b/repo_structure.txt new file mode 100644 index 0000000..9e53ab4 --- /dev/null +++ b/repo_structure.txt @@ -0,0 +1,18 @@ +├── backend +│ ├── config +│ ├── controllers +│ ├── dataset +│ ├── middleware +│ ├── models +│ ├── public +│ ├── routes +│ └── utils +├── frontend +│ ├── public +│ ├── src +│ │ ├── Pages +│ │ ├── assets +│ │ │ └── svg +│ │ ├── components +│ │ ├── dataset +│ │ └── validations \ No newline at end of file From d9dc48bed57bd964c433d838defd81e669285c2d Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 17:53:55 +0530 Subject: [PATCH 08/10] Update to fetch inner files too in the python script --- .github/scripts/update_structure.py | 68 +++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/.github/scripts/update_structure.py b/.github/scripts/update_structure.py index 970c0ee..2b8bd75 100644 --- a/.github/scripts/update_structure.py +++ b/.github/scripts/update_structure.py @@ -2,28 +2,51 @@ import github from github import Github +# Helper function to recursively build the repo structure and include file extensions def get_repo_structure(path='.', prefix=''): structure = [] - items = sorted(os.listdir(path)) + try: + items = sorted(os.listdir(path)) + except FileNotFoundError: + print(f"Path not found: {path}") + return structure + for i, item in enumerate(items): if item.startswith('.'): - continue + continue # Skip hidden files and directories item_path = os.path.join(path, item) + is_last = i == len(items) - 1 + current_prefix = '└── ' if is_last else '├── ' + if os.path.isdir(item_path): - is_last = i == len(items) - 1 - current_prefix = '└── ' if is_last else '├── ' - structure.append(f"{prefix}{current_prefix}{item}") + # Directory case + structure.append(f"{prefix}{current_prefix}{item}/") next_prefix = prefix + (' ' if is_last else '│ ') structure.extend(get_repo_structure(item_path, next_prefix)) + else: + # File case with extension + file_name, file_extension = os.path.splitext(item) + structure.append(f"{prefix}{current_prefix}{file_name}{file_extension}") + return structure +# Function to update the repo_structure.txt file def update_structure_file(structure): - with open('repo_structure.txt', 'w') as f: - f.write('\n'.join(structure)) + try: + with open('repo_structure.txt', 'w') as f: + f.write('\n'.join(structure)) + print("repo_structure.txt updated successfully.") + except IOError as e: + print(f"Error writing to repo_structure.txt: {e}") +# Function to update the README.md with the new structure def update_README(structure): - with open('README.md', 'r') as f: # updated file name - content = f.read() + try: + with open('README.md', 'r') as f: + content = f.read() + except FileNotFoundError: + print("README.md not found.") + return start_marker = '' end_marker = '' @@ -37,20 +60,31 @@ def update_README(structure): '\n```\n' + '\n'.join(structure) + '\n```\n' + content[end_index:] ) - - with open('README.md', 'w') as f: - f.write(new_content) - print("README.md updated with new structure.") + try: + with open('README.md', 'w') as f: + f.write(new_content) + print("README.md updated with new structure.") + except IOError as e: + print(f"Error writing to README.md: {e}") else: - print("Markers not found in Repo-structure.md. Structure not updated.") + print("Markers not found in README.md. Structure not updated.") +# Main function to compare and update repository structure def main(): - g = Github(os.environ['GH_TOKEN']) - repo = g.get_repo(os.environ['GITHUB_REPOSITORY']) + gh_token = os.getenv('GH_TOKEN') + gh_repo = os.getenv('GITHUB_REPOSITORY') + + if not gh_token or not gh_repo: + print("Environment variables GH_TOKEN and GITHUB_REPOSITORY must be set.") + return + + g = Github(gh_token) + repo = g.get_repo(gh_repo) current_structure = get_repo_structure() try: + # Fetch the contents of repo_structure.txt from GitHub contents = repo.get_contents("repo_structure.txt") existing_structure = contents.decoded_content.decode().split('\n') except github.GithubException: @@ -64,4 +98,4 @@ def main(): print("No changes in repository structure.") if __name__ == "__main__": - main() \ No newline at end of file + main() From a3b6962ec122e973c684d030e4ea3f46e18ee57b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:24:24 +0000 Subject: [PATCH 09/10] Update repo structure --- README.md | 132 ++++++++++++++++++++++++++++++++++++++------- repo_structure.txt | 132 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 228 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index ec89f31..cbbe9c7 100644 --- a/README.md +++ b/README.md @@ -125,24 +125,120 @@ npm run start ``` -├── backend -│ ├── config -│ ├── controllers -│ ├── dataset -│ ├── middleware -│ ├── models -│ ├── public -│ ├── routes -│ └── utils -├── frontend -│ ├── public -│ ├── src -│ │ ├── Pages -│ │ ├── assets -│ │ │ └── svg -│ │ ├── components -│ │ ├── dataset -│ │ └── validations +├── CODE_OF_CONDUCT.md +├── CONTRIBUTING.md +├── LICENSE +├── Learn.md +├── README.md +├── SECURITY.md +├── StationGuide.md +├── StationGuideFigma.md +├── backend/ +│ ├── config/ +│ │ ├── config.js +│ │ └── dbConnection.js +│ ├── controllers/ +│ │ ├── StationController.js +│ │ ├── WheelchairController.js +│ │ ├── authController.js +│ │ ├── cloakroomController.js +│ │ ├── coolieController.js +│ │ ├── stationBookingsController.js +│ │ └── stationsController.js +│ ├── dataset/ +│ │ └── stations.js +│ ├── dockerfile +│ ├── index.js +│ ├── middleware/ +│ │ └── auth.middleware.js +│ ├── models/ +│ │ ├── CloakroomBooking.js +│ │ ├── CoolieBooking.js +│ │ ├── Stations.js +│ │ ├── User.js +│ │ └── WheelchairBooking.js +│ ├── package-lock.json +│ ├── package.json +│ ├── public/ +│ │ └── test.html +│ ├── routes/ +│ │ ├── authRoutes.js +│ │ └── stationRoutes.js +│ └── utils/ +│ ├── ApiError.js +│ ├── asyncHandler.js +│ └── authFunctions.js +├── docker-compose.yml +├── frontend/ +│ ├── README.md +│ ├── dockerfile +│ ├── eslint.config.js +│ ├── index.html +│ ├── package-lock.json +│ ├── package.json +│ ├── postcss.config.js +│ ├── public/ +│ │ └── vite.svg +│ ├── src/ +│ │ ├── App.css +│ │ ├── App.jsx +│ │ ├── Pages/ +│ │ │ ├── 3Dmaps.jsx +│ │ │ ├── ContactUs.jsx +│ │ │ ├── Herosection.css +│ │ │ ├── Herosection.jsx +│ │ │ ├── LoginPage.jsx +│ │ │ ├── Register.jsx +│ │ │ ├── booking.jsx +│ │ │ ├── contributor.jsx +│ │ │ ├── hamburger.css +│ │ │ ├── hamburger.jsx +│ │ │ ├── navigation.jsx +│ │ │ ├── notification.jsx +│ │ │ ├── schedule.jsx +│ │ │ └── stations.jsx +│ │ ├── assets/ +│ │ │ ├── bg.png +│ │ │ ├── bgmobile.png +│ │ │ ├── hero.png +│ │ │ ├── mixbg.png +│ │ │ ├── stationsaarthi.svg +│ │ │ └── svg/ +│ │ │ ├── 3dmap.svg +│ │ │ ├── backicon.svg +│ │ │ ├── bookings.svg +│ │ │ ├── chatbot.svg +│ │ │ ├── contributor.svg +│ │ │ ├── navigation.svg +│ │ │ ├── notification.svg +│ │ │ ├── schedule.svg +│ │ │ ├── search.svg +│ │ │ └── station.svg +│ │ ├── components/ +│ │ │ ├── Bookingform.jsx +│ │ │ ├── MapComponent.jsx +│ │ │ ├── Settings.jsx +│ │ │ ├── about.css +│ │ │ ├── about.jsx +│ │ │ ├── chatbot.css +│ │ │ ├── chatbot.jsx +│ │ │ ├── footer.jsx +│ │ │ ├── help.jsx +│ │ │ ├── navbar.jsx +│ │ │ ├── scrollToTop.css +│ │ │ └── scrollToTop.jsx +│ │ ├── dataset/ +│ │ │ └── stations.js +│ │ ├── index.css +│ │ ├── main.jsx +│ │ └── validations/ +│ │ └── validation.js +│ ├── tailwind.config.js +│ └── vite.config.js +├── package-lock.json +├── package.json +├── repo_structure.txt +└── tailwind.config.js ``` diff --git a/repo_structure.txt b/repo_structure.txt index 9e53ab4..c18e9da 100644 --- a/repo_structure.txt +++ b/repo_structure.txt @@ -1,18 +1,114 @@ -├── backend -│ ├── config -│ ├── controllers -│ ├── dataset -│ ├── middleware -│ ├── models -│ ├── public -│ ├── routes -│ └── utils -├── frontend -│ ├── public -│ ├── src -│ │ ├── Pages -│ │ ├── assets -│ │ │ └── svg -│ │ ├── components -│ │ ├── dataset -│ │ └── validations \ No newline at end of file +├── CODE_OF_CONDUCT.md +├── CONTRIBUTING.md +├── LICENSE +├── Learn.md +├── README.md +├── SECURITY.md +├── StationGuide.md +├── StationGuideFigma.md +├── backend/ +│ ├── config/ +│ │ ├── config.js +│ │ └── dbConnection.js +│ ├── controllers/ +│ │ ├── StationController.js +│ │ ├── WheelchairController.js +│ │ ├── authController.js +│ │ ├── cloakroomController.js +│ │ ├── coolieController.js +│ │ ├── stationBookingsController.js +│ │ └── stationsController.js +│ ├── dataset/ +│ │ └── stations.js +│ ├── dockerfile +│ ├── index.js +│ ├── middleware/ +│ │ └── auth.middleware.js +│ ├── models/ +│ │ ├── CloakroomBooking.js +│ │ ├── CoolieBooking.js +│ │ ├── Stations.js +│ │ ├── User.js +│ │ └── WheelchairBooking.js +│ ├── package-lock.json +│ ├── package.json +│ ├── public/ +│ │ └── test.html +│ ├── routes/ +│ │ ├── authRoutes.js +│ │ └── stationRoutes.js +│ └── utils/ +│ ├── ApiError.js +│ ├── asyncHandler.js +│ └── authFunctions.js +├── docker-compose.yml +├── frontend/ +│ ├── README.md +│ ├── dockerfile +│ ├── eslint.config.js +│ ├── index.html +│ ├── package-lock.json +│ ├── package.json +│ ├── postcss.config.js +│ ├── public/ +│ │ └── vite.svg +│ ├── src/ +│ │ ├── App.css +│ │ ├── App.jsx +│ │ ├── Pages/ +│ │ │ ├── 3Dmaps.jsx +│ │ │ ├── ContactUs.jsx +│ │ │ ├── Herosection.css +│ │ │ ├── Herosection.jsx +│ │ │ ├── LoginPage.jsx +│ │ │ ├── Register.jsx +│ │ │ ├── booking.jsx +│ │ │ ├── contributor.jsx +│ │ │ ├── hamburger.css +│ │ │ ├── hamburger.jsx +│ │ │ ├── navigation.jsx +│ │ │ ├── notification.jsx +│ │ │ ├── schedule.jsx +│ │ │ └── stations.jsx +│ │ ├── assets/ +│ │ │ ├── bg.png +│ │ │ ├── bgmobile.png +│ │ │ ├── hero.png +│ │ │ ├── mixbg.png +│ │ │ ├── stationsaarthi.svg +│ │ │ └── svg/ +│ │ │ ├── 3dmap.svg +│ │ │ ├── backicon.svg +│ │ │ ├── bookings.svg +│ │ │ ├── chatbot.svg +│ │ │ ├── contributor.svg +│ │ │ ├── navigation.svg +│ │ │ ├── notification.svg +│ │ │ ├── schedule.svg +│ │ │ ├── search.svg +│ │ │ └── station.svg +│ │ ├── components/ +│ │ │ ├── Bookingform.jsx +│ │ │ ├── MapComponent.jsx +│ │ │ ├── Settings.jsx +│ │ │ ├── about.css +│ │ │ ├── about.jsx +│ │ │ ├── chatbot.css +│ │ │ ├── chatbot.jsx +│ │ │ ├── footer.jsx +│ │ │ ├── help.jsx +│ │ │ ├── navbar.jsx +│ │ │ ├── scrollToTop.css +│ │ │ └── scrollToTop.jsx +│ │ ├── dataset/ +│ │ │ └── stations.js +│ │ ├── index.css +│ │ ├── main.jsx +│ │ └── validations/ +│ │ └── validation.js +│ ├── tailwind.config.js +│ └── vite.config.js +├── package-lock.json +├── package.json +├── repo_structure.txt +└── tailwind.config.js \ No newline at end of file From 1f76a03207c8e0087bf04d92a245e30c89ec5fb5 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 16 Oct 2024 18:00:08 +0530 Subject: [PATCH 10/10] Update README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index cbbe9c7..7bc97b9 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,6 @@ npm run start ## Project Structure -### Project strucutre - ``` ├── CODE_OF_CONDUCT.md