- Add Monero and Dogecoin logo images to static assets - Update cart_checkout.j2 to display crypto logos on payment buttons - Update crypto_checkout.j2 to show logos in checkout headers - Remove duplicate sweep script files (dogecoin-sweep-all.sh, sweep-all-doge.sh) - Update CLAUDE.md with development standards and testing guidelines
104 lines
No EOL
4.2 KiB
Markdown
104 lines
No EOL
4.2 KiB
Markdown
# Claude Development Notes
|
|
|
|
## Project Setup
|
|
|
|
This project uses a Makefile for most development operations. Use `make` commands instead of running tools directly.
|
|
|
|
## Common Development Tasks
|
|
|
|
### Testing
|
|
- Run tests: `make test`
|
|
- This installs development dependencies and runs the test suite with py.test
|
|
- Tests are located in `make_post_sell/tests/`
|
|
|
|
### Installation & Setup
|
|
- Install from source for development: `make install-from-source`
|
|
- Install from PyPI: `make install-from-pypi`
|
|
- Initialize database: `make init-db`
|
|
|
|
### Development Server
|
|
- Start development server: `make serve`
|
|
- Runs with auto-reload enabled
|
|
- Uses `data/development.ini` configuration
|
|
|
|
### Environment Management
|
|
- Create virtual environment: `make venv`
|
|
- Clean up environment: `make clean`
|
|
- Activate environment: `source env/bin/activate`
|
|
|
|
## Code Structure
|
|
|
|
### Key Directories
|
|
- `make_post_sell/views/` - View controllers
|
|
- `make_post_sell/models/` - Database models
|
|
- `make_post_sell/tests/` - Test suite
|
|
|
|
### Important Files
|
|
- `make_post_sell/views/cart.py` - Cart and checkout logic
|
|
- `development.ini` - Configuration file
|
|
|
|
## Testing Notes
|
|
|
|
The project uses pytest with unittest framework. There are three types of tests:
|
|
|
|
### Test Types
|
|
- **Unit tests** (`test_models.py`) - Test individual model methods and properties in isolation
|
|
- **Integration tests** (`test_integration.py`) - Test interactions between models and business logic
|
|
- **Functional tests** (`test_functional.py`) - End-to-end tests through the web interface
|
|
|
|
### Running Tests
|
|
**Before running tests**: Source environment variables with `source vars.sh` to set required Stripe API keys and other configuration.
|
|
|
|
```bash
|
|
# Run all tests
|
|
make test
|
|
|
|
# Run specific test types
|
|
env/bin/py.test make_post_sell/tests/test_models.py # Unit tests
|
|
env/bin/py.test make_post_sell/tests/test_integration.py # Integration tests
|
|
env/bin/py.test make_post_sell/tests/test_functional.py # Functional tests
|
|
|
|
# Run with coverage
|
|
env/bin/py.test --cov=make_post_sell.models.cart --cov-report=term-missing make_post_sell/tests/test_models.py::TestCart
|
|
```
|
|
|
|
### Current Coverage
|
|
- Cart model unit tests cover critical business logic like `requires_payment` threshold (64 cents)
|
|
- Integration tests verify the original AttributeError bug fix for free coupon checkout
|
|
- Functional tests provide end-to-end coverage of cart/checkout/payment flows
|
|
|
|
## Database Location
|
|
|
|
The SQLite database is located at: `data/make_post_sell.sqlite`
|
|
|
|
**CRITICAL WARNING**: NEVER delete or remove database files without explicit user permission. The database contains production data and cannot be easily recovered. Always ask before any destructive operations.
|
|
|
|
**MANDATORY**: ALWAYS create a backup of the database before any database operations (migrations, schema changes, etc.):
|
|
```bash
|
|
cp data/make_post_sell.sqlite data/make_post_sell.sqlite.backup-$(date +%Y%m%d-%H%M%S)
|
|
```
|
|
|
|
Query crypto payments:
|
|
```sql
|
|
SELECT * FROM mps_crypto_payment WHERE id = 'payment-uuid-here';
|
|
```
|
|
|
|
## Common Issues and Solutions
|
|
|
|
### UUID Objects
|
|
Always use `uuid_str` when you need a string copy of the identifier. Models inherit `uuid_str` property from `RBase`.
|
|
|
|
## Development Standards and Expectations
|
|
|
|
**CRITICAL WORK ETHIC**: The user pays significant money for development work and expects thorough, complete solutions. NEVER try to do the minimum or cut corners. When asked to implement features, provide comprehensive, production-ready implementations that consider all aspects of the request.
|
|
|
|
**TESTING INTEGRITY**: NEVER skip, delete, or disable unit tests or integration tests when they break. When tests fail:
|
|
1. **FIX THE TESTS** - Update them to work with new functionality
|
|
2. **FIX THE CODE** - If the tests reveal actual bugs, fix the underlying issue
|
|
3. **ADD MORE TESTS** - Ensure new functionality is properly covered
|
|
|
|
Disabling or removing tests weakens the codebase and is unacceptable. Tests are critical safety nets that prevent regressions.
|
|
|
|
## Commit Message Guidelines
|
|
|
|
**CRITICAL**: Do not include Claude Code attribution in commit messages. Attributing human work to Claude is inappropriate and misrepresents the actual authorship of the code. All code changes should be attributed to the human developer who reviewed, approved, and committed the work. |