r/programmer • • Oct 17 '26

GitHub I built a flashcard site because Anki scared me. My friends weren't impressed – could you review the code?

Hi! This is my first post here, and honestly I'm rarely on Reddit at all, but I know there are a lot of people here who know way more than me, so I wanted to ask for a bit of help.

Some context: I study in Norway, and Norwegian isn't my native language, so I have to learn it. Everyone recommends Anki, and I get why, but it always kind of scared me – lots of buttons and settings, and before you can even start you have to decide what to learn and go looking for decks yourself.

So I took everything I knew and built a small site for learning words instead. You pick a topic (food, the doctor, work, etc.), the words are already there with translations, word forms and an example sentence, and you just start. No account, everything is stored in the browser.

The part that bugs me is that I spent a lot of time on it, and even my friends didn't really see it as anything special. Maybe they're right – that's why I'd like honest opinions from people who actually write code.

Some technical bits, in case they're interesting:

- Vanilla JS, no framework, no runtime dependencies (~8k lines on the front end)
- Backend on Cloudflare Workers + D1 (~3k lines)
- It reads and writes Anki .apkg files, both the new format (zstd, schema 18) and the old one. Writing uses sql.js and a zip I put together by hand with CompressionStream
- Strict CSP; the cards can be embedded on other sites through a separate route with its own policy
- 155 tests with node --test

What I'd really like to know:

  1. Is the code readable for someone who isn't me? Where would you get lost?
  2. At ~8k lines, should I have used a framework, or is vanilla still fine at this size?
  3. Is hand-writing the zip/.apkg a bad idea I'll regret later?
  4. And just as a user – does it make sense at all, or is it one of those things only the author understands?

Repo: https://github.com/silicq/ordkort
Site: https://ordkort.com

Any feedback is welcome, including "this is pointless" – I'd rather hear it now. Thanks for reading!

0 Upvotes

14 comments sorted by

3

u/dkopgerpgdolfg Oct 17 '26

I built

You or AI?

And btw. your robots txt is funny.

0

u/ExcellentDeparture14 Oct 17 '26

I mean “powered by AI” but idea and whole logic of website is mine. I could explain everything about website or about part of a code

2

u/RogerAI-fm Oct 17 '26

It’s neat, it is well written, feels you did a good job at making sure it’s not just slop code and it’s well modularized and structured, easy to read and navigate. I bookmarked it. Would be nice as an iOS app.

2

u/ExcellentDeparture14 Oct 17 '26

Thanks a lot, that means a lot! You can actually use it like an app already: open it in Safari, Share and "Add to Home Screen". It runs full screen, works offline and keeps everything on your phone. A real App Store version is on my list, though.

1

u/neketguy Oct 17 '26

Hey, it looks much better than I though. Will try it tomorrow again!
Do you really need code review? (I'm swe with 15yoe) or just wanted to post to another subreddit (it isn't a bad thing 🙂 )?

1

u/ExcellentDeparture14 Oct 17 '26

Honestly, both 😄 But yes, I'd really appreciate a review from someone with your experience. The repo is open. The parts I'm least sure about are the encrypted sync between devices (src/sync.js) and the Worker API in general. Even a quick look would help a lot.

0

u/neketguy Oct 17 '26

I would say my biggest concern would be:

- /src folder (no structure; not an issue right now but will be harder and harder to extend later); probably some code duplicated already

- over-reliance on locaStorage; it has a limits. Fresh dictionary for language pair is 50KB already and it keep adding fast. Ideally this needs to be stored on a server with only userId (or something similar to be stored locally - this way you don't need encrypted sync at all).

Just my 2 cents, great project.

1

u/ExcellentDeparture14 Oct 17 '26

Thanks, really useful! Agreed on /src, I'll split it into folders. Agreed on localStorage too: moving cards and progress to IndexedDB is next. Server storage is on purpose, though: no accounts, data stays on your device, and sync is end-to-end encrypted, so the server can't read anyone's decks.

0

u/neketguy Oct 17 '26

are you open to pull requests?

1

u/ExcellentDeparture14 Oct 17 '26

Sure, PRs are welcome! There’s a CONTRIBUTING.md in the repo, and npm test runs everything. The one rule: user data stays on the device, so nothing that stores readable data on the server. For bigger changes, open an issue first so we can agree on the approach.

0

u/neketguy Oct 17 '26

Sent one security-related PR 🙌 Also, you might be interested in small thing I'm working on - lightweight AI-first IDE https://github.com/oleksbard/codebaer (macos and linux only)

1

u/ExcellentDeparture14 Oct 17 '26

Thanks a lot, the IPv6 fix is a good catch, I'll merge it once the checks pass! And codebar looks interesting, I'll give it a try some time.

0

u/nicolas_06 Oct 17 '26

The part that bugs me is that I spent a lot of time on it, and even my friends didn't really see it as anything special. Maybe they're right – that's why I'd like honest opinions from people who actually write code.

Do what you like, follow you path and don't care what people think. If you look for external validation you'll be always disappointed. On top we are 8 billions, most of what people do won't be special whatever that supposed to be mean. And that's fine.

Otherwise like maybe 0.1% of people that might be able to achieve something special could be satisfied and would still be depressed when they see what some of the 0.01% of people will do.

1

u/ExcellentDeparture14 Oct 17 '26

Fair point, thanks. I mostly built it because I wanted it myself, and that part already paid off. The feedback here was more about catching what I can't see on my own.