# Kobelly Web Solutions A professional Flask-based website for promoting small business web development services. Features multilanguage support (English, Dutch, French, German) with a simple JSON-based translation system and is fully dockerized for easy deployment. ## Features - 🌐 **Multilanguage Support**: English (EN), Dutch (NL), French (FR), German (DE) with JSON-based translations - πŸ“± **Responsive Design**: Modern, mobile-friendly interface - 🎨 **Professional UI**: Clean, modern design with Bootstrap 5 - 🐳 **Docker Support**: Easy containerization and deployment - ⚑ **Fast Performance**: Optimized for speed and performance with minified assets - πŸ”§ **No Database Required**: Simple, lightweight setup - πŸš€ **Asset Optimization**: CSS/JS minification with cache busting - πŸ“§ **Contact Form**: Fully functional email contact form - πŸ—ΊοΈ **SEO Optimized**: Sitemap generation and robots.txt ## Pages - **Home**: Hero section, features, and service overview - **Services**: Detailed service offerings with pricing information - **About**: Company story, team, and values - **Contact**: Contact form and business information - **Portfolio**: Showcase of completed projects ## Quick Start ### Local Development (Recommended) 1. **Install Python dependencies:** ```bash pip install -r requirements.txt ``` 2. **Build assets (optional, for production-like experience):** ```bash make build ``` 3. **Run the application:** ```bash python app.py ``` 4. **Access the website:** Open your browser and go to `http://localhost:5000` ### Using Make Commands The project includes a Makefile for common tasks: ```bash make help # Show all available commands make install # Install dependencies make build # Build minified assets make clean # Clean old assets make run # Run development server make run-prod # Run production server make deploy # Clean and build assets make dev-setup # Setup development environment # Docker commands make docker-run # Run production Docker container make docker-run-dev # Run development Docker container make docker-stop # Stop production container make docker-stop-dev # Stop development container make docker-logs # View production logs make docker-logs-dev # View development logs ``` ### Docker Deployment #### Production Mode (Default) 1. **Build and run with Docker Compose:** ```bash docker-compose up --build ``` 2. **Or build and run manually:** ```bash docker build -t kobelly-website . docker run -p 5000:5000 kobelly-website ``` #### Development Mode For local development with Docker (with live reload and debug mode): 1. **Build and run development container:** ```bash docker-compose -f docker-compose.dev.yml up --build ``` 2. **Or use Make commands:** ```bash make docker-run-dev # Start development container make docker-logs-dev # View development logs make docker-stop-dev # Stop development container ``` **Development vs Production:** - **Development**: Debug mode enabled, live code reloading, unminified assets - **Production**: Debug disabled, minified assets, optimized performance ## Project Structure ``` Kobelly/ β”œβ”€β”€ app.py # Main Flask application β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ Dockerfile # Docker configuration β”œβ”€β”€ docker-compose.yml # Docker Compose configuration β”œβ”€β”€ docker-compose.dev.yml # Development Docker Compose β”œβ”€β”€ Makefile # Build and deployment commands β”œβ”€β”€ build_assets.py # Asset minification script β”œβ”€β”€ translation_manager.py # JSON-based translation system β”œβ”€β”€ test_translations.py # Translation testing script β”œβ”€β”€ robots.txt # Search engine configuration β”œβ”€β”€ static/ # Static assets β”‚ β”œβ”€β”€ css/ # CSS files β”‚ β”‚ β”œβ”€β”€ main.css # Main stylesheet β”‚ β”‚ └── main.min.css # Minified CSS (generated) β”‚ β”œβ”€β”€ js/ # JavaScript files β”‚ β”‚ β”œβ”€β”€ main.js # Main script β”‚ β”‚ └── main.min.js # Minified JS (generated) β”‚ └── images/ # Images and icons β”œβ”€β”€ templates/ # HTML templates β”‚ β”œβ”€β”€ base.html # Base template with navigation β”‚ β”œβ”€β”€ index.html # Homepage β”‚ β”œβ”€β”€ services.html # Services page β”‚ β”œβ”€β”€ about.html # About page β”‚ β”œβ”€β”€ contact.html # Contact page β”‚ β”œβ”€β”€ portfolio.html # Portfolio page β”‚ └── components/ # Reusable template components β”‚ β”œβ”€β”€ hero_section.html β”‚ β”œβ”€β”€ cta_section.html β”‚ β”œβ”€β”€ stats_section.html β”‚ └── testimonials_section.html └── translations/ # JSON translation files β”œβ”€β”€ en.json # English translations β”œβ”€β”€ nl.json # Dutch translations β”œβ”€β”€ fr.json # French translations └── de.json # German translations ``` ## Multilanguage Support The website supports four languages using a simple JSON-based translation system: - πŸ‡ΊπŸ‡Έ **English** (EN) - Default - πŸ‡³πŸ‡± **Dutch** (NL) - πŸ‡«πŸ‡· **French** (FR) - πŸ‡©πŸ‡ͺ **German** (DE) Users can switch languages using the language selector in the navigation bar or URL parameters (`?lang=de`). The language preference is stored in the session. ### Translation System The project uses a custom JSON-based translation system that: - **No compilation needed** - Just edit JSON files directly - **Real-time updates** - Changes appear immediately after restart - **Simple maintenance** - Clear JSON structure - **Independent languages** - Edit English without breaking translations ### Adding New Translations 1. **Add the string to your template:** ```html

