A Java desktop app that keeps the khata (account book) of a student mess. Daily meal chart, bazar and shared bills, deposits, and an automatic month-end settlement.
Why · Features · Screenshots · Quick start · Run options · A month in MessKhata · Calculations · Structure · OOP · Data files · Tests · FAQ · Roadmap
In almost every Bangladeshi student mess one person acts as the manager. They count meals on a paper chart, collect advance money, note every bazar, and at the end of the month sit down with a calculator to find the meal rate and who owes whom. Mistakes and arguments are common.
MessKhata does that bookkeeping. The manager enters meals, bazar and deposits during the month, and the app calculates the meal rate and every member's balance instantly.
| Page | What you can do |
|---|---|
| 🔐 Login | Sign in as the mess manager |
| 📊 Dashboard | Meal rate, total meals, bazar cost, cash in hand, meals-per-day chart, recent activity |
| 👥 Members | Add, edit, search, mark as left; members with history are protected from deletion |
| 🍛 Meal chart | Member × day grid like the paper chart, half meals, one-click fill, today and Fridays highlighted |
| 🛒 Bazar & bills | Bazar shared by meals eaten; cook, gas, Wi-Fi shared equally; "paid from own pocket" credits a deposit |
| 💰 Deposits | Advance money per member with running totals |
| 📄 Monthly report | Who gets money back and who has to pay, exportable as .txt |
| 📅 Any month | Switch to previous or next months from the top bar |
Data is saved automatically in plain text files, so no database setup is needed.
| Meal chart | Monthly report |
|---|---|
![]() |
![]() |
| Bazar & bills | Deposits |
|---|---|
![]() |
![]() |
| Login | Members |
|---|---|
![]() |
![]() |
You only need JDK 11 or newer (check with java -version).
git clone https://github.com/feroz-afm/MessKhata-Mess-Meal-Manager.git
cd MessKhata-Mess-Meal-Manager| Windows | Linux / macOS |
|---|---|
double-click run.bat |
./run.sh |
No Git? Click Code > Download ZIP on GitHub and unzip it.
NetBeans (recommended): File > Open Project, choose the folder (Maven icon), then Run (F6).
The first build needs internet once so Maven can download its plugins.
IntelliJ IDEA: File > Open → pom.xml → Open as Project, then run com.messkhata.Main.
Maven:
mvn package
java -jar target/MessKhata-1.0.jarJDK only (manual):
javac -encoding UTF-8 -d out $(find src/main/java -name "*.java")
java -cp out com.messkhata.Mainjavac -encoding UTF-8 -d out (Get-ChildItem -Recurse -Filter *.java src\main\java).FullName
java -cp out com.messkhata.MainReady-made jar: every push builds MessKhata-1.0.jar — download it from the latest
Build run under Artifacts.
| Username | Password |
|---|---|
admin |
1234 |
On the first run the app creates a mess_data/ folder with one month of sample data
(5 members with meals, bazar, bills and deposits) so every screen has something to show.
Delete that folder to start with an empty mess.
- Start of month — add new members, record everyone's advance in Deposits.
- Every day — fill the Meal chart (use fill all and fix the few who skipped).
- After each bazar — add it in Bazar & bills; tick paid from own pocket if a member paid.
- When a bill comes — add cook, gas, Wi-Fi as a shared bill.
- Month end — open Monthly report, export the
.txtand share it in the mess group.
Meal rate = total bazar / total meals
Meal cost = member's meals x meal rate
Shared bill each = total shared bills / members sharing that month
Balance = deposit - (meal cost + shared bill each)
Balance > 0 -> the member will get money back
Balance < 0 -> the member has to pay
Bazar Tk 1,000, 10 meals → meal rate Tk 100. A gas bill of Tk 600 is shared by 2 members.
| Member | Meals | Meal cost | Shared | Deposit | Balance |
|---|---|---|---|---|---|
| Rahim | 4 | 400 | 300 | 1,000 | +300 (gets back) |
| Karim | 6 | 600 | 300 | 500 | −400 (has to pay) |
This exact case is checked automatically in the tests.
src/main/java/com/messkhata
├── Main.java starts the app
├── model/ data classes (Person, Member, Manager, Transaction, Deposit, Expense, ...)
├── data/FileDatabase.java backend storage: one text file per table
├── service/
│ ├── MessService.java rules, validation and calculations
│ ├── MessException.java readable error messages
│ └── SampleData.java demo data for the first run
└── ui/
├── theme/Theme.java colours, fonts, table styling
├── components/ custom-painted widgets: cards, buttons, sidebar, chart, logo
├── LoginFrame.java
├── MainFrame.java sidebar, month switcher, page switching
└── panels/ one class per page, all extend BasePanel
src/test/java/.../MessServiceTest.java calculation tests
run.bat / run.sh build and start with only the JDK
flowchart LR
UI[Swing UI<br/>LoginFrame · MainFrame · panels] --> S[MessService<br/>rules & calculations]
S --> DB[FileDatabase]
DB --> F[(mess_data/*.txt)]
S --> M[Model classes]
The UI only talks to MessService, MessService applies the rules and does the maths, and FileDatabase reads and writes the files.
| Concept | Where to find it |
|---|---|
| Encapsulation | Private fields with getters and setters in every model class |
| Inheritance | Member, Manager extend Person; Deposit, Expense extend Transaction; every page extends BasePanel |
| Abstraction | Person, Transaction and BasePanel are abstract classes |
| Interface | Storable, implemented by every class that is saved to a file |
| Polymorphism | Recent activity calls getType(), getDescription(), isIncome() on a List<Transaction> |
| Exception handling | MessException for rule violations, IOException for file problems |
| Enum and collections | ExpenseCategory; ArrayList, HashMap, LinkedHashMap |
Everything is stored in mess_data/ as plain text, one record per line, fields separated by |:
| File | Contents |
|---|---|
members.txt |
id, name, phone, room, join date, active |
managers.txt |
login accounts |
deposits.txt |
id, date, member, amount, note |
expenses.txt |
id, date, paid by, category, amount, details |
meals_YYYY-MM.txt |
one line per member with the meals of each day |
report_YYYY-MM.txt |
created when a report is exported |
Backup: copy the mess_data/ folder.
MessServiceTest checks the meal rate, shared bills, balances, "paid from own pocket", input validation and
login — without any test library. GitHub Actions runs it on every push.
javac -encoding UTF-8 -d test-out $(find src/main/java src/test/java -name "*.java")
java -cp test-out com.messkhata.service.MessServiceTestjavac is not recognized — install a JDK (not only a JRE) and add its bin folder to PATH.
I want to start fresh — close the app and delete the mess_data/ folder.
Can two managers use it? — not yet; one admin account for now (see roadmap).
Where is my exported report? — in mess_data/report_YYYY-MM.txt; the app also shows the full path.
- Meal chart, bazar & bills, deposits, monthly report
- Calculation tests and CI build
- Change password and multiple manager accounts
- MySQL / SQLite storage option
- Export the report as PDF
- Bangla language option
Ideas and pull requests are welcome — see CONTRIBUTING.md and the changelog.
Released under the MIT License.
Md Feroz Ahmed — CSE, Pundra University of Science & Technology · GitHub






