ske087 540eb17e89 Implement organized media folder structure for community posts
- Add media_folder field to Post model for organized file storage
- Create MediaConfig class for centralized media management settings
- Update community routes to use post-specific media folders
- Add thumbnail generation for uploaded images
- Implement structured folder layout: app/static/media/posts/{post_folder}/
- Add utility functions for image and GPX file handling
- Create media management script for migration and maintenance
- Add proper file validation and MIME type checking
- Include routes for serving images, thumbnails, and GPX files
- Maintain backward compatibility with existing uploads
- Add comprehensive documentation and migration tools

Each post now gets its own media folder with subfolders for:
- images/ (with thumbnails/ subfolder)
- gpx/

Post content remains in database for optimal query performance while
media files are organized in dedicated folders for better management.
2025-07-23 18:03:03 +03:00

Motorcycle Adventure Community

A Flask-based web application for motorcycle enthusiasts featuring adventure stories, route sharing, and accommodation recommendations.

Features

  • Landing Page: Hero section with call-to-action, featured adventures, and accommodation promotion
  • User Authentication: Registration and login system with Flask-Login
  • Community Section: Share stories, tracks, and experiences
  • Admin Panel: Content management for administrators
  • Responsive Design: Built with Tailwind CSS for mobile-first design
  • Error Handling: Custom 404 and 500 error pages

Technology Stack

  • Backend: Python Flask 3.0.0
  • Database: SQLAlchemy with PostgreSQL support
  • Authentication: Flask-Login
  • Email: Flask-Mail
  • Forms: WTForms with validation
  • Styling: Tailwind CSS (CDN)
  • Deployment: Docker with Gunicorn

Project Structure

/
├── app/
│   ├── __init__.py          # Flask app factory
│   ├── models.py            # Database models
│   ├── forms.py             # WTForm definitions
│   ├── routes/              # Route blueprints
│   │   ├── main.py          # Main routes (index, about)
│   │   ├── auth.py          # Authentication routes
│   │   └── community.py     # Community features
│   ├── templates/           # Jinja2 templates
│   │   ├── base.html        # Base template
│   │   ├── index.html       # Landing page
│   │   ├── auth/            # Auth templates
│   │   └── errors/          # Error pages
│   └── static/              # Static assets
│       ├── favicon.ico
│       └── images/
├── config.py                # Application configuration
├── requirements.txt         # Python dependencies
├── run.py                   # Application entry point
├── Dockerfile              # Docker configuration
└── docker-compose.yml     # Docker Compose setup

Quick Start

Local Development

  1. Clone the repository

    git clone <repository-url>
    cd motorcycle-adventure-community
    
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Set environment variables

    export FLASK_APP=run.py
    export FLASK_ENV=development
    export SECRET_KEY="your-secret-key-here"
    export DATABASE_URL="sqlite:///motorcycle_adventures.db"
    
  5. Initialize database

    flask db init
    flask db migrate -m "Initial migration"
    flask db upgrade
    
  6. Run the application

    python run.py
    

Docker Deployment

  1. Build and run with Docker Compose

    docker-compose up --build
    
  2. Access the application

Configuration

The application supports multiple environments through environment variables:

  • FLASK_ENV: development, testing, production
  • SECRET_KEY: Flask secret key for sessions
  • DATABASE_URL: Database connection string
  • MAIL_SERVER: SMTP server for email
  • MAIL_USERNAME: Email username
  • MAIL_PASSWORD: Email password

Features Overview

Landing Page

  • Hero section with stunning mountain panorama background
  • Call-to-action for adventure community
  • Featured adventures showcase
  • Pensiune BuonGusto accommodation promotion

Authentication System

  • User registration with email validation
  • Secure login/logout functionality
  • Password hashing with Werkzeug
  • Session management with Flask-Login

Community Features

  • Story and track sharing
  • User profiles
  • Image uploads for adventures
  • GPX file support for route sharing
  • Comment system
  • Like/rating system

Admin Panel

  • User management
  • Content moderation
  • Analytics dashboard
  • System configuration

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Beautiful Transalpina panorama background image
  • Tailwind CSS for responsive design
  • Flask community for excellent documentation
  • Bootstrap icons for UI elements
Description
No description provided
Readme 24 MiB
Languages
HTML 70.5%
Python 29.3%
Dockerfile 0.2%