This document helps operators and contributors set up, configure, deploy, and troubleshoot the Cottage Chooser application.
flask>=2.2,<3
bleach>=6.1
requests>=2.31
# openai removed (manual summaries only)
Note: The app unifies admin checks using both CC_ADMIN_USERS and CC_ADMINS. Either can grant admin rights. Usernames are case-insensitive and whitespace-trimmed.
Example (PowerShell): $env:CC_ADMINS = "alice,bob"
cd C:\Users\Peter\Downloads\CottageChooser_Full
py -3 -m venv venv
.\venv\Scripts\Activate.ps1
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python app.py
If venv activation is blocked, run once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
The app will be available at http://localhost:5000
sudo chown -R www-data:www-data /path/to/app
sudo chmod 664 /path/to/app/data.db
sudo chmod 775 /path/to/app
sudo chown -R www-data:www-data /var/www/html/Cottage
sudo chmod 664 /var/www/html/Cottage/data.db
sudo chmod 775 /var/www/html/Cottage
You must be logged in to see vote buttons. If logged in and still not visible, check that list.html includes the vote button code and JavaScript handlers.
Search app.py for duplicate @app.route decorators with same paths. Each route+function should appear only once.
Toggle Help mode using the floating "Help" button; bubbles appear below elements on hover.
| Endpoint | Method | Description |
|---|---|---|
| /join | GET, POST | Login/Join via group code |
| /logout | GET | Clear session and logout |
| /cottages | GET | List cottages with ratings/votes |
| /cottage/<id> | GET, POST | Details/comments/voters |
| /reviews/<id> | GET | Dedicated reviews page |
| /add | GET, POST | Add cottage |
| /edit/<id> | GET, POST | Edit cottage (owner only) |
| /delete/<id> | POST | Delete cottage (owner/admin) |
| /vote/<id> | POST | Vote for cottage (one at a time) |
| /vote/delete/<vote_id> | POST | Delete vote (user/admin) |
| /rate/<id> | POST | Submit/update 0-10 rating |
| /rating/delete/<id> | POST | Delete user's rating |
| /ratings/<id> | GET | View ratings (user/admin) |
| /comment/edit/<id> | POST | Edit comment (owner) |
| /comment/delete/<id> | POST | Delete comment (owner/admin) |
| /results | GET | Rankings with vote/rating stats |
| /compare | GET | Side-by-side compare |
| /presentation | GET | Slides viewer |
| /results_data | GET | JSON snapshot for dashboards |
| /guide | GET | User guide |
| /support | GET | Technical documentation |
| /init | GET | Initialize/reset DB (⚠️ data loss) |
Green highlight = reviews feature. Yellow highlight = rating system endpoints.
Submit or update a rating for a cottage.
Body: rating=0-10
Response: {"ok": true, "rating": 8, "count": 5, "average": 7.4, "total": 37}
Errors: 401 (not logged in), 400 (invalid rating), 404 (cottage not found)
Delete the current user's rating for a cottage.
Response: {"ok": true, "count": 4, "average": 7.2, "total": 29}
Errors: 401 (not logged in), 404 (no rating found)
View rating statistics and details for a cottage.
Returns: HTML page with aggregate stats, user's own rating, and (for admins) all individual ratings.
View all reviews/comments for a cottage with rating context.
Returns: HTML page with cottage summary, rating stats, user's rating, and all comments with edit/delete controls.