Skip to content

DG1001/MeinWeinkeller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mein Weinkeller - Wine Cellar Management App

Mein Weinkeller Screenshot

"Mein Weinkeller" is a web application built with Flask to help you manage your personal wine collection. You can add new wines, edit existing entries, search your collection, and upload images for your wines.

Features

  • Wine Management: Add, view, edit, and delete wines from your collection.
  • Detailed Information: Store details like name, vintage, winery, grape variety, region, storage location, drinking temperature, purchase date, price, stock, and personal notes.
  • Image Uploads: Upload multiple images for each wine and delete them if needed.
  • Search Functionality: Search your wine collection by keyword, grape variety, winery, or vintage.
  • Responsive Design: User interface designed with Bootstrap for usability on various devices.
  • Subtle Background: A pleasant background image enhances the visual experience.

Setup and Installation

  1. Clone the repository (if applicable):

    git clone <repository-url>
    cd <repository-directory>
  2. Create and activate a virtual environment (recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies: It's assumed you have Flask and Werkzeug. If you have a requirements.txt file, you would run:

    pip install -r requirements.txt 

    If not, install Flask and other dependencies manually:

    pip install Flask Werkzeug openai markdown2
  4. Set up OpenAI API Key: This application uses OpenAI's API for generating wine descriptions. You need to have an OpenAI API key. Set it as an environment variable:

    export OPENAI_API_KEY='your_openai_api_key_here'

    On Windows, use set OPENAI_API_KEY=your_openai_api_key_here in Command Prompt or $env:OPENAI_API_KEY='your_openai_api_key_here' in PowerShell. If the API key is not set, the AI features will be disabled.

  5. Set up Application Password: The application can be password-protected. Set the password as an environment variable:

    export APP_PASSWORD='your_chosen_password'

    On Windows, use set APP_PASSWORD=your_chosen_password in Command Prompt or $env:APP_PASSWORD='your_chosen_password' in PowerShell. If this is not set, login will not be possible if you intend to use password protection.

  6. Initialize the database: This will create the weinkeller.db SQLite database file and populate it with the schema and any initial sample data.

    python init_db.py
  7. Create the upload directory: The application saves uploaded images to static/uploads/.

    mkdir -p static/uploads

    (The application also attempts to create this directory if it doesn't exist when an image is uploaded.)

Usage

  1. Run the Flask application:

    python app.py
  2. Open your web browser and navigate to: http://localhost:5000 or http://0.0.0.0:5000

    You should see the main page of the "Mein Weinkeller" application. From there, you can:

    • View your wine collection.
    • Add new wines using the "Neuer Wein" link.
    • Click on a wine to see its details.
    • Edit or delete wines from their detail page.
    • Use the "Erweiterte Suche" for more specific filtering.

Database

The application uses an SQLite database named weinkeller.db. The schema is defined in schema.sql. The init_db.py script is used to create and initialize this database.

Technologies Used

  • Backend: Python, Flask
  • Frontend: HTML, CSS, Bootstrap 5
  • Database: SQLite
  • Image Handling: Werkzeug for secure filenames

Feel free to contribute or suggest improvements!

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published