How akoclantoy/yayay works
EcoRewards is a community recycling rewards platform. Residents register, identify themselves with a QR card, earn points from recorded recycling, and spend points on rewards; staff scan and record collections, while administrators manage users, catalogs, and program operations. The graph includes the documented pickup, AI, and engagement capabilities. Some portal-to-API connections are described only at the product level in the README; those links use that documentation rather than implying unsampled implementation details.
Main entry points: db.ts Application database · rewards/route.ts Rewards and redemptions · resident Resident portal · register/route.ts Registration
Components 19
Identity and access
- Registration
src/app/api/auth/register/route.ts - Sign-in
src/auth.ts - Auth validation
src/lib/validators/auth.ts - Session and roles
src/lib/api-auth.ts
Collection and impact
- Staff portal
src/app/staff - QR scanning
src/app/staff/scan/page.tsx - Record collection
src/app/staff/record/page.tsx - Recycling records API
src/app/api/recycling/route.ts - Points and impact
src/lib/services/recycling.ts - Pickup requests
src/app/api/pickup/route.ts - AI recycling tools
src/app/api/ai
Resident rewards
- Resident portal
src/app/resident - Rewards and redemptions
src/app/api/rewards/route.ts - GCash redemption
src/lib/gcash-redemption.ts
Program operations
- Admin portal
src/app/admin - Announcements API
src/app/api/announcements/route.ts - Application database
src/lib/db.ts
Other components
- Residents and staff
- Google Gemini
Connections 27
- Residents and staff → Registration: registers
README.md - Registration → Auth validation: validates with
src/app/api/auth/register/route.ts - Registration → Application database: creates account
src/app/api/auth/register/route.ts - Registration → Sign-in: emails verification
src/app/api/auth/register/route.ts - Residents and staff → Sign-in: signs in
README.md - Sign-in → Application database: authenticates against
src/auth.ts - Sign-in → Auth validation: validates with
src/auth.ts - Resident portal → Residents and staff: serves residents
README.md - Staff portal → Residents and staff: serves staff
README.md - Staff portal → QR scanning: offers scanning
README.md - QR scanning → Record collection: identifies resident
README.md - Record collection → Recycling records API: records collection
README.md - Recycling records API → Session and roles: checks access
src/app/api/recycling/route.ts - Recycling records API → Points and impact: delegates records
src/app/api/recycling/route.ts - Recycling records API → Application database: reads and writes
src/app/api/recycling/route.ts - Points and impact → Application database: reads and writes
src/lib/services/recycling.ts - Resident portal → Pickup requests: requests pickup
README.md - Resident portal → AI recycling tools: uses assistant
README.md - AI recycling tools → Google Gemini: calls optionally
README.md - Resident portal → Rewards and redemptions: redeems points
README.md - Rewards and redemptions → Session and roles: checks roles
src/app/api/rewards/route.ts - Rewards and redemptions → Application database: reads and writes
src/app/api/rewards/route.ts - Rewards and redemptions → GCash redemption: handles GCash
src/app/api/rewards/route.ts - Admin portal → Announcements API: manages notices
README.md - Announcements API → Application database: reads and writes
src/app/api/announcements/route.ts - Admin portal → Rewards and redemptions: oversees redemptions
README.md - Pickup requests → Application database: reads and writes
src/app/api/pickup/route.ts