Building Chalky: Making a Darts App That Works Without Bar Wi-Fi
The short version
How I built an offline darts scoring tool for noisy pubs, so your score never gets lost when cellular signal drops out.
Darts in a crowded pub is all about rhythm. You throw three darts, tap the screen, and hand the phone to your friend. But most phone apps try to talk to a cloud server every time you tap a button. In a cellar bar with thick brick walls, that means spinning loading wheels and lost scores.
[ Tap Triple 20 ] --> ( Update Screen Immediately )
|
v
( Save to Phone Storage )
|
v
( Sync to Cloud Later )How the Chalky Engine Works
I built Chalky using React Native and Expo to solve this exact problem. Here is how the scoring loop stays super fast:
type GameState = {
playerScores: Record<string, number>;
throwHistory: Array<{ score: number; multiplier: number }>;
};
// A simple reducer function to handle score taps
function scoreReducer(state: GameState, action: { score: number; multiplier: number }): GameState {
const points = action.score * action.multiplier;
return {
...state,
playerScores: {
...state.playerScores,
current: (state.playerScores.current || 0) + points,
},
throwHistory: [...state.throwHistory, action],
};
}The Takeaway
You don't need a huge cloud database just to track a game of Cricket darts with your friends. By keeping the code simple and running everything on the phone first, the app stays fast and fun even in the basement of a noisy bar.
Brian Franke
brian@coasterlogic.com