2.7 KiB
2.7 KiB
Cary Swim Club Check-In
A lightweight Flask + SQLite app for managing pool member check-ins, families, and swim-test status.
Inspired by pooldues.com
Features
- Family and individual member management
- Check-in/check-out tracking
- Swim-test tracking with an age-based rule (
DEFAULT_MIN_SWIM_TEST_AGEinmain.py) - Family guest pass tracking
- Search-focused dashboards for active check-ins and family records
- Admin utilities for backups, CSV export, DB maintenance, and bulk resets
Tech Stack
- Python
- Flask
- SQLite
- Static HTML/CSS/JavaScript front-end
Project Structure
main.py: Flask server, API routes, and SQLite schema initializationindex.html: Main dashboard/check-in experiencefamily.html: Family-specific detail and check-in pagemanage.html: Management/admin interfacepool_checkin.sqlite3: Primary SQLite databasebackups/: Generated SQLite backupsexports/: Generated CSV exports
Getting Started
1. Create and activate a virtual environment (optional but recommended)
PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
2. Install dependencies
pip install flask
3. Run the app
python main.py
The app starts on Flask's default URL:
http://127.0.0.1:5000/
On first run, required folders and database tables are created automatically.
Main Routes
/: Main check-in dashboard (index.html)/family/<family_id>: Family page (family.html)/manage: Management page (manage.html)
API Overview
Dashboard and listings
GET /api/dashboardGET /api/checked-inGET /api/individualsGET /api/familiesGET /api/families/<family_id>
Family and member updates
POST /api/familiesDELETE /api/families/<family_id>PATCH /api/families/<family_id>/guest-passesPOST /api/membersPATCH /api/members/<member_id>/checkinPATCH /api/members/<member_id>/swim-test
Admin utilities
POST /api/admin/backupPOST /api/admin/exportPOST /api/admin/reindexPOST /api/admin/vacuumPOST /api/admin/reset-checkinsPOST /api/admin/reset-swim-testsPOST /api/admin/cleanup-orphan-members
Data Notes
- Phone numbers are normalized when families are created.
- Swim-test requirement is based on age and
DEFAULT_MIN_SWIM_TEST_AGEinmain.py. - Exports are written as timestamped CSV files in
exports/. - Backups are written as timestamped SQLite files in
backups/.
Operational Tips
- Keep regular DB backups using
POST /api/admin/backup. - Run
POST /api/admin/vacuumperiodically if the database grows after lots of deletes. - Use
POST /api/admin/exportfor reporting snapshots.