9.0 KiB
The application serves as a standalone application form that external job postings link to, passing a job name parameter to track which position the applicant is applying for.
This is a simple but robust job application system that prioritizes: - Accessibility and simplicity (minimal CSS, no JavaScript required) - Stateful workflow that can be resumed via email link - File-based persistence (YAML + file storage, no database) - German language interface for all user-facing content - Clean validation at each stepThe application workflow consists of 5 distinct pages:
- Email capture + session creation
- Basic personal information
- Motivation and qualification questions
- Document uploads (CV, cover letter, etc.)
- Final submission
Tech stack: Python 3, Flask, YAML for data serialization, minimal CSS, no JavaScript
**Page 1: Email Capture & Session Initialization** - Accept URL parameter: `/apply?job=JuniorMarketingAssistant` - Prompt for email address - Generate unique session ID (UUID) - Store session data: email, job name, session ID, timestamp - Send email with resume link containing session ID - Redirect to Page 2 on submit - Resume link format: `/resume/{session_id}` redirects to appropriate pagePage 2: Basic Personal Information Required fields:
- Name (string, max 255 chars)
- Firstname (string, max 255 chars)
- Addresse (string, max 255 chars)
- ZIP Code (integer, max 10 digits)
- City (string, max 255 chars)
- Phone number (international format validation)
- Year of birth (4-digit integer, e.g., 1982)
Optional fields:
- Civil status (string, max 255 chars)
Page 3: Motivation & Qualifications Four textarea fields (all optional but length-limited):
- "Bitte beschreiben Sie Ihre aktuelle berufliche Situation."
- "Was motiviert Sie, für uns zu arbeiten?"
- "Bitte nennen Sie uns Ihre besonderen Qualifikationen für diese Stelle."
- "Was sind Ihre Gehaltsvorstellungen (brutto, basierend auf Vollzeitbeschäftigung)?"
Each textarea limited to ~3000 characters (approximately one A4 page)
Page 4: Document Upload
- Allow up to 3 document uploads
- Maximum 4 MB per document
- Preferred format: PDF
- Display uploaded documents with remove option
- Store in
./applications/{session_id}/attachments/folder - Submit button with clear explanation:
- "Bewerbung absenden" button
- Note that application will be submitted but can be modified while active
Page 5: Confirmation
- Display success message
- Confirm application details
- Provide information about next steps
<technical_specifications> Data Storage
- Store application data in YAML files:
./applications/{session_id}/data.yaml - Store attachments in:
./applications/{session_id}/attachments/ - Each application gets its own folder structure
- YAML structure should include: session_id, job_name, email, timestamp, current_page, personal_info, motivation_answers, uploaded_files
Session Management
- Generate cryptographically secure UUIDs for session IDs
- Track current page/progress in session data
- Allow resume at any point via
/resume/{session_id} - Validate session exists before allowing access
Email Functionality
- Send resume link immediately after email capture
- Email subject: "Ihre Bewerbung bei [Company] - Link zum Fortsetzen"
- Email body: German text with resume link
- Use Flask-Mail or similar for email sending
- Email configuration should be environment-based
Validation Requirements
- Email: Valid email format
- Phone: International format (e.g., +41 79 123 45 67)
- ZIP Code: Numeric, max 10 digits
- Year of birth: 4 digits, reasonable range (1940-2010)
- Text areas: Max ~3000 characters each
- File uploads: Max 4 MB, count ≤ 3
- Display clear, German error messages for all validation failures
German Language All labels, messages, and instructions must be in German:
- Form labels and placeholders
- Error messages
- Button text
- Email content
- Success/confirmation messages </technical_specifications>
Project Structure Create the following structure:
./
├── app.py # Main Flask application
├── templates/
│ ├── page1_email.html
│ ├── page2_personal.html
│ ├── page3_motivation.html
│ ├── page4_upload.html
│ └── page5_confirmation.html
├── static/
│ └── style.css # Minimal CSS for basic styling
├── applications/ # Created dynamically, stores all application data
├── config.py # Configuration (email settings, etc.)
└── requirements.txt # Python dependencies
Key Implementation Details
-
Session Flow: After each successful form submission, update the YAML file with current progress and redirect to next page. The
current_pagefield tracks progress for resume functionality. -
Resume Functionality: The
/resume/{session_id}route should:- Load session data from YAML
- Check
current_pagevalue - Redirect to appropriate page with form pre-filled
-
Form Pre-filling: When resuming, populate form fields from existing YAML data so users can review/modify their answers.
-
File Upload Security:
- Validate file extensions (prefer PDF but allow common formats)
- Sanitize filenames to prevent path traversal
- Store with secure filenames (e.g.,
{timestamp}_{sanitized_original_name})
-
Email Configuration: Use environment variables for email credentials. Include a
.env.examplefile showing required configuration. -
Error Handling:
- Graceful handling of missing sessions
- Clear error messages in German for validation failures
- File system error handling (disk space, permissions)
-
CSS Approach: Keep styling minimal and accessible:
- Clear visual hierarchy
- Good contrast ratios
- Responsive without requiring JavaScript
- Form field spacing and readability
- Clear focus states for keyboard navigation
What to Avoid and Why:
- No JavaScript: Keeps the application accessible and simple, works without client-side execution
- No database: File-based storage is simpler for small-scale applications and easier to deploy
- No client-side validation: Server-side only ensures security and works in all environments
- Avoid complex frameworks: Flask alone is sufficient, reducing dependencies and complexity
./app.py- Main Flask application with all routes and logic./config.py- Configuration management (email settings, file limits, etc.)./requirements.txt- Python dependencies (Flask, PyYAML, Flask-Mail, python-dotenv)./templates/page1_email.html- Email capture page (German)./templates/page2_personal.html- Personal information form (German)./templates/page3_motivation.html- Motivation questions (German)./templates/page4_upload.html- File upload interface (German)./templates/page5_confirmation.html- Success confirmation (German)./static/style.css- Minimal, accessible CSS./.env.example- Example environment configuration./README.md- Setup and deployment instructions in English
The ./applications/ directory will be created automatically by the application when the first application is submitted.
- Session Flow Test: Simulate the complete workflow from email capture through final submission
- Resume Test: Verify that the resume link correctly redirects to the appropriate page with pre-filled data
- Validation Test: Test all validation rules (email format, phone format, file size, character limits)
- File Upload Test: Verify files are stored correctly and can be removed
- German Language: Confirm all user-facing text is in German
- YAML Storage: Verify YAML files are created correctly and data persists
- Error Handling: Test with invalid session IDs and edge cases
Run the Flask application locally and test each page transition to ensure the stateful workflow functions correctly.
<success_criteria>
- All 5 pages implemented with proper routing
- Session management with unique IDs working
- Email sending with resume link functional
- All validation rules implemented with German error messages
- File uploads working with size and count limits
- Data persists in YAML format correctly
- Resume functionality allows picking up at any page
- Form pre-filling works when resuming
- All user-facing content is in German
- Minimal CSS provides clean, accessible interface
- No JavaScript required for any functionality
- README includes clear setup instructions </success_criteria>