add README
This commit is contained in:
108
README.md
Normal file
108
README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# 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_AGE` in `main.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 initialization
|
||||
- `index.html`: Main dashboard/check-in experience
|
||||
- `family.html`: Family-specific detail and check-in page
|
||||
- `manage.html`: Management/admin interface
|
||||
- `pool_checkin.sqlite3`: Primary SQLite database
|
||||
- `backups/`: Generated SQLite backups
|
||||
- `exports/`: Generated CSV exports
|
||||
|
||||
## Getting Started
|
||||
|
||||
### 1. Create and activate a virtual environment (optional but recommended)
|
||||
|
||||
PowerShell:
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
### 2. Install dependencies
|
||||
|
||||
```powershell
|
||||
pip install flask
|
||||
```
|
||||
|
||||
### 3. Run the app
|
||||
|
||||
```powershell
|
||||
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/dashboard`
|
||||
- `GET /api/checked-in`
|
||||
- `GET /api/individuals`
|
||||
- `GET /api/families`
|
||||
- `GET /api/families/<family_id>`
|
||||
|
||||
### Family and member updates
|
||||
|
||||
- `POST /api/families`
|
||||
- `DELETE /api/families/<family_id>`
|
||||
- `PATCH /api/families/<family_id>/guest-passes`
|
||||
- `POST /api/members`
|
||||
- `PATCH /api/members/<member_id>/checkin`
|
||||
- `PATCH /api/members/<member_id>/swim-test`
|
||||
|
||||
### Admin utilities
|
||||
|
||||
- `POST /api/admin/backup`
|
||||
- `POST /api/admin/export`
|
||||
- `POST /api/admin/reindex`
|
||||
- `POST /api/admin/vacuum`
|
||||
- `POST /api/admin/reset-checkins`
|
||||
- `POST /api/admin/reset-swim-tests`
|
||||
- `POST /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_AGE` in `main.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/vacuum` periodically if the database grows after lots of deletes.
|
||||
- Use `POST /api/admin/export` for reporting snapshots.
|
||||
Reference in New Issue
Block a user