How dev-yvonne/events-system works
1. Overall shape
- EventHub is a Django monolith with a multi-portal architecture: attendee, organizer, custom admin portal, and the standard Django admin.
- Core behavior is server-rendered through Django templates, with portal-specific JavaScript used for dynamic interactions and API calls.
2. Routing and portal boundaries
- config/urls.py delegates into separate URL sets for attendee, organizer, admin, and API surfaces.
- This is an important architectural boundary: each portal has its own templates, static assets, and page flows, while sharing the same backend models and auth system.
3. Core domain modules
- events/ is the central marketplace module: event creation, discovery, SEO pages, organizer APIs, checkout-related event logic, and seed data.
- bookings/ handles booking records, ticket lifecycle, and booking-related email workflows.
- payments/ manages payment orders, M-Pesa integration, verification, screenshots, and notification side effects.
- reviews/ covers event reviews and customer stories.
- subscriptions/ contains organizer plan logic and subscription services.
- notifications/ stores notification state and exposes notification views.
4. Identity and account subsystem
- accounts/ is the authentication and user-management boundary.
- It includes user profiles, Google auth, organizer verification, API tokens/keys, team-member relationships, presence tracking, and revenue metrics.
- The account model appears to support multiple roles and organization-oriented organizer accounts, which feeds the portal separation.
5. Data model and persistence
- The project uses Django ORM with extensive migrations in each app, indicating a relational schema as the main system of record.
- config/settings.py plus DATABASE_URL in the README imply SQLite for development and PostgreSQL in production.
- database_schema.dot suggests the schema has been documented explicitly, which is useful for domain/data diagramming.
6. Payment and ticketing flow
- The primary business flow is: attendee selects an event/tickets, creates a booking/order, initiates payment, and receives a confirmed booking/ticket after verification.
- payments/mpesa.py, payments/screenshot_verifier.py, and payments/screenshot_storage.py show that M-Pesa is a first-class payment rail, with manual/assisted verification support.
- bookings/email_service.py indicates booking confirmation and transactional email are part of the fulfillment path.
7. Organizer operations
- Organizers manage events, tickets, bookings, attendees, promotions, reviews, support, and scanner/check-in flows from frontend/templates/organizer/ and frontend/static/js/organizer/.
- events/api_organizer_views.py, admin_views.py, and organizer-specific JS suggest an operational console rather than a consumer-facing marketplace.
- Subscription state and billing views are part of this portal, tying organizer access to plan status.
8. Custom platform administration
- The repo has a dedicated admin portal under admin_views.py and frontend/templates/admin/, separate from Django’s built-in admin.
- This portal focuses on moderation and operations: users, organizers, events approvals, payments, bookings, tickets, reports, notifications, support, and settings.
- That separation matters architecturally because it reflects a business-ops layer above the domain apps.
9. Frontend structure
- The frontend is template-first, not an SPA: shared base templates plus portal-specific templates in frontend/templates/{attendee,organizer,admin,shared}.
- Static assets are similarly partitioned by portal in frontend/static/css and frontend/static/js, with shared helpers in frontend/static/js/shared/.
- This suggests a multi-page app enhanced with modular JavaScript services, fetch wrappers, and client-side UI state for carts, wishlist, auth, and dashboards.
10. Discovery, SEO, and public content
- events/seo_views.py, events/discovery.py, and frontend/templates/attendee/pages/* show a strong public-discovery layer.
- The README mentions /robots.txt, /sitemap.xml, and meta descriptions, so SEO is part of the public architecture rather than an afterthought.
- The homepage is content-heavy and likely uses prefetching/curated sections such as featured events, stats, testimonials, and newsletter blocks.
11. Cross-cutting services
- accounts/presence.py and frontend/static/js/shared/presence.js indicate live user/organizer presence features.
- payments/notification_utils.py and payments/organizer_notifications.py show internal notification fan-out from payment events.
- frontend/static/js/shared/* includes reusable browser services for auth, cart storage, wishlist storage, event API calls, and portal notifications.
12. Authentication and role handling
- Auth is spread across accounts/auth.py, accounts/auth_views.py, and accounts/google_auth.py, with shared login/register templates in frontend/templates/shared/auth/.
- The app supports role-specific experiences and likely role-based authorization checks across attendee, organizer, and admin surfaces.
- API key and team-member models imply some endpoints or operational tools are secured beyond simple session auth.
13. Operational and deployment shape
- Procfile, render.yaml, and vercel.json indicate deployment is configured for hosted environments, with the backend likely running as a Django app and static assets served separately or as part of deployment packaging.
- backend/staticfiles/ suggests collected/static build output is tracked for deployment.
- config/requirements.txt and top-level requirements.txt reinforce a Python runtime centered deployment.
14. How the pieces connect
- Browser requests enter Django through portal-specific URLs.
- Views read/write relational data through app models and migrations.
- Payment/order actions trigger M-Pesa integration and verification workflows.
- Successful bookings drive emails, notifications, and ticket state changes.
- The frontend layers consume backend-rendered pages plus JSON endpoints for dashboard and management interactions.
Main entry points: events/models.py Events · urls.py Root URLs · payments/models.py Payments · accounts/models.py Accounts
Components 25
Routing
URL dispatch and portal boundaries
- Root URLs · Main URL dispatcher that delegates into portal and API surfaces
config/urls.py - Attendee URLs · Public attendee-facing routes
config/attendee_urls.py - Organizer URLs · Organizer console routes
config/organizer_urls.py - Admin URLs · Custom operations portal routes
config/admin_urls.py - API URLs · Shared API surface used by portal JavaScript and backend clients
config/api_urls.py
Domain
Core business apps and relational state
- Accounts · Authentication, profiles, roles, organizer verification, and team relationships
accounts/models.py - Events · Event discovery, SEO pages, organizer event management, and core event data
events/models.py - Bookings · Booking records, ticket lifecycle, and confirmation workflows
bookings/models.py - Payments · Payment orders, M-Pesa rails, screenshot verification, and side effects
payments/models.py - Reviews · Event reviews and customer stories
reviews/models.py - Subscriptions · Organizer plans and subscription services
subscriptions/models.py - Notifications · Notification state and user-facing notification views
notifications/models.py - M-Pesa · M-Pesa checkout and payment rail integration
payments/mpesa.py - Verifier · Screenshot and assisted payment verification workflow
payments/screenshot_verifier.py - Booking Email · Transactional booking confirmation email workflow
bookings/email_service.py - SEO Views · Discovery and SEO-oriented public event pages
events/seo_views.py - Checkout · Event checkout orchestration and ticket selection flow
events/checkout.py - Organizer API · Organizer-facing event management endpoints
events/api_organizer_views.py
Frontend
Template-first portals and shared browser services
- Attendee Shell · Shared attendee layout and page composition
frontend/templates/attendee/base.html - Organizer Shell · Shared organizer layout and dashboard composition
frontend/templates/organizer/base.html - Admin Shell · Custom admin portal layout
frontend/templates/admin/base_admin.html - Auth Pages · Login, register, reset, and verification screens shared across portals
frontend/templates/shared/auth/login.html - Event API · Shared client-side event API wrapper used across portals
frontend/static/js/shared/event-api.service.js - Presence · Shared live presence tracking in browser and backend
frontend/static/js/shared/presence.js
Infra
Settings, deployment, and runtime configuration
- Settings · Environment, database, apps, and deployment settings
config/settings.py
Connections 25
- Root URLs → Attendee URLs: routes to · Dispatches public attendee requests
- Root URLs → Organizer URLs: routes to · Dispatches organizer console requests
- Root URLs → Admin URLs: routes to · Dispatches custom admin requests
- Root URLs → API URLs: routes to · Dispatches API requests
- Root URLs → Settings: uses · Loads project configuration and environment settings
- Attendee URLs → Attendee Shell: renders · Attendee pages share a common shell
- Organizer URLs → Organizer Shell: renders · Organizer pages share a common shell
- Admin URLs → Admin Shell: renders · Admin pages share a common shell
- Auth Pages → Accounts: authenticates · Shared login and registration flows feed the identity subsystem
- Events → Accounts: depends on · Events are owned and managed by organizer accounts
- Bookings → Events: references · Bookings are created from selected events and tickets
- Bookings → Accounts: belongs to · Bookings are associated with attendee identities
- Payments → Bookings: settles · Payment completion drives booking confirmation
- Payments → Events: prices · Payment orders are based on event ticket pricing
- Payments → M-Pesa: integrates · Primary payment rail
- Payments → Verifier: verifies · Assisted/manual verification path for screenshots and proof
- Payments → Notifications: fan-out · Payment events trigger notifications
- Bookings → Booking Email: sends · Booking confirmation and fulfillment emails
- Events → SEO Views: publishes · Public discovery and SEO pages
- Events → Checkout: orchestrates · Checkout flow starts from event pages and ticket selection
- Events → Organizer API: exposes · Organizer dashboard operations for event management
- Events → Reviews: shows · Reviews and customer stories enrich event pages
- Subscriptions → Accounts: governs · Organizer plan state ties into account capabilities
- Event API → Events: calls · Shared browser service talks to event endpoints
- Presence → Accounts: tracks · Presence features are anchored in user and organizer identities