ChessPrism/setup_project.py

162 lines
3.2 KiB
Python

import os
import subprocess
def create_directory_structure():
# Main project directories
directories = [
'src',
'src/core',
'src/features',
'src/utils',
'src/services',
'tests',
'tests/unit',
'tests/integration',
'tests/performance',
'docs',
'docs/api',
'docs/architecture',
'docs/development',
'assets',
'assets/ml-models',
'assets/shaders',
'scripts',
'config'
]
# Create directories
for directory in directories:
os.makedirs(directory, exist_ok=True)
def create_base_files():
# Git-related files
files = {
'.gitignore': '''
# macOS
.DS_Store
.AppleDouble
.LSOverride
# Xcode
xcuserdata/
*.xcscmblueprint
*.xccheckout
build/
DerivedData/
*.moved-aside
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
# Swift Package Manager
.build/
Packages/
Package.pins
Package.resolved
# ML Models
*.mlmodel
# Environment
.env
.env.*
# IDE
.idea/
.vscode/
# Testing
*.xcresult
# Fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
''',
'README.md': '''
# Chess Teaching Assistant
An intelligent chess teaching assistant for macOS that provides real-time analysis and visualization.
## Features
- Real-time board position analysis
- Visual move suggestions
- Attack pattern visualization
- Defensive planning indicators
## Development
See [Development Guide](docs/development/getting-started.md) for setup instructions.
## Architecture
See [Architecture Overview](docs/architecture/overview.md) for system design details.
## License
[MIT License](LICENSE)
''',
'LICENSE': '''MIT License
Copyright (c) 2025 Chess Teaching Assistant
Permission is hereby granted, free of charge...''',
'docs/development/getting-started.md': '''# Getting Started
## Prerequisites
- Xcode 15.0+
- macOS 14.0+
- Swift 6.0+
## Setup Instructions
1. Clone the repository
2. Install dependencies
3. Build and run
''',
'docs/architecture/overview.md': '''# Architecture Overview
## System Components
- Screenshot Capture Module
- Board Position Analysis Engine
- Visual Overlay System
- Stockfish Integration
''',
'src/core/__init__.py': '',
'src/features/__init__.py': '',
'src/utils/__init__.py': '',
'src/services/__init__.py': '',
'tests/__init__.py': '',
'config/default.json': '''{
"analysis": {
"depth": 20,
"threads": 4
},
"visualization": {
"arrowColor": "#FF0000",
"highlightColor": "#00FF00"
}
}'''
}
for file_path, content in files.items():
with open(file_path, 'w') as f:
f.write(content.strip())
def initialize_git():
commands = [
['git', 'init'],
['git', 'add', '.'],
['git', 'commit', '-m', 'Initial project structure'],
['git', 'branch', '-M', 'main'],
]
for command in commands:
subprocess.run(command)
def main():
create_directory_structure()
create_base_files()
initialize_git()
print("Project structure created successfully!")
if __name__ == "__main__":
main()