Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OmDixit2107 committed Nov 17, 2024
0 parents commit 14c1b78
Show file tree
Hide file tree
Showing 294 changed files with 15,414 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEMINI_API=
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug report 🐞
description: File a bug report
title: "[Bug]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: A concise description of what you are experiencing.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Add ScreenShots
description: Add sufficient ScreenShots to explain your issue.
- type: dropdown
id: devices
attributes:
label: On which device are you experiencing this bug?
multiple: true
options:
- Android
- iPhone
- Linux
- Chrome
- Windows
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC Ext'24 contributor"
required: False
- label: "I'm a Hacktoberfest 2024 contributor"
required: False
- label: "I have starred the repository"
required: true
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 📝 Documentation Update
description: Improve Documentation
title: "[Documentation Update]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the updates you want to make.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: issue-description
attributes:
label: Issue Description
description: Please provide a clear description of the documentation update you are suggesting.
placeholder: Describe the improvement or correction you'd like to see in the documentation.
validations:
required: true
- type: textarea
id: suggested-change
attributes:
label: Suggested Change
description: Provide details of the proposed change to the documentation.
placeholder: Explain how the documentation should be updated or corrected.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: Rationale
description: Why is this documentation update necessary or beneficial?
placeholder: Explain the importance or reasoning behind the suggested change.
validations:
required: False
- type: dropdown
id: urgency
attributes:
label: Urgency
description: How urgently do you believe this documentation update is needed?
options:
- High
- Medium
- Low
default: 0
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC Ext'24 contributor"
required: false
- label: "I'm a Hacktoberfest 2024 contributor"
required: false
- label: "I have starred the repository"
required: true
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ✨ Feature Request or Module
description: Suggest a feature or Module
title: "[Feature Request]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for this feature.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: feature-description
attributes:
label: Feature Description
description: Please provide a detailed description of the feature you are requesting.
placeholder: Describe the new feature or enhancement you'd like to see.
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use Case
description: How would this feature enhance your use of the project?
placeholder: Describe a specific use case or scenario where this feature would be beneficial.
validations:
required: true
- type: textarea
id: benefits
attributes:
label: Benefits
description: What benefits would this feature bring to the project or community?
placeholder: Explain the advantages of implementing this feature.
- type: textarea
id: screenShots
attributes:
label: Add ScreenShots
description: If any...
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is this feature to you?
options:
- High
- Medium
- Low
default: 0
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC Ext'24 contributor"
required: false
- label: "I'm a Hacktoberfest 2024 contributor"
required: False
- label: "I have starred the repository"
required: true
101 changes: 101 additions & 0 deletions .github/scripts/update_structure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
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 = []
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 # 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):
# 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):
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):
try:
with open('PROJECT_STRUCTURE.md', 'r') as f:
content = f.read()
except FileNotFoundError:
print("PROJECT_STRUCTURE.md not found.")
return

start_marker = '<!-- START_STRUCTURE -->'
end_marker = '<!-- END_STRUCTURE -->'

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:]
)
try:
with open('PROJECT_STRUCTURE.md', 'w') as f:
f.write(new_content)
print("PROJECT_STRUCTURE.md updated with new structure.")
except IOError as e:
print(f"Error writing to PROJECT_STRUCTURE.md: {e}")
else:
print("Markers not found in PROJECT_STRUCTURE.md. Structure not updated.")

# Main function to compare and update repository structure
def main():
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:
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()
41 changes: 41 additions & 0 deletions .github/workflows/build_apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build APK on Merge to Main

on:
push:
branches:
- main

jobs:
build-apk:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.5'
channel: stable

- name: Install dependencies
run: flutter pub get
continue-on-error: true

- name: Build APK
run: flutter build apk --release
continue-on-error: true

- name: Upload APK as artifact
uses: actions/upload-artifact@v3
with:
name: apk
path: build/app/outputs/flutter-apk/app-release.apk
continue-on-error: true
16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "👋 Thank you @${{ github.actor }} for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!"
pr-message: " 🎉 Thank you @${{ github.actor }} for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better"
38 changes: 38 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 14c1b78

Please sign in to comment.