# Image Swipe App A web application for sorting and organizing images using swipe gestures, similar to dating apps. ## Features - **Swipe Interface**: Swipe images in four directions (left, right, up, down) to categorize them - **Full-size Image View**: Click on any image to view it in full resolution with metadata - **History Page**: View all your past selections with rich filtering and sort options - **NSFW Filtering**: Toggle to include/exclude NSFW images on both the main swiper and history pages - **NSFW Blur**: Optional blur for NSFW thumbnails on the history page with a toolbar toggle - **Orientation & Action Filters**: Filter results by orientation (portrait/landscape/square) and by action taken - **Database Storage**: All selections are saved in a SQLite database - **Reset Functionality**: Option to clear all selections and start fresh ## File Structure - `server.py`: Entry point that starts the HTTP server - `handler.py`: HTTP request handler implementing all API endpoints - `database.py`: SQLite helpers (initialisation, queries, sync) - `config.py`: Centralised constants (paths, port) - `index.html`: Main page with the swipe interface - `history.html`: Page to view and manage past selections - `js/`: Front-end JavaScript (`main.js`, `utils.js`, etc.) - `styles.css`: CSS styling for the application - `update_nsfw_flags.py`: Utility script to (re)calculate NSFW flags for existing images after changing keyword lists ## How to Use 1. Run the server: `python server.py` 2. Open a web browser and navigate to `http://localhost:8000` 3. Use the on-screen buttons or swipe gestures to categorize images: - Left: Discard - Right: Keep - Up: Favorite - Down: Review Later 4. Click on an image to view it in full resolution 5. Use the "View History" link to see all your selections. The toolbar lets you: - Filter by action/orientation/NSFW status - Toggle blur of NSFW thumbnails - Sort by creation date, swipe date or resolution 6. Use the "Reset Database" button in the history page to clear all selections ## NSFW Detection & Maintenance NSFW status is inferred from prompt keywords defined in `config.py` (`NSFW_KEYWORDS`). After changing the keyword list or adding new images you can refresh the database flags: ```bash python update_nsfw_flags.py ``` This will reset and recalculate all `nsfw` flags so that the new filters work correctly. ## Requirements - Python 3.x - Standard Python libraries (http.server, sqlite3, etc.) - Web browser with JavaScript enabled