Skip to content

Commit b14cbda

Browse files
enhanced the project , kept backup and made repo professional
1 parent 952f431 commit b14cbda

26 files changed

+3038
-24
lines changed

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# across different editors and IDEs
3+
# https://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.py]
14+
indent_style = space
15+
indent_size = 4
16+
max_line_length = 88
17+
18+
[*.{yml,yaml}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.{json,md}]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.{sh,bash}]
27+
indent_style = space
28+
indent_size = 2
29+
30+
[Makefile]
31+
indent_style = tab
32+
33+
[*.md]
34+
trim_trailing_whitespace = false

.env.example

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Environment Configuration Template
2+
# Copy this file to .env and fill in your values
3+
# NEVER commit .env file to version control!
4+
5+
# Application Settings
6+
APP_NAME=Image Processing Vision Project
7+
APP_VERSION=1.0.0
8+
DEBUG_MODE=false
9+
10+
# Server Configuration
11+
STREAMLIT_SERVER_PORT=8501
12+
STREAMLIT_SERVER_ADDRESS=localhost
13+
14+
# File Upload Settings
15+
MAX_FILE_SIZE_MB=200
16+
ALLOWED_FILE_TYPES=jpg,jpeg,png
17+
18+
# Image Processing Settings
19+
DEFAULT_IMAGE_FORMAT=png
20+
IMAGE_QUALITY=95
21+
22+
# Logging
23+
LOG_LEVEL=INFO
24+
LOG_FILE=logs/app.log
25+
26+
# Security (Example - add actual credentials if needed)
27+
# API_KEY=your_api_key_here
28+
# SECRET_KEY=your_secret_key_here
29+
30+
# Third-party Services (if applicable)
31+
# CLOUD_STORAGE_BUCKET=your_bucket_name
32+
# DATABASE_URL=your_database_connection_string
33+
34+
# Performance
35+
CACHE_ENABLED=true
36+
CACHE_TTL_SECONDS=3600

.gitattributes

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Git Attributes File
2+
# Ensures consistent line endings and file handling across different platforms
3+
4+
# Auto detect text files and normalize line endings to LF
5+
* text=auto
6+
7+
# Source code
8+
*.py text eol=lf
9+
*.js text eol=lf
10+
*.ts text eol=lf
11+
*.jsx text eol=lf
12+
*.tsx text eol=lf
13+
*.css text eol=lf
14+
*.scss text eol=lf
15+
*.html text eol=lf
16+
*.xml text eol=lf
17+
*.json text eol=lf
18+
*.yml text eol=lf
19+
*.yaml text eol=lf
20+
21+
# Documentation
22+
*.md text eol=lf
23+
*.txt text eol=lf
24+
*.rst text eol=lf
25+
26+
# Configuration files
27+
*.toml text eol=lf
28+
*.ini text eol=lf
29+
*.cfg text eol=lf
30+
.gitignore text eol=lf
31+
.gitattributes text eol=lf
32+
.env.example text eol=lf
33+
34+
# Shell scripts
35+
*.sh text eol=lf
36+
*.bash text eol=lf
37+
38+
# Windows scripts
39+
*.bat text eol=crlf
40+
*.cmd text eol=crlf
41+
*.ps1 text eol=crlf
42+
43+
# Binary files
44+
*.png binary
45+
*.jpg binary
46+
*.jpeg binary
47+
*.gif binary
48+
*.ico binary
49+
*.mp4 binary
50+
*.avi binary
51+
*.mov binary
52+
*.pdf binary
53+
*.zip binary
54+
*.tar binary
55+
*.gz binary
56+
*.7z binary
57+
*.rar binary
58+
59+
# Python bytecode
60+
*.pyc binary
61+
*.pyo binary
62+
*.pyd binary
63+
64+
# Exclude files from exports
65+
.gitignore export-ignore
66+
.gitattributes export-ignore
67+
.github/ export-ignore
68+
tests/ export-ignore
69+
docs/ export-ignore
70+
71+
# Diff settings for specific file types
72+
*.py diff=python
73+
*.md diff=markdown

