How igorg0mes/ru_connect works
RU Connect is a university restaurant management platform. The public workflow lets a person look up status and balance by CPF; staff authenticate, scan or enter an identifier, and the access controller checks the person, current meal, and ticket balance before recording an outcome. Other major capabilities include registration with QR codes, menu planning, access-log review, RBAC, and wallet top-ups through Mercado Pago. The access path is grounded in sampled controller code; several other branches are documented in the README but their implementation was not sampled.
Main entry points: access_controller.rb Access identification · payments_controller.rb Payment workflow · students_controller.rb Student records · visitors_controller.rb Visitor records
Components 18
Access and discovery
- CPF finder
app/controllers/finder_controller.rb - Access identification
app/controllers/access_controller.rb - QR scanner
app/javascript/controllers/qr_scanner_controller.js
People and identity
- Student records
app/controllers/students_controller.rb - Visitor records
app/controllers/visitors_controller.rb - QR email
app/mailers/qr_code_mailer.rb - QR generation
app/services/qr_code_generator_service.rb
Restaurant operations
- Meal periods
app/controllers/meals_controller.rb - Daily menus
app/controllers/daily_menus_controller.rb - Access logs
app/controllers/access_logs_controller.rb
Administration
- Roles and permissions
app/models/permission.rb - User management
app/controllers/users_controller.rb
Wallet and payments
- Ticket pricing
app/controllers/ticket_prices_controller.rb - Payment workflow
app/controllers/payments_controller.rb
Other components
- Student or visitor
- Restaurant staff
- Mercado Pago
- PostgreSQL data
db/schema.rb
Connections 22
- Student or visitor → CPF finder: looks up CPF
- CPF finder → PostgreSQL data: reads status
- Restaurant staff → Access identification: identifies person
- QR scanner → Access identification: submits identifier
app/javascript/controllers/qr_scanner_controller.js - Access identification → Student records: searches student
app/controllers/access_controller.rb - Access identification → Visitor records: searches visitor
app/controllers/access_controller.rb - Access identification → Meal periods: finds current meal
app/controllers/access_controller.rb - Access identification → Access logs: records attempt
app/controllers/access_controller.rb - Access identification → PostgreSQL data: reads and writes
- Student records → QR generation: generates QR
- Visitor records → QR generation: generates QR
- Student records → QR email: sends QR email
- Visitor records → QR email: sends QR email
- Restaurant staff → Daily menus: plans menus
- Daily menus → Meal periods: organizes meal periods
- Restaurant staff → Access logs: reviews entries
- User management → Roles and permissions: assigns access
- Restaurant staff → Payment workflow: starts top-up
- Payment workflow → Ticket pricing: gets unit price
app/controllers/payments_controller.rb - Payment workflow → Mercado Pago: creates preference
app/controllers/payments_controller.rb - Mercado Pago → Payment workflow: notifies webhook
- Payment workflow → PostgreSQL data: stores payment