r/GithubCopilot • • 1d ago

Discussions Can Copilot write a good backend?

I’m using Node.js for the entire stack, but the project will involve operations with real money. I also plan to test everything personally—will Copilot (the free version) be any good for this?

0 Upvotes

11 comments sorted by

4

u/Future_AGI 1d ago

with real money involved, the model matters less than a few rules you set before it writes anything. Store amounts as integer cents (or a decimal type, never floats), put an idempotency key on every payment call, and wrap balance changes in database transactions. Write the tests for those paths yourself first, then let Copilot fill in the rest and run them on every change.

3

u/Ok_Tea4891 1d ago

The model matters less than the guardrails once real money is involved. A few things worth doing regardless of which Copilot model you use: keep amounts as integer minor units (cents) or a decimal library, never floats; make every payment-affecting endpoint idempotent with a client-supplied key so a retry can't double-charge; do balance changes inside a single database transaction with a row lock or a unique constraint; and write tests for the failure paths (timeouts, duplicate webhooks, partial failures), not just the happy path. Copilot is fine for scaffolding and tests, but review anything touching money line by line, because plausible-looking code that rounds wrong or isn't atomic is the typical failure. Testing it yourself is good, but add automated tests so the checks run every time.

1

u/Rezistik 1d ago

What models are available for free? Highly depends on that. Sonnet in copilot can do it pretty easily

1

u/Own_Initiative9800 1d ago

just copilot fusion

2

u/Rezistik 1d ago

Ah no idea haven’t tried that one but honestly since it’s free what are you risking except time?

1

u/Own_Initiative9800 1d ago

mistakes and money? hehe

0

u/Rezistik 1d ago

I mean if you’re involving real money couldn’t you shell out for a Claude pro subscription and have a little more confidence?

0

u/Own_Initiative9800 1d ago

It’s blocked in my country, and buying it is very expensive

2

u/Rezistik 1d ago

Oh then yeah. Try fusion and double check its work more thoroughly. Maybe try qwen or similar I’ve heard good things

2

u/Zain 20h ago

Agree on integer cents. The other thing I'd add for money code is never let the model that wrote it be the only one reviewing it. I run a second model from a different family over the diff read-only, it just reports and doesn't touch files. Different families miss different things, so when both flag the same issue it's almost always real. Then check each finding against the actual code yourself before you accept or dismiss it.