
Sonic Drive-in is an American fast-food chain. Most restaurants have no dine-in areas.
Orders are placed at a terminal from the car window; the finished food is brought by carhop waiters on roller skates.
At the start of development, the restaurant’s current software was over 15 years old, and the UI was written in C++.
I joined the project as a regular developer at an early stage. For the first few months I handled standard tasks: components, features, bugfixes.
Then our lead left, no new one was assigned, and gradually the lead responsibilities passed to me: code review, estimation and distribution of frontend tasks, architectural and structural decisions.
Around the middle of the development cycle, the frontend was rewritten from scratch, mostly by me, due to a large amount of tech debt and many business-logic changes since the start.
With the new architecture, the number of lines of code was reduced by about 40%, and the process of adding features became significantly simpler.
The project was completed, after which we spent several months supporting the product. At the time of my departure, about 100 restaurants were already actively using the new version of the application.
I also wrote a small application for paying for an order by QR code with basic functionality. The payment transaction was handled by an embedded component from the payment system provider.
My work
- SignalR
data-layer - Modal and dialog system
- Router
- Order screen logic
- Order data normalization
- Most of the animations
- Some components
- Code review
- Refactoring
- Task distribution
- Task estimation
- Communication with the customer
- Knowledge transfer
Team
Frontend: 3–4 Backend: 4 Design: 1–2 QA: 2–3 Management: 3 BA: 1
Stack
Frontend: React, TypeScript, Signal-R, i18n, Motion (Framer), Sass Modules Backend: .NET, C++, Go Design: Figma Toolchain: Hyper-V, GitLab, BitBucket, Jenkins, Atlassian Jira & Confluence
Product structure
Feature set
- Support for two languages: English and Spanish
- Modularity: component logic and structure, as well as some flows, can be controlled via
feature flagsfrom the backend - Custom
state-basedrouter - Custom modal and dialog system
- Event-driven state management
Screens and components
- Start marketing screen with a carousel
- Authentication screen for the mobile app account by phone number / QR code
- Interactive order screen with an item list and upsell component
- Interactive payment screen (cash/QR/card/app)
- Screens for each payment method and corresponding flows
- Tip screens: presets and custom value
- Order waiting screen
- Hidden order management screen for employees with password authentication: changing items/order status, payment method, etc.
- Dozens of modals and dialogs
Interesting tasks
Order data normalization
The backend sends the list of order items in live mode.
Each item is a complex object: price, quantity, tax separate from price, discounts, modifiers (“remove onion”, “add ketchup”), and many secondary fields.
An item or modifier may lack an Id, description, etc.
Depending on how the operator added items, the resulting data could differ greatly from the ideal format. For example:
- Multiple identical items instead of “Item × N”
- Multiple identical items with the same modifiers added in different order
- Separate items instead of combos
I wrote a data normalization algorithm that correctly grouped items and calculated cost taking into account quantity, combos, taxes, and discounts.
Scroll container for order items
The application needed to support a wide range of web runtimes.
Mostly host computers used Windows 10, some used Windows 7. There were also systems on a Samsung vendor OS with Chromium version ~50.
We had to abandon a number of relatively modern Web APIs. For example, we couldn't use Grid, IntersectionObserver, or ResizeObserver.
In addition, an order item has a dynamic container height: combo/standard, title field overflow, number of modifiers.
Given the constraints, I wrote two versions of the scroll container: native and virtual.
Container functionality:
- Automatic scroll when a new item is added; disabled with a timeout when the user interacts with the container
- Up/down navigation buttons to the adjacent item that is partially or fully outside the container
viewport, regardless of container size - Up/down navigation buttons to adjacent items outside the current
viewport, regardless of container size - Touch scroll &
overdrag(overdrag only in the virtual version)
Creative solutions
Burn-in
The terminals are outdoors and turned on 24/7.
At night there are few orders, and the application can stay on the main screen for several hours.
Most of the screen is occupied by the carousel, which constantly updates, but the application has a permanent footer that is completely static without user interaction.
In the old version of the application (the layout and component format were roughly the same as in the new one), pixel burn-in often occurred.
There were several proposals:
- Periodically hide the footer
- Change the color
- Use
pixel-shiftof the text
During development we used real marketing banner and video bundles for the carousel component.
I noticed the brand’s “mascot,” which periodically appeared in promos — Red Button Guy. Every terminal has a large red button for contacting an operator — Red Button.
The designer drew several keyframes of the mascot, and I made an SVG animation via interpolation. As a result, once every 5 minutes, when there is no interaction, the mascot rides on roller skates across the application footer and refreshes the pixels.
The initial idea was for the mascot to “sweep the footer.” The idea was proposed on a call with investors, everyone liked it, but it wasn’t on-brand enough, so we had to do roller skates.
Restaurant feature: carhop waiters are always on roller skates.
