"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.
- 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.
-
Clone the repository (if applicable):
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies: It's assumed you have Flask and Werkzeug. If you have a
requirements.txtfile, you would run:pip install -r requirements.txt
If not, install Flask and other dependencies manually:
pip install Flask Werkzeug openai markdown2
-
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_herein 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. -
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_passwordin 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. -
Initialize the database: This will create the
weinkeller.dbSQLite database file and populate it with the schema and any initial sample data.python init_db.py
-
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.)
-
Run the Flask application:
python app.py
-
Open your web browser and navigate to:
http://localhost:5000orhttp://0.0.0.0:5000You 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.
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.
- Backend: Python, Flask
- Frontend: HTML, CSS, Bootstrap 5
- Database: SQLite
- Image Handling: Werkzeug for secure filenames
Feel free to contribute or suggest improvements!
