DEV Community

David Nizeyimana
David Nizeyimana

Posted on

Pocket Ledger, a local expense log for freelancers

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission đź’¸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

I built Pocket Ledger, a local expense log for freelancers.

The idea is simple. Freelancers have a lot of small expenses: a train ticket, lunch with a client, office supplies, a software subscription, or a utility payment.

You enter a description, an optional merchant, an amount, and a date. Pocket Ledger saves the expense, lists your entries, shows the total, and lets you remove an entry when you need to.

The part I wanted to add was automatic categorization without sending those expense details to a hosted AI service.

When Ollama is running, Pocket Ledger uses qwen2.5:3b locally to choose one of these categories:

  • Advertising
  • Meals
  • Office supplies
  • Software
  • Travel
  • Utilities
  • Other

It also generates a short note explaining the categorization.

A freelancer could pay for a tool like this because their expense descriptions and merchant names stay on their own computer instead of being sent to a hosted chat account.

I haven't charged anyone for it.

Demo

Pocket Ledger is live on Render:

Open Pocket Ledger →

You can try the expense ledger directly in the browser.
Pocket-ledger-web

The app is designed to run locally on your computer.

To run it:

npm install
ollama pull qwen2.5:3b
npm start
Enter fullscreen mode Exit fullscreen mode

Then open:

http://127.0.0.1:3000
Enter fullscreen mode Exit fullscreen mode

If Ollama is not running, the ledger still works. You can choose a category yourself and save the expense.

The app does not download an AI model for you. You install Ollama and the model locally.

Code

Pocket Ledger

A tiny, local-first expense sorter for freelancers. Add an expense and an open-weight AI model assigns a category and gives a short explanation. Review spending totals, keep a local record, and remove entries when needed.

Why open AI?

Pocket Ledger sends expense descriptions only to the Ollama service running on your own computer. The app does not call a hosted AI API, and the expense ledger is stored in data/expenses.json on that computer. That keeps client and business details out of another company's account, avoids per-request model fees, and lets you change the model with an environment variable. Once the model has been downloaded, categorization can run without an internet connection.

Requirements

  • Node.js 18 or newer
  • Ollama installed and running

Run it

npm install
ollama pull qwen2.5:3b
npm start
Enter fullscreen mode Exit fullscreen mode

Then visit http://127.0.0.1:3000.

Ollama is the only AI service used. The first model download requires an internet connection…

The main parts are:

  • server.js — the Express server and expense logic
  • public/ — the frontend
  • data/expenses.json — the local expense data

The ledger starts with an empty JSON array and stores the expenses on the same computer running the application.

How I Built It

Pocket Ledger is built with Node.js, Express, HTML, CSS, and JavaScript.

There is no hosted AI API.

When Ollama is running, the server sends the expense description and optional merchant to Ollama at:

http://127.0.0.1:11434
Enter fullscreen mode Exit fullscreen mode

The default model is:

qwen2.5:3b
Enter fullscreen mode Exit fullscreen mode

The model is asked to return JSON containing a category and a short note.

The server then checks that the category is one of the seven categories supported by the application.

If Ollama cannot be reached, I choose the category myself from the same list. The expense is still saved, and the app records that the category was chosen manually.

I also added some basic validation around the amount. It has to be a valid positive decimal, and the value stored by the application is rounded to cents.

Why Does Open Innovation Matter?

This is probably the part of the project I care about the most.

The expense description and merchant name stay on my computer. The AI call goes to Ollama running locally on 127.0.0.1.

That means I don't need to send someone's expense details to a closed AI API just to get a category.

Once qwen2.5:3b is downloaded, the categorization can also work without an internet connection.

Another thing I like about using a local model is that the application is not completely tied to one provider. I can point OLLAMA_MODEL at another local model that can return the required JSON without changing the frontend.

And if the AI is unavailable, the actual expense tracker still works.

That was important to me. The AI should help with the job, not become a requirement for the basic ledger.

My First User

I haven't had a paying user yet.

The project is still at the prototype stage, so I don't want to pretend that someone has paid for it when they haven't.

Final Thoughts

Pocket Ledger is a small project, but I wanted it to solve a real problem in a simple way.

The main idea is not just "use AI to categorize expenses."

It is:

Use AI locally when the information being processed doesn't need to leave your computer.

There is still a lot I could improve, but the basic workflow works: enter an expense, categorize it with a local model or manually, save it, and keep the data on your own machine.

That's Pocket Ledger.

Top comments (0)