How aakashreddy-ui/digital-heroes works
Digital Heroes combines a public charity-first Stableford score platform with subscriber and administrator workflows. Users discover charities, sign up, subscribe, record scores, choose a charity allocation, and enter monthly draws; winners submit proof for verification and payout. Administrators manage users, subscriptions, charities, draws, winners, and analytics. The documented server layers requests through routes, controllers, services, and repositories. The excerpts show draw simulation/publication and proof handling directly; other domain wiring is represented only at the documented layer level.
Main entry points: controllers Request controllers · repositories Domain repositories · App.tsx Route shell · index.ts API routes
Components 24
Web application
- Route shell
client/src/App.tsx - Public pages
client/src/pages/public - Member dashboard
client/src/pages/dashboard - Admin console
client/src/pages/admin - API client
client/src/api/client.ts
API and access
- API routes
server/src/routes/index.ts - Auth and roles
server/src/middleware/auth.ts - Request controllers
server/src/controllers
Platform workflows
- Identity
server/src/services/authService.ts - Score management
server/src/services/scoreService.ts - Charity allocation
server/src/services/charityService.ts - Independent donations
server/src/services/donationService.ts - Subscriptions
server/src/services/subscriptionService.ts - Draw lifecycle
server/src/services/drawEngineService.ts - Prize calculation
server/src/services/prizePoolService.ts - Winner verification
server/src/services/winnerService.ts - Analytics
server/src/controllers/analyticsController.ts
Persistence and files
- Domain repositories
server/src/repositories - Local database
server/src/db/index.ts - Proof storage
server/src/utils/storage.ts
External services
- Stripe payments
- Supabase storage
Other components
- Visitor or member
- Administrator
Connections 33
- Visitor or member → Route shell: uses
- Administrator → Route shell: uses
- Route shell → Public pages: routes to
- Route shell → Member dashboard: routes to
- Route shell → Admin console: routes to
- Public pages → API client: requests data
- Member dashboard → API client: requests data
- Admin console → API client: requests data
- API client → API routes: sends requests
- API routes → Auth and roles: protects routes
- API routes → Request controllers: dispatches
- Request controllers → Identity: calls
- Request controllers → Score management: calls
- Request controllers → Charity allocation: calls
- Request controllers → Independent donations: calls
- Request controllers → Subscriptions: calls
- Request controllers → Draw lifecycle: simulates or publishes
- Request controllers → Winner verification: calls
- Request controllers → Analytics: calls
- Identity → Domain repositories: reads and writes
- Score management → Domain repositories: reads and writes
- Charity allocation → Domain repositories: reads and writes
- Independent donations → Domain repositories: reads and writes
- Subscriptions → Domain repositories: reads and writes
- Draw lifecycle → Domain repositories: reads and writes
- Draw lifecycle → Prize calculation: calculates pools
- Winner verification → Domain repositories: reads and writes
- Analytics → Domain repositories: queries
- Domain repositories → Local database: queries
- Request controllers → Proof storage: stores or signs proofs
- Subscriptions → Stripe payments: creates checkout
- Stripe payments → API routes: sends webhooks
- Proof storage → Supabase storage: uploads or signs