forked from jamesp/sasa-membership
632e66e21d
- Add configurable profile questions with conditional visibility, admin-only fields, user answers, and seeded onboarding/volunteer questions
- Add admin UI for managing profile questions and member profile answers
- Add volunteer level/profile data support across backend schemas, models, API, and migration
- Update dashboard/profile UI, super admin menu, membership service types, and related styling
- Add privacy policy, terms of service, cookie notice, and footer links
- Add frontend Vitest coverage for profile question logic
- Add backend pytest coverage for profile answer normalization and validation
- Update restart.sh to build, run frontend/backend unit tests, and restart only after tests pass
- Refresh README, quickstart, project structure, instructions, and Square docs to match current app features
- Protect feature flag reload behind super-admin access
- Restrict admin-triggered password resets so admins can only reset member accounts
- Replace email template HTML preview rendering with escaped text preview
- Update docs for feature flag reload access, password reset scope, and email template preview safety
-- test user questions are also made by AI and not very useful. but i didn't know what to put there so its good enough for a test
4.2 KiB
4.2 KiB
Quick Start Guide
Starting the System
# Start all services
docker compose up -d
# Watch the logs until services are ready
docker compose logs -f
Wait until you see "Application startup complete", then press Ctrl+C.
Access the API:
Set APP_PORT in .env / .env.example to change 8050.
For Square payment form testing, use HTTPS at https://localhost:8443.
Set APP_TLS_PORT in .env / .env.example to change 8443.
TLS certs are auto-generated by the gateway container on first start.
Restart With Tests
Use the restart helper when you want to rebuild, run the fast test suite, and restart only after tests pass:
./restart.sh
It runs:
docker compose run --rm frontend npm testdocker compose run --rm backend pytest -q
The current tests cover frontend profile-question visibility/editability rules and backend profile-question answer normalization/validation. They are designed to complete quickly.
Testing the API
1. Register a new user
curl -X POST "http://localhost:8050/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "testpass123",
"first_name": "Test",
"last_name": "User"
}'
2. Login
curl -X POST "http://localhost:8050/api/v1/auth/login-json" \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "testpass123"
}'
Save the access_token from the response.
3. Get your profile
curl -X GET "http://localhost:8050/api/v1/users/me" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"
4. List membership tiers
curl -X GET "http://localhost:8050/api/v1/tiers/"
Docker Compose Commands
# Start services
docker compose up -d
# Stop services
docker compose down
# View logs (all services)
docker compose logs -f
# View logs (specific service)
docker compose logs -f backend
# Restart services
docker compose restart
# Rebuild after code changes
docker compose up -d --build
# Check status
docker compose ps
# Tail gateway logs
docker compose logs -f gateway
Default Admin Access
- Email: admin@swanseaairport.org
- Password: admin123
⚠️ Change this password immediately!
Common Tasks
Create a membership tier (admin)
- Login as admin
- Use the token in the Authorization header
- POST to
/api/v1/tiers/
Record a manual payment (admin)
- Login as admin
- POST to
/api/v1/payments/manual-payment
View all users (admin)
- Login as admin
- GET
/api/v1/users/
Manage profile questions (admin)
- Login as admin or super admin
- Open the dashboard Admin area
- Create, edit, deactivate, and order configurable profile questions
- Use dependencies to show questions only after a matching parent answer
Edit member profile answers
- Members can update normal profile questions from the Questions dashboard tab
- Admin-only answers, such as verified training fields, must be updated by an admin
Manage events and RSVPs
- Admins can create and edit events from the dashboard
- Members can view upcoming events and submit RSVP status
- Admins can view RSVP lists and attendance data
Manage email templates and bounces
- Super admins can edit database-backed email templates; previews are shown as escaped HTML text
- SMTP2GO bounce webhooks are stored and visible in bounce management
- Bounce cleanup and manual deactivation are available through the API/admin screens
Troubleshooting
Check service status
docker compose ps
View all logs
docker compose logs -f
View backend logs only
docker compose logs -f backend
Restart everything
docker compose restart
Clean start (removes all data)
docker compose down -v
docker compose up -d
Next Steps
- Update
.envwith your Square and SMTP2GO credentials - Change the default admin password
- Create additional admin users
- Configure membership tiers as needed
- Test payment processing
- Customize email templates
- Configure profile questions for onboarding and volunteer data
- Use
./restart.shbefore deploying changes so frontend and backend unit tests run first