Photojury architecture
This document gives a quick overview of the main architectural concepts in Photojury and how the app is structured.
Overview
Photojury is a CodeIgniter 4 application for managing photo competitions and jury workflows. It supports:
- competition setup
- round lifecycle management
- submission handling
- jury voting and judging
- admin review and result calculation
- result publication and presentation
- diploma generation and export workflows
The app is designed to run alongside a WordPress installation and reuse WordPress users and roles where needed.
Authentication model
The project intentionally uses two independent authentication mechanisms:
WordPress-backed admin access
Administrators and staff users are authenticated through WordPress and are exposed through the WordPressAuthService service. These users are checked by the adminauth filter on /admin/* routes.
This is separate from the app's own database-level access rules. Full admins and scoped competition admins are granted access via the jury-specific tables instead of WordPress roles alone.
Jury member access
Jury members are not WordPress users. They authenticate using a per-member access code stored in a cookie and validated against the access table. Routes under jury_entry/* are gated by judgeauth.
Core concepts
Competitions and rounds
The round lifecycle drives most application logic. A round progresses through statuses such as:
SUBMISSIONJURYINGADMIN_JURYINGJURY_READYREADYCLOSED
These statuses gate which controllers and views are active and which workflows a user can perform.
Admin privilege tiers
The application separates permission levels from WordPress roles:
- full admin: unrestricted access across all competitions
- scoped competition admin: access limited to specified competitions
- presentation users: read-only access to presentation views for a specific competition
These are independent of the WordPress role system and are handled in the app's own access tables.
Results and scoring
Result calculation is handled through result models and services such as:
PublicResultModelAdminResultsModelPublicResultServiceResultCalculator
The app stores uploaded images, rounds, judges, and computed results as part of the competition data model.
File layout
Some of the main areas in the repository are:
app/- application code, controllers, models, config, filterspublic/- public web root and uploaded assetsdocs/- project documentationtests/- PHPUnit test suite and database fixturesdoc/- database schema and related schema artifacts
Testing
The test environment uses SQLite in memory, while the production database schema is described in doc/dbschema.sql. The generated test schema lives under tests/_support/Database/Generated and is used to create the test tables for CI4-based tests.
Related docs
- Administrator guide
- README