{{ t('New Section Title') }}

``` 2. **Add it to the translation files:** ```json // translations/en.json { "New Section Title": "New Section Title" } // translations/de.json { "New Section Title": "Neuer Abschnittstitel" } ``` 3. **Restart your Flask app** - Changes appear immediately! ## Customization ### Content Updates 1. **Text Content**: Edit the HTML templates in the `templates/` directory 2. **Translations**: Update the `.json` files in the `translations/` directory 3. **Styling**: Modify the CSS in `static/css/main.css` ### Adding New Pages 1. Add a new route in `app.py` 2. Create a new template file in `templates/` 3. Add navigation link in `templates/base.html` ### Updating Translations The JSON-based system makes translation updates simple: 1. **Edit translation files directly:** ```bash # Open and edit the JSON files nano translations/en.json nano translations/de.json # etc. ``` 2. **Restart the application:** ```bash python app.py ``` 3. **Test translations:** ```bash python test_translations.py ``` ## Asset Optimization The project includes automatic CSS and JavaScript minification with cache busting for optimal performance. ### Asset Building **Development Mode:** - Uses unminified assets for easier debugging - Assets are served directly from source files **Production Mode:** - Automatically serves minified assets - Cache busting prevents browser caching issues - Assets are optimized for faster loading ### Building Assets ```bash # Build minified assets make build # Clean old cache-busted assets make clean # Full deployment (clean + build) make deploy ``` ### Asset Files - **CSS**: `static/css/main.css` β†’ `static/css/main.min.css` - **JavaScript**: `static/js/main.js` β†’ `static/js/main.min.js` The build process creates cache-busted versions with MD5 hashes in the filename to ensure browsers always load the latest version. ## Contact Form Setup The website includes a fully functional contact form that sends email notifications. To set up email functionality: ### 1. Email Configuration The application uses environment variables for email configuration. You can set these in your environment or create a `.env` file: ```bash # For Gmail (recommended) MAIL_SERVER=smtp.gmail.com MAIL_PORT=587 MAIL_USE_TLS=True MAIL_USERNAME=contact@kobelly.be MAIL_PASSWORD=your-app-password-here MAIL_DEFAULT_SENDER=contact@kobelly.be ``` ### 2. For Gmail users: - Enable 2-factor authentication on your Google account - Generate an "App Password" in Google Account settings - Use the app password as `MAIL_PASSWORD` ### 3. Alternative Email Providers **For other SMTP providers, update the settings accordingly:** ```bash # Example for Outlook/Hotmail MAIL_SERVER=smtp-mail.outlook.com MAIL_PORT=587 MAIL_USE_TLS=True # Example for custom SMTP server MAIL_SERVER=your-smtp-server.com MAIL_PORT=587 MAIL_USE_TLS=True ``` ### 4. Testing the Contact Form 1. Start the application 2. Navigate to the Contact page 3. Fill out and submit the form 4. Check your email for the notification The form includes: - **Form validation** (required fields, email format, phone format) - **Loading states** (button shows spinner during submission) - **Success/error notifications** (toast notifications) - **Email notifications** (HTML and plain text formats) ## Configuration ### Environment Variables - `SECRET_KEY`: Secret key for Flask sessions (default: 'your-secret-key-change-in-production') - `FLASK_ENV`: Flask environment (development/production) - `FLASK_DEBUG`: Debug mode (0=disabled, 1=enabled, defaults to 1 in development) - `MAIL_SERVER`: SMTP server for email (default: smtp.gmail.com) - `MAIL_PORT`: SMTP port (default: 587) - `MAIL_USE_TLS`: Use TLS encryption (default: True) - `MAIL_USERNAME`: Email username - `MAIL_PASSWORD`: Email password - `MAIL_DEFAULT_SENDER`: Default sender email **Environment Modes:** **Development (Local):** ```bash FLASK_ENV=development FLASK_DEBUG=1 ``` **Production (Docker):** ```bash FLASK_ENV=production FLASK_DEBUG=0 ``` ### Production Deployment For production deployment: 1. Set a strong `SECRET_KEY` 2. Disable debug mode 3. Use a production WSGI server (e.g., Gunicorn) 4. Set up proper SSL/TLS certificates 5. Configure a reverse proxy (e.g., Nginx) ## Technologies Used - **Backend**: Flask 2.3.3 - **Frontend**: Bootstrap 5, Font Awesome - **Translation**: Custom JSON-based system - **Containerization**: Docker, Docker Compose - **Styling**: Custom CSS with CSS variables - **Asset Management**: Custom build script with CSS/JS minification - **Email**: Flask-Mail ## Browser Support - Chrome (latest) - Firefox (latest) - Safari (latest) - Edge (latest) - Mobile browsers (iOS Safari, Chrome Mobile) ## License This project is created for demonstration purposes. Feel free to use and modify for your own business needs. ## Support For questions or support, please contact: - Email: contact@kobelly.be - Phone: +32 486 21 07 07 - Address: Blijkheerstraat 92, 1755 Pajottegem, Belgium --- **Kobelly Web Solutions** - Professional web development for small businesses and entrepreneurs.