No description
|
|
||
|---|---|---|
| .github/workflows | ||
| app | ||
| static | ||
| templates | ||
| tests | ||
| .env.example | ||
| cline.md | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
Café Bach Email Generator
A Flask-based web application that generates beautifully formatted HTML invitation emails for internal events at Café Bach (Aidshilfe). Users fill out a simple form and the app renders a clean, minimalist HTML email template.
Features
- Generate HTML email invitations with customizable fields
- Real-time preview of email template
- Client-side form validation
- Copy-to-clipboard functionality
- Responsive design with accessibility support
- Minimalist, ADHD-friendly interface
Tech Stack
- Backend: Python 3.10+, Flask
- Templating: Jinja2
- Frontend: Vanilla HTML/CSS/JS
- Testing: pytest
- CI/CD: GitHub Actions
Installation
-
Clone the repository:
git clone <repository-url> cd 07_email_template_generator -
Set up the virtual environment:
python -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Run the application:
flask run
The application will be available at http://localhost:5000.
Project Structure
cafe-bach-email-generator/
├── app/
│ ├── __init__.py # Flask app factory
│ ├── config.py # Configuration classes
│ ├── forms.py # WTForms for email generation
│ ├── views.py # Route definitions
│ ├── templates/
│ │ ├── base.html # Layout wrapper
│ │ ├── generate.html # Main form view
│ │ └── preview.html # Rendered email preview
│ └── static/
│ ├── css/
│ │ └── style.css # Minimalist styling
│ └── js/
│ └── main.js # Form handling & preview logic
├── tests/
│ ├── test_app.py # Route tests
│ └── test_forms.py # Form validation tests
├── .github/
│ └── workflows/
│ └── ci-cd.yml # GitHub Actions pipeline
├── .env.example # Environment variables template
├── requirements.txt # Python dependencies
├── instructions.md # Project instructions
└── README.md # This file
Usage
- Navigate to the generate page
- Fill out the form with event details:
- Event Title (required)
- Date & Time (required)
- Location (required)
- Description (required)
- Image URL (optional)
- Button Text (required)
- Button URL (required)
- Next Event Text (optional)
- Next Event URL (optional)
- Click "Preview" to see a preview of the email
- Click "Generate Email" to submit the form
- Use "Copy HTML to Clipboard" to copy the generated HTML
Testing
Run the tests with pytest:
pytest
Run tests with coverage:
pytest --cov=app
Code Quality
Lint with flake8:
flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics
Format with black:
black app/
Sort imports with isort:
isort app/
CI/CD Pipeline
The project uses GitHub Actions for continuous integration and deployment:
- Trigger: Push to
mainordevelop, or pull requests - Environment: Python 3.10+ on Ubuntu latest
- Steps:
- Checkout repository
- Set up Python environment
- Install dependencies
- Run linting (flake8, black, isort)
- Execute tests (pytest)
- Build & deploy to staging (optional)
- Notify via Slack/Discord on success/failure
Accessibility
The application is designed with ADHD-friendly principles:
- High contrast mode support
- Clear visual hierarchy
- Minimal distractions
- Clear feedback on actions
- Keyboard navigation support
License
© 2024 Café Bach - Aidshilfe