Flask patterns -- application factory, blueprints, error handlers, extensions, request lifecycle, configuration, logging, CLI commands
98
98%
Does it follow best practices?
Impact
98%
1.28xAverage score across 5 eval scenarios
Passed
No known issues
A community center needs a Flask API for managing events and registrations. They host workshops, meetups, and classes. The API should handle events (title, description, date, max_attendees, location) and registrations (attendee_name, attendee_email, event_id, registered_at).
Requirements:
GET /api/events?upcoming=true filter to show only future events.The system should be well-structured so that a junior developer can understand and extend it.
Produce Python source files in a event-platform/ directory:
app/__init__.py -- application factoryapp/extensions.py -- extension instancesapp/errors.py -- custom exceptions and error handlersapp/db.py -- data store (in-memory or SQLite)app/routes/events.py -- events blueprintapp/routes/registrations.py -- registrations blueprinttests/conftest.py -- test fixturesrun.py -- entry pointrequirements.txtDo not run pip install or start the server.