.gitguardian.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# GitGuardian Configuration
2+
# This file configures secret scanning and security policies
3+
4+
# Paths to exclude from scanning
5+
paths-ignore:
6+
- "**/*.md"
7+
- "**/*.txt"
8+
- "**/tests/**"
9+
- "**/.git/**"
10+
11+
# Specific files to exclude
12+
exclude:
13+
- .env.example
14+
- requirements.txt
15+
- LICENSE
16+
17+
# Minimum occurrence to trigger detection (reduce false positives)
18+
minimum-occurrences: 1
19+
20+
# Enable verbose output
21+
verbose: false
22+
23+
# Exit code on policy breaks
24+
exit-zero: false
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Upload '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment (please complete the following information):**
27+
- OS: [e.g. Windows 10, macOS 12.0, Ubuntu 20.04]
28+
- Python Version: [e.g. 3.9.7]
29+
- Browser: [e.g. Chrome 96, Firefox 95]
30+
- Streamlit Version: [e.g. 1.28.0]
31+
32+
**Image Details (if applicable):**
33+
- Image format: [e.g. JPG, PNG]
34+
- Image dimensions: [e.g. 1920x1080]
35+
- File size: [e.g. 2MB]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
21+
22+
**Would this feature benefit other users?**
23+
Explain how this feature would benefit the broader user base.

.github/pull_request_template.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Pull Request
2+
3+
## Description
4+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
5+
6+
Fixes # (issue)
7+
8+
## Type of change
9+
10+
Please delete options that are not relevant.
11+
12+
- [ ] Bug fix (non-breaking change which fixes an issue)
13+
- [ ] New feature (non-breaking change which adds functionality)
14+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
15+
- [ ] Documentation update
16+
- [ ] Performance improvement
17+
- [ ] Code refactoring
18+
19+
## How Has This Been Tested?
20+
21+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
22+
23+
- [ ] Test A
24+
- [ ] Test B
25+
26+
**Test Configuration**:
27+
* Python version:
28+
* OS:
29+
* Browser (if UI changes):
30+
31+
## Checklist:
32+
33+
- [ ] My code follows the style guidelines of this project
34+
- [ ] I have performed a self-review of my own code
35+
- [ ] I have commented my code, particularly in hard-to-understand areas
36+
- [ ] I have made corresponding changes to the documentation
37+
- [ ] My changes generate no new warnings or errors
38+
- [ ] I have tested my changes with different image formats and sizes
39+
- [ ] Any dependent changes have been merged and published
40+
41+
## Screenshots (if applicable):
42+
43+
Please add screenshots to help explain your changes if they affect the UI.
44+
45+
## Additional Notes:
46+
47+
Add any other context about the pull request here.

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.8', '3.9', '3.10', '3.11']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Lint with flake8
30+
run: |
31+
pip install flake8
32+
# Stop the build if there are Python syntax errors or undefined names
33+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
# Exit-zero treats all errors as warnings
35+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
36+
37+
- name: Test application startup
38+
run: |
39+
# Basic smoke test - check if app can import without errors
40+
python -c "import streamlit; print('Streamlit OK')"
41+
python -c "import cv2; print('OpenCV OK')"
42+
python -c "import numpy; print('NumPy OK')"

.github/workflows/security.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
# Run weekly security scans
10+
- cron: '0 0 * * 0'
11+
12+
jobs:
13+
security-scan:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0 # Full history for better analysis
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.8'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install safety bandit
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
32+
- name: Run Safety - Dependency Vulnerability Scan
33+
run: |
34+
safety check --json || true
35+
36+
- name: Run Bandit - Security Linter
37+
run: |
38+
bandit -r . -f json -o bandit-report.json || true
39+
bandit -r . -f screen
40+
41+
- name: Upload Security Reports
42+
uses: actions/upload-artifact@v3
43+
if: always()
44+
with:
45+
name: security-reports
46+
path: |
47+
bandit-report.json

0 commit comments

Comments
 (0)