How ferib/mcdonald_loyaltycodegenerator works
Project type and purpose
• From the file tree and README, this is an open-source .NET console application (ReverseCoffee) whose goal is to reverse-engineer and interact with the McDonald’s mobile application’s API to obtain free food.
• It also includes a small local web interface (index.html) served by Nancy, and a Discord webhook notifier.
File structure
• Top-level files:
• ReverseCoffee.csproj – the .NET project file
• Program.cs – the app’s entrypoint
• DiscordWebhookHandler.cs – sends notifications to a Discord webhook
• McDonald.cs and McStruct.cs – data models & client logic for the McDonald’s API
• Nancy.cs – configuration of the Nancy web server used to serve the UI
• index.html – the front-end UI served locally
• action.yml – GitHub Actions CI workflow
• .github/FUNDING.yml, .gitignore, LICENSE, README.md – repository metadata
• No separate “frontend” or “backend” directories; modules are all at root.
README
• Confirms the intent: a hacking tool to reverse the McDonald’s mobile app for cost reduction.
a. Main components
1. Program (Console App entrypoint)
2. Nancy Web Server Module
3. UI (index.html)
4. McDonald API Client (McDonald.cs + McStruct.cs)
5. DiscordWebhookHandler
6. External Services
– McDonald’s Mobile API Endpoints
– Discord Webhook Endpoint
7. CI/CD (GitHub Actions – action.yml)
b. Relationships & data flows
• Program.cs initializes:
• Nancy server (serves index.html, exposes endpoints for user actions)
• DiscordWebhookHandler (ready to send events)
• McDonald API Client (ready to craft and send HTTP requests)
• Browser/UI → Nancy routes → Program logic
• Nancy handlers call McDonald client → send/receive HTTP → McDonald’s API
• Nancy handlers also invoke DiscordWebhookHandler → send notifications
• Nancy serves updated results back to UI
• GitHub Actions triggers on push/pull to build/test/deploy
c. Architectural patterns & design principles
• Single-process modular design: console app hosts both HTTP server and client logic
• Separation of concerns:
• Web server layer (Nancy.cs)
• API client/data models (McDonald.cs, McStruct.cs)
• Notification subsystem (DiscordWebhookHandler.cs)
• Static UI (index.html)
• Extensibility: additional modules (e.g., new endpoints or webhook handlers) can be plugged into Nancy
d. Key technologies & frameworks
• .NET (C#) console application
• NancyFX (lightweight embedded web server)
• HTTP/REST client logic
• Discord Webhook API
• GitHub Actions for CI
Detailed capture of essential elements
• Don’t simply list files; group them by module
• Initialization flow in Program.cs
• GitHub Actions workflow as a side component
• Static UI (index.html) is shown as “served asset” by Nancy
• A “ReverseCoffee App” container, subdivided into:
– Program (entrypoint)
– Nancy Web Server
– McDonald API Client (with data models)
– Discord Webhook Handler
– Static UI Asset
– McDonald’s Mobile API
– Discord Webhook Endpoint
– GitHub Actions
– Program → Nancy startup
– Nancy ↔ UI (HTTP)
– Nancy → McDonald API Client → McDonald’s API
– Nancy → DiscordWebhookHandler → Discord
– GitHub Actions → ReverseCoffee build/test/deploy