- PHP-based naming convention tool for Ferrero communication assets - Filename builder with validation - Filename decoder with component breakdown - Complete help documentation - Ferrero brand styling with Montserrat font - OMG Job Number field (numbers only, max 10 chars) - 105 brands, 29 countries, 39 asset types from Excel - Responsive landscape layout - Data management via JSON (parsed from Excel) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| backend | ||
| public | ||
| .gitignore | ||
| Filenaming.xlsx | ||
| Picture1.png | ||
| README.md | ||
| start.sh | ||
Ferrero Communication Assets - Naming Convention Tool
A web-based tool for creating and decoding Ferrero communication asset filenames according to the official naming convention.
Features
- Filename Builder: Interactive form to generate properly formatted filenames
- Filename Decoder: Parse existing filenames to see their components
- Examples: View sample filenames with breakdowns
- Data Management: Python backend allows easy updates to brands, countries, and asset types
- Ferrero Branding: Styled to match Ferrero's visual identity
Naming Convention Structure
[BRAND_CODE]_[COUNTRY_CODE]_[SUBJECT_TITLE]_[ASSET_TYPE]_[SPOT_VERSION]*_[SECONDS]S_[ASPECT_RATIO]
Example: RAF_GL_ME MOMENT_OLV_6S_1x1
- Brand Code: 2-5 characters (e.g., RAF = Raffaello)
- Country Code: 2 characters (e.g., GL = Global)
- Subject Title: Max 15 characters
- Asset Type: 3 characters (e.g., OLV = Online Video)
- Spot Version: Optional 3 characters + "MST" for master files
- Seconds: Duration (e.g., 6S)
- Aspect Ratio: 4 characters (e.g., 1x1, 16x9)
Installation
Prerequisites
- Python 3.x
- PHP 8.x
- Homebrew (macOS)
Setup
The project is already set up with a virtual environment in ferrero-venv/ and all dependencies installed.
Usage
Quick Start
Simply run the startup script:
./start.sh
This will:
- Activate the Python virtual environment
- Start the Flask API server on port 5000
- Start the PHP server on port 8000
- Open your browser to http://localhost:8000
Manual Start
If you prefer to start servers separately:
1. Start Flask API:
source ferrero-venv/bin/activate
cd backend
python3 app.py
2. Start PHP Server (in another terminal):
cd public
php -S localhost:8000
3. Access the tool: Open your browser to http://localhost:8000
Project Structure
Ferrero-naming-convention/
├── ferrero-venv/ # Python virtual environment
├── backend/
│ ├── app.py # Flask API server
│ ├── excel_parser.py # Excel data parser
│ ├── data.json # Naming convention data
│ └── requirements.txt # Python dependencies
├── public/
│ ├── index.php # Main application page
│ ├── css/
│ │ └── style.css # Ferrero-branded styles
│ └── js/
│ └── app.js # Frontend application logic
├── Filenaming.xlsx # Source data (original)
├── start.sh # Quick start script
└── README.md # This file
API Endpoints
GET /api/data
Get all naming convention data (brands, countries, asset types, etc.)
GET /api/brands
Get all brand codes
POST /api/brands
Add a new brand code
{
"code": "RAF",
"name": "Raffaello"
}
DELETE /api/brands/{code}
Delete a brand code
GET /api/countries
Get all country codes
POST /api/countries
Add a new country code
GET /api/asset-types
Get all asset types
POST /api/asset-types
Add a new asset type
POST /api/build
Build a filename from components
{
"brand_code": "RAF",
"country_code": "GL",
"subject_title": "ME MOMENT",
"asset_type": "OLV",
"spot_version": "",
"seconds": "6",
"aspect_ratio": "1x1",
"has_master": false
}
POST /api/decode
Decode a filename into components
{
"filename": "RAF_GL_ME MOMENT_OLV_6S_1x1"
}
Managing Data
Adding New Brands
You can add new brands through the API:
curl -X POST http://localhost:5000/api/brands \
-H "Content-Type: application/json" \
-d '{"code":"NEW","name":"New Brand Name"}'
Or edit backend/data.json directly and restart the server.
Updating from Excel
To re-parse the Excel file:
source ferrero-venv/bin/activate
python3 backend/excel_parser.py
This will regenerate backend/data.json from Filenaming.xlsx.
Browser Compatibility
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
Troubleshooting
Port Already in Use
If port 5000 or 8000 is already in use:
For Flask (5000):
lsof -ti:5000 | xargs kill
For PHP (8000):
lsof -ti:8000 | xargs kill
API Connection Error
Make sure the Flask server is running on port 5000. Check the terminal for any error messages.
Data Not Loading
Ensure backend/data.json exists. If not, run:
python3 backend/excel_parser.py
License
© Ferrero. All rights reserved.
Support
For issues or questions, contact your IT administrator.