Skip to content

Commit c411bff

Browse files
authored
Merge pull request #71 from siri-chandana-macha/new
Added Project Structure
2 parents f83ee40 + 027c89b commit c411bff

File tree

3 files changed

+487
-0
lines changed

3 files changed

+487
-0
lines changed

.github/scripts/update_structure.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import os
2+
import github
3+
from github import Github
4+
5+
# Helper function to recursively build the repo structure and include file extensions
6+
def get_repo_structure(path='.', prefix=''):
7+
structure = []
8+
try:
9+
items = sorted(os.listdir(path))
10+
except FileNotFoundError:
11+
print(f"Path not found: {path}")
12+
return structure
13+
14+
for i, item in enumerate(items):
15+
if item.startswith('.'):
16+
continue # Skip hidden files and directories
17+
item_path = os.path.join(path, item)
18+
is_last = i == len(items) - 1
19+
current_prefix = '└── ' if is_last else '├── '
20+
21+
if os.path.isdir(item_path):
22+
# Directory case
23+
structure.append(f"{prefix}{current_prefix}{item}/")
24+
next_prefix = prefix + (' ' if is_last else '│ ')
25+
structure.extend(get_repo_structure(item_path, next_prefix))
26+
else:
27+
# File case with extension
28+
file_name, file_extension = os.path.splitext(item)
29+
structure.append(f"{prefix}{current_prefix}{file_name}{file_extension}")
30+
31+
return structure
32+
33+
# Function to update the repo_structure.txt file
34+
def update_structure_file(structure):
35+
try:
36+
with open('repo_structure.txt', 'w') as f:
37+
f.write('\n'.join(structure))
38+
print("repo_structure.txt updated successfully.")
39+
except IOError as e:
40+
print(f"Error writing to repo_structure.txt: {e}")
41+
42+
# Function to update the README.md with the new structure
43+
def update_README(structure):
44+
try:
45+
with open('PROJECT_STRUCTURE.md', 'r') as f:
46+
content = f.read()
47+
except FileNotFoundError:
48+
print("PROJECT_STRUCTURE.md not found.")
49+
return
50+
51+
start_marker = '<!-- START_STRUCTURE -->'
52+
end_marker = '<!-- END_STRUCTURE -->'
53+
54+
start_index = content.find(start_marker)
55+
end_index = content.find(end_marker)
56+
57+
if start_index != -1 and end_index != -1:
58+
new_content = (
59+
content[:start_index + len(start_marker)] +
60+
'\n```\n' + '\n'.join(structure) + '\n```\n' +
61+
content[end_index:]
62+
)
63+
try:
64+
with open('PROJECT_STRUCTURE.md', 'w') as f:
65+
f.write(new_content)
66+
print("PROJECT_STRUCTURE.md updated with new structure.")
67+
except IOError as e:
68+
print(f"Error writing to PROJECT_STRUCTURE.md: {e}")
69+
else:
70+
print("Markers not found in PROJECT_STRUCTURE.md. Structure not updated.")
71+
72+
# Main function to compare and update repository structure
73+
def main():
74+
gh_token = os.getenv('GH_TOKEN')
75+
gh_repo = os.getenv('GITHUB_REPOSITORY')
76+
77+
if not gh_token or not gh_repo:
78+
print("Environment variables GH_TOKEN and GITHUB_REPOSITORY must be set.")
79+
return
80+
81+
g = Github(gh_token)
82+
repo = g.get_repo(gh_repo)
83+
84+
current_structure = get_repo_structure()
85+
86+
try:
87+
# Fetch the contents of repo_structure.txt from GitHub
88+
contents = repo.get_contents("repo_structure.txt")
89+
existing_structure = contents.decoded_content.decode().split('\n')
90+
except github.GithubException:
91+
existing_structure = None
92+
93+
if current_structure != existing_structure:
94+
update_structure_file(current_structure)
95+
update_README(current_structure)
96+
print("Repository structure updated.")
97+
else:
98+
print("No changes in repository structure.")
99+
100+
if __name__ == "__main__":
101+
main()

