An open API service indexing awesome lists of open source software.

https://github.com/gabeduke/django-gift-wiki


https://github.com/gabeduke/django-gift-wiki

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# Django Gift Wiki

A family-oriented gift wish list management application built with Django.

## Features

- ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Family-based organization
- ๐ŸŽ Wish list creation and management
- ๐Ÿ“ Item tracking with purchase status
- ๐ŸŽจ Family crest generation (optional, disabled by default)
- ๐Ÿ” User authentication and profiles

## Quick Start

### Feature Flag Admin

**NEW:** Manage feature flags from the admin interface!

1. Visit http://localhost:8000/admin/
2. Login with superuser credentials
3. Look for **"Feature Flags"** in the Gift section
4. Toggle features on/off with checkboxes - no server restart needed!

See `FEATURE_FLAG_ADMIN_README.md` for detailed instructions.

## Quick Start (Standard)

### Prerequisites
- Python 3.10+
- pipenv (install via `pip install pipenv`)

### Setup

1. **Clone the repository**
```bash
cd django-gift-wiki
```

2. **Install dependencies**
```bash
pipenv install
```

3. **Configure environment**
```bash
cp env.example .env
# Edit .env with your settings
```

4. **Run migrations**
```bash
pipenv run python manage.py migrate
```

5. **Create superuser (optional)**
```bash
pipenv run python manage.py createsuperuser
```

6. **Start development server**
```bash
pipenv run python manage.py runserver
```

7. **Access the application**
- Home: http://localhost:8000/
- Admin: http://localhost:8000/admin/

8. **Run tests**
```bash
make test # Run all tests
make test-cov # Run with coverage
make test-api # Run API tests only
```

## Testing

This project uses **pytest**, **pytest-django**, and **pytest-bdd** for comprehensive testing.

### Test Commands

```bash
make test # Run all tests
make test-cov # Run with coverage report
make test-unit # Run unit tests only
make test-api # Run API tests only
make test-bdd # Run BDD tests only
make test-parallel # Run tests in parallel
```

### Test Structure

- `tests/api/` - API and view tests
- `tests/features/` - BDD feature definitions (.feature files)
- `tests/steps/` - BDD step implementations
- `tests/conftest.py` - Shared test fixtures

### Current Test Status

- โœ… Comprehensive test suite covering:
- View tests (home, wishlist, item, authentication)
- Business rules (ownership, purchase behavior, soft delete)
- Managers functionality (multi-user wishlist management)
- Scraped page import functionality
- โœ… BDD feature files for acceptance testing
- โœ… Test fixtures for common test data

See `tests/README.md` for detailed testing documentation.

## PyCharm Setup

This project is configured for PyCharm:

1. Open project in PyCharm
2. PyCharm should detect the Pipenv virtual environment automatically
3. Use the "giftwiki" run configuration to start the server
4. Use "python manage.py shell" run configuration for Django shell

## Project Structure

```
django-gift-wiki/
โ”œโ”€โ”€ gift/ # Main gift management app
โ”‚ โ”œโ”€โ”€ models.py # Database models
โ”‚ โ”œโ”€โ”€ views.py # View functions
โ”‚ โ”œโ”€โ”€ forms.py # Form classes
โ”‚ โ””โ”€โ”€ templates/ # HTML templates
โ”œโ”€โ”€ crest_generator/ # Crest generation app (optional)
โ”œโ”€โ”€ giftwiki/ # Django project settings
โ”‚ โ”œโ”€โ”€ settings.py # Configuration
โ”‚ โ””โ”€โ”€ urls.py # URL routing
โ”œโ”€โ”€ deploy/ # Kubernetes deployment configs
โ””โ”€โ”€ requirements.txt # Python dependencies
```

## Database Models

- **WikiUser**: Custom user model with family associations
- **Family**: Family groups for organizing users
- **WishList**: Gift lists belonging to users
- **Item**: Individual items on wish lists
- **Suggestion**: Suggested variations for items
- **Crest**: Family crest information (if enabled)

## Feature Flags

Enable optional features via environment variables in `.env`:

```bash
# Enable crest generator (optional)
CREST_GENERATOR_ENABLED=TRUE
OPENAI_API_KEY=your-openai-key

# Enable steward/proxy functionality (optional, confusing UI)
STEWARD_PROXY_ENABLED=TRUE
```

See `FEATURE_FLAGS.md` for detailed documentation on all feature flags.

## Development Notes

- Uses SQLite for local development
- PostgreSQL configured for production deployment
- AWS S3 support for media file storage
- Kubernetes-ready with deployment manifests

## Recent Changes

- Crest generator shelved behind feature flag
- Core gift workflow fixed and tested
- All redirect URLs corrected
- Simplified wishlist creation workflow

## License

MIT