This FastAPI application manages player registrations and jersey assignments for POSA sports. It now includes a simple session-based authentication system.
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
DATABASE_URL– SQLAlchemy connection string to your database. If unset, defaults tosqlite:///./app.db.SECRET_KEY– secret used for session cookies and must be set.ADMIN_EMAIL– email for the initial admin account (optional)ADMIN_PASSWORD– password for the initial admin account (optional)
-
Run the app
uvicorn app.main:app --reload
An admin user is created on first start if no users exist. Additional users can be invited from the "Invite User" link once logged in.
Run the unit tests with:
pytest -qWhen using the /email/receive endpoint in development, inbound messages are saved to timestamped files like captured_email_20240101_123456.txt in the project root. This helps inspect the raw email content for troubleshooting.