2.5 KiB
2.5 KiB
Pet Picture Queue
A web application to manage pet pictures from subscribers. Built with Flask, SQLite, and Jinja2 templates.
Features
- Upload pet pictures with subscriber information
- View all uploaded pictures in a grid layout
- Mark pictures as posted
- Modern, responsive UI using Tailwind CSS
- Click to view full-size images
- Download original images
- Add descriptions to pet pictures
Setup
Local Development
- Install dependencies:
uv pip install -e .
- Run the application:
python main.py
The application will be available at http://localhost:5000
Database Migration
Local Migration
If you have an existing database and want to add the description field:
python migrate.py
Docker Migration
To run the migration in Docker:
docker compose --profile migrate up migrate
This will safely add the description column to your existing database without affecting existing data.
Docker Deployment
Using Docker Compose (Recommended)
- Start the application:
docker compose up -d
- Stop the application:
docker compose down
The application will be available at http://localhost:54321
Using Docker Directly
- Build the Docker image:
docker build -t pet-picture-queue .
- Run the container:
docker run -d \
-p 54321:5000 \
-v $(pwd)/static/uploads:/app/static/uploads \
-v $(pwd)/pet_pictures.db:/app/pet_pictures.db \
--name pet-picture-queue \
pet-picture-queue
The application will be available at http://localhost:54321
Usage
- Visit the homepage to see all uploaded pet pictures
- Click "Upload New" to add a new pet picture
- Fill in the subscriber name and select a picture
- Add an optional description for the pet picture
- View uploaded pictures on the homepage
- Click on any picture to view it in full size
- Use the "Download Original" button to download the original file
- Mark pictures as posted using the "Mark as Posted" button
File Structure
main.py- Main Flask applicationmigrate.py- Database migration scripttemplates/- Jinja2 templatesbase.html- Base template with common layoutindex.html- Homepage with picture gridupload.html- Upload form
static/uploads/- Directory for uploaded picturespet_pictures.db- SQLite database (created automatically)Dockerfile- Docker configuration.dockerignore- Docker build exclusionsdocker-compose.yml- Docker Compose configuration