Chan Meng commited on
Commit
009cd70
ยท
1 Parent(s): 132113e
GitHub README Profile Generator Development Guidelines.md DELETED
@@ -1,265 +0,0 @@
1
- # GitHub README Profile Generator Development Guidelines
2
-
3
- ## 1. Project Overview
4
-
5
- ### 1.1 Project Description
6
- A Hugging Face Space application that helps users generate personalized GitHub README profiles through AI interaction and template customization.
7
-
8
- ### 1.2 Core Features
9
- - AI-powered profile content generation
10
- - Template-based README structure
11
- - Interactive markdown preview
12
- - Section-by-section copying
13
- - Bulk markdown export
14
- - Live preview of generated content
15
-
16
- ## 2. Technical Stack
17
-
18
- ### 2.1 Core Technologies
19
- - Frontend Framework: Streamlit
20
- - AI Model: LLaMA/BLOOM (Open Source LLM)
21
- - Markdown Processing: Python-markdown
22
- - Version Control: Git
23
-
24
- ### 2.2 Required Dependencies
25
- ```requirements.txt
26
- streamlit>=1.24.0
27
- python-markdown>=3.4.0
28
- requests>=2.28.0
29
- python-dotenv>=0.19.0
30
- transformers>=4.30.0
31
- torch>=2.0.0
32
- ```
33
-
34
- ## 3. Project Structure
35
- ```
36
- readme-profile-generator/
37
- โ”œโ”€โ”€ app.py # Main Streamlit application
38
- โ”œโ”€โ”€ src/
39
- โ”‚ โ”œโ”€โ”€ ai/ # AI interaction modules
40
- โ”‚ โ”œโ”€โ”€ components/ # UI components
41
- โ”‚ โ”œโ”€โ”€ templates/ # README templates
42
- โ”‚ โ””โ”€โ”€ utils/ # Helper functions
43
- โ”œโ”€โ”€ tests/ # Test files
44
- โ”œโ”€โ”€ .gitignore
45
- โ”œโ”€โ”€ requirements.txt
46
- โ””โ”€โ”€ README.md
47
- ```
48
-
49
- ## 4. Development Phases
50
-
51
- ### Phase 1: MVP (Basic Foundation)
52
- **Objective**: Create basic working prototype
53
-
54
- **Features**:
55
- 1. Single-page Streamlit interface
56
- 2. Basic user input form
57
- 3. Simple markdown preview
58
- 4. Copy button for full content
59
-
60
- **Testing Criteria**:
61
- - UI renders correctly
62
- - Form captures all basic information
63
- - Preview displays formatted markdown
64
- - Copy function works correctly
65
-
66
- ### Phase 2: AI Integration
67
- **Objective**: Implement AI-powered content generation
68
-
69
- **Features**:
70
- 1. AI model integration
71
- 2. Basic prompt engineering
72
- 3. Content suggestion system
73
- 4. Error handling for AI responses
74
-
75
- **Testing Criteria**:
76
- - AI responds within 5 seconds
77
- - Generated content is relevant
78
- - Error messages are clear
79
- - Content format is valid markdown
80
-
81
- ### Phase 3: Template System
82
- **Objective**: Add template selection and customization
83
-
84
- **Features**:
85
- 1. Multiple template options
86
- 2. Template preview
87
- 3. Section customization
88
- 4. Template switching
89
-
90
- **Testing Criteria**:
91
- - All templates load correctly
92
- - Preview updates instantly
93
- - Customizations persist
94
- - Templates maintain formatting
95
-
96
- ### Phase 4: Advanced Features
97
- **Objective**: Implement section management and advanced copying
98
-
99
- **Features**:
100
- 1. Section-by-section editing
101
- 2. Individual section copying
102
- 3. Bulk export options
103
- 4. Session management
104
-
105
- **Testing Criteria**:
106
- - Sections can be individually modified
107
- - Copy functions work for all sections
108
- - Export includes all content
109
- - Sessions persist correctly
110
-
111
- ## 5. Coding Standards
112
-
113
- ### 5.1 Python Code Style
114
- - Follow PEP 8 guidelines
115
- - Use type hints
116
- - Maximum line length: 88 characters
117
- - Use descriptive variable names
118
-
119
- ### 5.2 File Organization
120
- - One class per file
121
- - Group related functionality in modules
122
- - Keep files under 500 lines
123
- - Use appropriate file naming conventions
124
-
125
- ### 5.3 Comments and Documentation
126
- - Each function must have docstrings
127
- - Complex logic requires inline comments
128
- - Update README.md with new features
129
- - Document all configuration options
130
-
131
- ## 6. Testing Guidelines
132
-
133
- ### 6.1 Testing Levels
134
- 1. Unit Testing
135
- - Test individual functions
136
- - Test UI components
137
- - Test markdown generation
138
-
139
- 2. Integration Testing
140
- - Test AI integration
141
- - Test template system
142
- - Test data flow
143
-
144
- 3. User Acceptance Testing
145
- - Test full user workflows
146
- - Test edge cases
147
- - Test error scenarios
148
-
149
- ### 6.2 Test Cases Structure
150
- ```python
151
- def test_feature():
152
- # Setup
153
- # Action
154
- # Assert
155
- # Cleanup
156
- ```
157
-
158
- ### 6.3 Testing Checklist
159
- - [ ] All new functions have unit tests
160
- - [ ] Integration tests pass
161
- - [ ] UI renders correctly
162
- - [ ] Error handling works
163
- - [ ] Performance meets requirements
164
-
165
- ## 7. Deployment Guidelines
166
-
167
- ### 7.1 Pre-deployment Checklist
168
- - [ ] All tests pass
169
- - [ ] Dependencies are updated
170
- - [ ] Environment variables are set
171
- - [ ] Documentation is updated
172
-
173
- ### 7.2 Deployment Process
174
- 1. Update requirements.txt
175
- 2. Run full test suite
176
- 3. Update Space secrets if needed
177
- 4. Deploy to Hugging Face Space
178
- 5. Verify deployment
179
-
180
- ## 8. Version Control
181
-
182
- ### 8.1 Branch Strategy
183
- - main: Production code
184
- - develop: Development branch
185
- - feature/*: New features
186
- - bugfix/*: Bug fixes
187
-
188
- ### 8.2 Commit Guidelines
189
- - Use descriptive commit messages
190
- - Reference issue numbers
191
- - Keep commits focused
192
- - Follow conventional commits format
193
-
194
- ## 9. Performance Requirements
195
-
196
- ### 9.1 Response Times
197
- - Page load: < 3 seconds
198
- - AI response: < 5 seconds
199
- - Preview update: < 1 second
200
- - Copy operation: < 0.5 seconds
201
-
202
- ### 9.2 Resource Usage
203
- - Memory usage < 512MB
204
- - CPU usage < 70%
205
- - Storage usage < 1GB
206
-
207
- ## 10. Error Handling
208
-
209
- ### 10.1 User Errors
210
- - Display clear error messages
211
- - Provide recovery suggestions
212
- - Maintain data integrity
213
- - Log user errors
214
-
215
- ### 10.2 System Errors
216
- - Implement graceful degradation
217
- - Log detailed error information
218
- - Notify admin of critical errors
219
- - Provide fallback options
220
-
221
- ## 11. Security Guidelines
222
-
223
- ### 11.1 User Data
224
- - No sensitive data storage
225
- - Clear data usage policies
226
- - Implement rate limiting
227
- - Sanitize user inputs
228
-
229
- ### 11.2 API Security
230
- - Use environment variables
231
- - Implement request validation
232
- - Monitor API usage
233
- - Handle token expiration
234
-
235
- ## 12. Maintenance
236
-
237
- ### 12.1 Regular Tasks
238
- - Update dependencies monthly
239
- - Review error logs weekly
240
- - Backup configurations
241
- - Monitor performance
242
-
243
- ### 12.2 Documentation
244
- - Keep README updated
245
- - Document API changes
246
- - Update user guides
247
- - Maintain changelog
248
-
249
- ## 13. Success Criteria
250
-
251
- ### 13.1 Functional Requirements
252
- - All features work as specified
253
- - No critical bugs
254
- - Meets performance requirements
255
- - Passes all test cases
256
-
257
- ### 13.2 User Experience
258
- - Intuitive interface
259
- - Clear feedback
260
- - Responsive design
261
- - Helpful error messages
262
-
263
- ---
264
-
265
- **Note**: This document should be treated as a living document and updated as the project evolves. Each phase should be completed and thoroughly tested before moving to the next phase.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -4,7 +4,7 @@ import re
4
  import urllib.parse
5
 
6
  def load_template(template_path):
7
- """ๅŠ ่ฝฝ README ๆจกๆฟๆ–‡ไปถ"""
8
  with open(template_path, 'r', encoding='utf-8') as f:
9
  return f.read()
10
 
@@ -115,64 +115,113 @@ def main():
115
  )
116
 
117
  st.title("GitHub README Profile Generator")
118
- st.markdown("### ็”Ÿๆˆไฝ ็š„ไธชๆ€งๅŒ– GitHub Profile README")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
- # ๅŠ ่ฝฝ้ป˜่ฎคๆจกๆฟ
121
  template_path = Path("README_template.md")
122
  template_content = load_template(template_path)
123
 
124
- # ๅˆ›ๅปบไธคๅˆ—ๅธƒๅฑ€
125
  col1, col2 = st.columns([1, 1])
126
 
127
  with col1:
128
- st.subheader("ๅŸบๆœฌไฟกๆฏ")
 
 
 
 
 
 
129
 
130
- # ๅŸบๆœฌไฟกๆฏ่กจๅ•
131
- full_name = st.text_input("ๅง“ๅ", value="Chan Meng")
132
- bio = st.text_input("ไธชไบบ็ฎ€ไป‹", value="A minimalist")
133
- github_username = st.text_input("GitHub ็”จๆˆทๅ", value="ChanMeng666")
134
 
135
- # ็คพไบค้“พๆŽฅ
136
- st.subheader("็คพไบค้“พๆŽฅ")
137
- portfolio_link = st.text_input("ไฝœๅ“้›†้“พๆŽฅ", value="https://chanmeng.live/")
138
- linkedin_link = st.text_input("LinkedIn ้“พๆŽฅ", value="https://www.linkedin.com/in/chanmeng666/")
 
 
 
 
139
 
140
- # ๆ—ฅๅธธ่กŒไธบ
141
- st.subheader("ๆ—ฅๅธธ่กŒไธบ")
142
- daily_routine_1 = st.text_input("ๆ—ฅๅธธ่กŒไธบ 1", value="code")
143
- daily_routine_2 = st.text_input("ๆ—ฅๅธธ่กŒ 2", value="eat")
144
- daily_routine_3 = st.text_input("ๆ—ฅๅธธ่กŒไธบ 3", value="sleep")
145
- daily_routine_4 = st.text_input("ๆ—ฅๅธธ่กŒไธบ 4", value="repeat")
 
 
 
 
146
 
147
- # ้กน็›ฎไฟกๆฏ
148
- st.subheader("้กน็›ฎๅฑ•็คบ")
149
- num_projects = st.number_input("้กน็›ฎๆ•ฐ้‡", min_value=1, max_value=10, value=2)
 
 
 
 
 
 
 
 
 
150
 
151
- # ๅญ˜ๅ‚จๆ‰€ๆœ‰้กน็›ฎๆ•ฐๆฎ
152
  all_project_data = {}
153
  for i in range(1, num_projects + 1):
154
  project_data = create_project_fields(col1, i)
155
  all_project_data.update(project_data)
156
 
157
- # ๆŠ€่ƒฝๅพฝ็ซ 
158
- st.subheader("ๆŠ€่ƒฝๆ ˆ")
159
- core_skills = st.text_area("ๆ ธๅฟƒๆŠ€่ƒฝ (็”จ้€—ๅทๅˆ†้š”)",
 
 
 
 
 
 
160
  value="React,Python,TypeScript,Machine Learning")
161
- frontend_skills = st.text_area("ๅ‰็ซฏๆŠ€่ƒฝ (็”จ้€—ๅทๅˆ†้š”)",
162
  value="HTML5,CSS3,JavaScript,React Native")
163
- backend_skills = st.text_area("ๅŽ็ซฏๆŠ€่ƒฝ (็”จ้€—ๅทๅˆ†้š”)",
164
  value="Node.js,MySQL,MongoDB")
165
 
166
- # ็”Ÿๆˆๅพฝ็ซ 
167
  core_skills_badges = process_skills(core_skills)
168
  frontend_skills_badges = process_skills(frontend_skills)
169
  backend_skills_badges = process_skills(backend_skills)
170
 
171
- # ๅ…ถไป–ไฟกๆฏ
172
- st.subheader("ๅ…ถไป–ไฟกๆฏ")
173
- footer_text = st.text_area("้กต่„šๆ–‡ๆœฌ", value="Thanks for visiting my GitHub profile! Feel free to connect or check out my projects.")
 
 
 
 
 
174
 
175
- # ๆ›ดๆ–ฐๅ˜้‡ๅญ—ๅ…ธ๏ผŒๅŠ ๅ…ฅ้กน็›ฎๆ•ฐๆฎ
176
  variables = {
177
  'full_name': full_name or '',
178
  'bio': bio or '',
@@ -187,10 +236,10 @@ def main():
187
  'frontend_skills_badges': frontend_skills_badges,
188
  'backend_skills_badges': backend_skills_badges,
189
  'footer_text': footer_text,
190
- **all_project_data # ๆทปๅŠ ๆ‰€ๆœ‰้กน็›ฎๆ•ฐๆฎ
191
  }
192
 
193
- # ๅŠจๆ€็”Ÿๆˆ้กน็›ฎ้ƒจๅˆ†็š„ๆจกๆฟๅ†…ๅฎน
194
  template_content = template_content.replace(
195
  "<!-- Featured Projects Section -->",
196
  f'''<!-- Featured Projects Section -->
@@ -199,16 +248,25 @@ def main():
199
  </table>'''
200
  )
201
 
202
- # ็”Ÿๆˆ้ข„่งˆๅ†…ๅฎน
203
  preview_content = replace_template_variables(template_content, variables)
204
 
205
  with col2:
206
- st.subheader("้ข„่งˆ")
 
 
 
 
207
  st.markdown(preview_content, unsafe_allow_html=True)
208
 
209
- if st.button("ๅคๅˆถๅ…จ้ƒจๅ†…ๅฎน"):
210
  st.code(preview_content, language="markdown")
211
- st.success("ๅ†…ๅฎนๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ!")
 
 
 
 
 
212
 
213
  if __name__ == "__main__":
214
  main()
 
4
  import urllib.parse
5
 
6
  def load_template(template_path):
7
+ """Load README template file"""
8
  with open(template_path, 'r', encoding='utf-8') as f:
9
  return f.read()
10
 
 
115
  )
116
 
117
  st.title("GitHub README Profile Generator")
118
+ st.markdown("### Create Your Personalized GitHub Profile README")
119
+
120
+ # Add introduction and tutorial
121
+ st.info("""
122
+ ๐Ÿ‘‹ Welcome! This tool helps you create an awesome GitHub profile README.md file in a few simple steps.
123
+
124
+ **How to use this generator:**
125
+ 1. Fill in the forms in each section on the left
126
+ 2. Preview your README in real-time on the right
127
+ 3. When satisfied, click 'Copy Content' and paste it into your GitHub profile repository
128
+
129
+ **To create your GitHub profile README:**
130
+ 1. Create a new repository with the same name as your GitHub username
131
+ 2. Initialize it with a README.md file
132
+ 3. Paste the generated content and commit changes
133
+ """)
134
 
135
+ # Load default template
136
  template_path = Path("README_template.md")
137
  template_content = load_template(template_path)
138
 
139
+ # Create two-column layout
140
  col1, col2 = st.columns([1, 1])
141
 
142
  with col1:
143
+ st.subheader("Basic Information")
144
+ st.markdown("""
145
+ This section forms the header of your profile. Make it personal and engaging!
146
+ - **Name**: Your full name or preferred display name
147
+ - **Bio**: A brief introduction about yourself (1-2 sentences)
148
+ - **GitHub Username**: Your GitHub handle (used for generating links)
149
+ """)
150
 
151
+ # Basic information form
152
+ full_name = st.text_input("Full Name", value="Chan Meng")
153
+ bio = st.text_input("Bio", value="A passionate developer exploring the digital frontier")
154
+ github_username = st.text_input("GitHub Username", value="ChanMeng666")
155
 
156
+ # Social Links
157
+ st.subheader("Social Links")
158
+ st.markdown("""
159
+ Connect with visitors through your professional networks.
160
+ Add your portfolio and LinkedIn URLs to showcase your work and experience.
161
+ """)
162
+ portfolio_link = st.text_input("Portfolio Website", value="https://chanmeng.live/")
163
+ linkedin_link = st.text_input("LinkedIn Profile", value="https://www.linkedin.com/in/chanmeng666/")
164
 
165
+ # Daily Routine
166
+ st.subheader("Daily Routine")
167
+ st.markdown("""
168
+ Share your daily activities in a fun way! These will be displayed as an animated cycle.
169
+ Example: code โ†’ learn โ†’ create โ†’ repeat
170
+ """)
171
+ daily_routine_1 = st.text_input("Activity 1", value="code")
172
+ daily_routine_2 = st.text_input("Activity 2", value="learn")
173
+ daily_routine_3 = st.text_input("Activity 3", value="create")
174
+ daily_routine_4 = st.text_input("Activity 4", value="repeat")
175
 
176
+ # Projects Section
177
+ st.subheader("Featured Projects")
178
+ st.markdown("""
179
+ Showcase your best work! For each project, you'll need:
180
+ - Project name
181
+ - Project link (repository or demo)
182
+ - Screenshot/preview image
183
+ - GitHub repository link
184
+ - Live demo link
185
+ - Key features/highlights (3 points)
186
+ """)
187
+ num_projects = st.number_input("Number of Projects", min_value=1, max_value=10, value=2)
188
 
189
+ # Store project data
190
  all_project_data = {}
191
  for i in range(1, num_projects + 1):
192
  project_data = create_project_fields(col1, i)
193
  all_project_data.update(project_data)
194
 
195
+ # Skills Section
196
+ st.subheader("Skills & Technologies")
197
+ st.markdown("""
198
+ List your technical skills separated by commas. They'll be converted into beautiful badges!
199
+ Example: Python, JavaScript, React, Docker
200
+
201
+ Tip: Group similar skills together for better organization.
202
+ """)
203
+ core_skills = st.text_area("Core Skills",
204
  value="React,Python,TypeScript,Machine Learning")
205
+ frontend_skills = st.text_area("Frontend Skills",
206
  value="HTML5,CSS3,JavaScript,React Native")
207
+ backend_skills = st.text_area("Backend Skills",
208
  value="Node.js,MySQL,MongoDB")
209
 
210
+ # Generate badges
211
  core_skills_badges = process_skills(core_skills)
212
  frontend_skills_badges = process_skills(frontend_skills)
213
  backend_skills_badges = process_skills(backend_skills)
214
 
215
+ # Additional Information
216
+ st.subheader("Footer Message")
217
+ st.markdown("""
218
+ Add a personal touch with a closing message to your profile visitors.
219
+ This appears at the bottom of your profile README.
220
+ """)
221
+ footer_text = st.text_area("Footer Message",
222
+ value="Thanks for visiting my GitHub profile! Feel free to connect or check out my projects.")
223
 
224
+ # Update variable dictionary, add project data
225
  variables = {
226
  'full_name': full_name or '',
227
  'bio': bio or '',
 
236
  'frontend_skills_badges': frontend_skills_badges,
237
  'backend_skills_badges': backend_skills_badges,
238
  'footer_text': footer_text,
239
+ **all_project_data # Add all project data
240
  }
241
 
242
+ # Dynamic generate project section template content
243
  template_content = template_content.replace(
244
  "<!-- Featured Projects Section -->",
245
  f'''<!-- Featured Projects Section -->
 
248
  </table>'''
249
  )
250
 
251
+ # Generate preview content
252
  preview_content = replace_template_variables(template_content, variables)
253
 
254
  with col2:
255
+ st.subheader("Live Preview")
256
+ st.markdown("""
257
+ See how your README looks in real-time.
258
+ When you're ready, click 'Copy Content' below to get the markdown code.
259
+ """)
260
  st.markdown(preview_content, unsafe_allow_html=True)
261
 
262
+ if st.button("Copy Content"):
263
  st.code(preview_content, language="markdown")
264
+ st.success("""
265
+ Content copied! To update your GitHub profile:
266
+ 1. Go to your profile repository (username/username)
267
+ 2. Edit README.md
268
+ 3. Paste this content and commit changes
269
+ """)
270
 
271
  if __name__ == "__main__":
272
  main()