🛠️ Development Setup¶
Quick guide to set up your development environment for the Secure Token project.
📦 Installation for Development¶
Method 1: Local Development¶
# Clone the repository
git clone https://github.com/amirhosein2004/secure-token.git
cd secure-token
# Install in development mode with all dependencies
pip install -e
# Set up pre-commit hooks (recommended)
pre-commit install
Method 2: Docker Development¶
# Build development container
docker build -t secure-token:dev .
# Run interactive development environment
docker run -d -it -p 8000:8000 --name secure-token secure-token:dev
🔧 Development Dependencies¶
The project includes these development tools: - pytest - Testing framework - pytest-cov - Coverage reporting - black - Code formatting - isort - Import sorting - flake8 - Linting - mypy - Type checking - bandit - Security analysis - pre-commit - Git hooks
🚀 Quick Verification¶
Test your setup:
# Run a simple test
python -c "from src.secure_token import SecureTokenManager; print('✅ Import successful')"
# Run basic example
python -m examples.basic_usage
# Run a quick benchmark
python -m scripts.benchmark generation 10
📁 Project Structure¶
secure-token/
├── src/secure_token/ # Main package
│ ├── token_manager.py # Core token management
│ ├── config.py # Configuration
│ ├── validators.py # Input validation
│ └── exceptions.py # Custom exceptions
├── tests/ # Test files
├── examples/ # Usage examples
├── scripts/ # Utility scripts
└── docs/ # Documentation
🔄 Development Workflow¶
- Make changes to code
- Run tests:
pytest - Run pre-commit: pre-commit run --all-files
All checks run automatically with pre-commit hooks!