PROJECT_STRUCTURE.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
Citizen_Squad
2+
3+
├── .gitHub
4+
│ ├── ISSUE_TEMPLATE
5+
│ │ └── bug-report.yml
6+
│ ├── scripts
7+
│ │ └── update_structure.py
8+
│ └── workflows
9+
│ ├── build_apk.yml
10+
│ ├── issue-open-close.yml
11+
│ └── pr-merge.yml
12+
13+
├── .vscode
14+
│ └── launch.json
15+
16+
├── android
17+
│ ├── .gitignore
18+
│ ├── .gradle
19+
│ │ ├── 8.3
20+
│ │ ├── checksums
21+
│ │ ├── checksums.lock
22+
│ │ ├── fileChanges
23+
│ │ ├── last-build.bin
24+
│ │ ├── fileHashes
25+
│ │ ├── fileHashes.lock
26+
│ │ ├── gc.properties
27+
│ │ ├── vcsMetadata
28+
│ │ └── vcs-1
29+
│ ├── app
30+
│ │ ├── build.gradle
31+
│ │ ├── google-services.json
32+
│ │ └── src
33+
│ │ ├── debug
34+
│ │ │ └── AndroidManifest.xml
35+
│ │ ├── main
36+
│ │ │ ├── AndroidManifest.xml
37+
│ │ │ ├── kotlin
38+
│ │ │ └── com
39+
│ │ │ └── open_innov
40+
│ │ │ └── hackingly_new
41+
│ │ │ └── MainActivity.kt
42+
│ │ └── res
43+
│ │ ├── drawable
44+
│ │ │ └── launch_background.xml
45+
│ │ ├── drawable-v21
46+
│ │ │ └── launch_background.xml
47+
│ │ ├── mipmap-hdpi
48+
│ │ │ └── ic_launcher.png
49+
│ │ ├── mipmap-mdpi
50+
│ │ │ └── ic_launcher.png
51+
│ │ ├── mipmap-xhdpi
52+
│ │ │ └── ic_launcher.png
53+
│ │ ├── mipmap-xxhdpi
54+
│ │ │ └── ic_launcher.png
55+
│ │ ├── mipmap-xxxhdpi
56+
│ │ │ └── ic_launcher.png
57+
│ │ ├── values
58+
│ │ │ └── styles.xml
59+
│ │ ├── values-night
60+
│ │ │ └── styles.xml
61+
│ │ └── profile
62+
│ │ └── AndroidManifest.xml
63+
│ ├── build.gradle
64+
│ ├── gradle
65+
│ │ └── wrapper
66+
│ │ └── gradle-wrapper.properties
67+
│ ├── gradle.properties
68+
│ └── settings.gradle
69+
70+
├── assets
71+
│ ├── images
72+
│ │ ├── abnCar.png
73+
│ │ ├── auth.png
74+
│ │ ├── car.jpeg
75+
│ │ ├── garbage.jpeg
76+
│ │ ├── garbage2.png
77+
│ │ ├── potHoles.jpeg
78+
│ │ └── road.png
79+
│ └── lottie
80+
│ ├── auth1.json
81+
│ ├── auth2.json
82+
│ ├── authentication.json
83+
│ ├── loading.json
84+
│ ├── otp.json
85+
│ └── plane.json
86+
87+
├── ios
88+
│ ├── .gitignore
89+
│ ├── Flutter
90+
│ │ ├── AppFrameworkInfo.plist
91+
│ │ ├── Debug.xcconfig
92+
│ │ └── Release.xcconfig
93+
│ ├── Podfile
94+
│ ├── Podfile.lock
95+
│ ├── Runner
96+
│ │ ├── AppDelegate.swift
97+
│ │ ├── Assets.xcassets
98+
│ │ └── AppIcon.appiconset
99+
│ │ ├── Contents.json
100+
│ │ ├── [email protected]
101+
│ │ ├── [email protected]
102+
│ │ ├── [email protected]
103+
│ │ ├── [email protected]
104+
│ │ ├── [email protected]
105+
│ │ ├── [email protected]
106+
│ │ ├── [email protected]
107+
│ │ ├── [email protected]
108+
│ │ ├── [email protected]
109+
│ │ ├── [email protected]
110+
│ │ ├── [email protected]
111+
│ │ ├── [email protected]
112+
│ │ ├── [email protected]
113+
│ │ ├── [email protected]
114+
│ │ └── [email protected]
115+
│ │ ├── LaunchImage.imageset
116+
│ │ ├── Contents.json
117+
│ │ ├── LaunchImage.png
118+
│ │ ├── [email protected]
119+
│ │ ├── [email protected]
120+
│ │ └── README.md
121+
│ │ ├── Base.lproj
122+
│ │ ├── LaunchScreen.storyboard
123+
│ │ └── Main.storyboard
124+
│ │ ├── Info.plist
125+
│ │ └── Runner-Bridging-Header.h
126+
│ ├── Runner.xcodeproj
127+
│ │ ├── project.pbxproj
128+
│ │ ├── project.xcworkspace
129+
│ │ ├── contents.xcworkspacedata
130+
│ │ └── xcshareddata
131+
│ │ ├── IDEWorkspaceChecks.plist
132+
│ │ └── WorkspaceSettings.xcsettings
133+
│ ├── Runner.xcworkspace
134+
│ │ ├── contents.xcworkspacedata
135+
│ │ └── xcshareddata
136+
│ ├── IDEWorkspaceChecks.plist
137+
│ └── WorkspaceSettings.xcsettings
138+
│ └── RunnerTests
139+
│ └── RunnerTests.swift
140+
141+
├── lib
142+
│ ├── admin_dashboard
143+
│ │ └── admin_dashboard.dart
144+
│ ├── controllers
145+
│ │ └── navigation_bar_controller.dart
146+
│ ├── firebase_options.dart
147+
│ ├── main.dart
148+
│ ├── models
149+
│ │ ├── report.dart
150+
│ │ ├── reports_model.dart
151+
│ │ └── user_model.dart
152+
│ ├── pages
153+
│ │ ├── authentication
154+
│ │ ├── otp_delivery.dart
155+
│ │ └── phone_auth.dart
156+
│ │ ├── components
157+
│ │ └── index.dart
158+
│ │ ├── screens
159+
│ │ ├── admin
160+
│ │ └── rto_admin.dart
161+
│ │ ├── user
162+
│ │ ├── home_screen.dart
163+
│ │ ├── profile.dart
164+
│ │ └── reports_screen.dart
165+
│ │ ├── utilities
166+
│ │ ├── abandoned_cars.dart
167+
│ │ ├── garbage.dart
168+
│ │ ├── potholes_report.dart
169+
│ │ └── tracking.dart
170+
│ │ └── welcome_screen
171+
│ │ └── splash_screen.dart
172+
│ ├── providers
173+
│ │ ├── abandoned_cars_provider.dart
174+
│ │ ├── admin_dashboard.dart
175+
│ │ ├── garbage_report_provider.dart
176+
│ │ ├── mongo_provider.dart
177+
│ │ └── user_provider.dart
178+
│ ├── services
179+
│ │ ├── address_service.dart
180+
│ │ ├── firebase_storage_service.dart
181+
│ │ ├── image_picker_service.dart
182+
│ │ ├── report_submission_service.dart
183+
│ │ └── text_recognition_service.dart
184+
│ ├── utils
185+
│ │ └── constants.dart
186+
│ └── widgets
187+
│ └── CustomWidgets.dart
188+
189+
├── linux
190+
│ ├── .gitignore
191+
│ ├── CMakeLists.txt
192+
│ ├── flutter
193+
│ │ ├── CMakeLists.txt

0 commit comments

Comments
 (0)