all these changes

This commit is contained in:
Jake Kasper
2026-04-09 13:19:47 -05:00
parent e83a51a051
commit 65315f36d1
39102 changed files with 7932979 additions and 567 deletions

View File

@@ -137,6 +137,26 @@ This application is pre-configured for deployment behind Traefik with:
- API: https://turftracker.kaspers.us/api
- Database: Internal network only (not exposed)
### Local Development (localhost without Traefik)
Need to run everything on a laptop without the Traefik proxy? Use the new `docker-compose.dev.yml`, which targets `http://localhost` and runs Flyway migrations automatically:
```bash
# Build images (includes dev deps for backend) and start the stack
docker compose -f docker-compose.dev.yml up --build
# The services expose the usual ports:
# - Frontend: http://localhost:3000
# - Backend API: http://localhost:5000/api
# - Postgres: localhost:5432 (credentials from .env)
```
Migrations run on every `up`, but you can re-run them manually after making schema changes with:
```bash
docker compose -f docker-compose.dev.yml up migrations
```
### First Time Setup
1. **Create an admin account**
@@ -241,6 +261,45 @@ If you have an Authentik instance for SSO:
**Scopes Required:** `openid profile email`
#### Gmail OAuth2 Email Setup
TurfTracking supports email invitations, password reset emails, and selected user notification emails through Gmail OAuth2.
Google references:
- Gmail SMTP supports OAuth2/XOAUTH2: https://developers.google.com/workspace/gmail/imap/xoauth2-protocol
- OAuth 2.0 overview: https://developers.google.com/identity/protocols/oauth2
- App passwords are not recommended in most cases: https://support.google.com/accounts/answer/185833
1. **In Google Cloud Console:**
- Create or select a project
- Enable the Gmail API
- Configure the OAuth consent screen
- Create an OAuth client
- Generate a refresh token for the Gmail account that will send mail
2. **In your `.env` file:**
```env
GMAIL_OAUTH_USER=your-sending-account@gmail.com
GMAIL_OAUTH_CLIENT_ID=your-google-oauth-client-id.apps.googleusercontent.com
GMAIL_OAUTH_CLIENT_SECRET=your-google-oauth-client-secret
GMAIL_OAUTH_REFRESH_TOKEN=your-google-oauth-refresh-token
GMAIL_OAUTH_REDIRECT_URI=https://developers.google.com/oauthplayground
EMAIL_FROM_NAME=TurfTracking
EMAIL_FROM_ADDRESS=your-sending-account@gmail.com
```
3. **Restart the backend and send a test email:**
```bash
TOKEN=$(curl -s -X POST http://localhost:5001/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@example.com","password":"DevAdmin123!"}' | python3 -c 'import sys,json; print(json.load(sys.stdin)["data"]["token"])')
curl -X POST http://localhost:5001/api/admin/system/test-email \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"to":"your-email@example.com"}'
```
## Application Structure
```