Skip to content

About

Java Swing desktop app for student messes: daily meal chart, bazar & shared bills, deposits and automatic month-end settlement. OOP project built with NetBeans.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

MessKhata: Mess Meal Manager

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.

Build Java GUI IDE Storage License

Dashboard

Contents

Why · Features · Screenshots · Quick start · Run options · A month in MessKhata · Calculations · Structure · OOP · Data files · Tests · FAQ · Roadmap

Why this project

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.

Features

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.

Screenshots

Meal chart Monthly report
Meal chart Monthly report
Bazar & bills Deposits
Bazar and bills Deposits
Login Members
Login Members

Quick start

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.

Run options

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.jar

JDK only (manual):

javac -encoding UTF-8 -d out $(find src/main/java -name "*.java")
java -cp out com.messkhata.Main
javac -encoding UTF-8 -d out (Get-ChildItem -Recurse -Filter *.java src\main\java).FullName
java -cp out com.messkhata.Main

Ready-made jar: every push builds MessKhata-1.0.jar — download it from the latest Build run under Artifacts.

Sign in

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.

A month in MessKhata

  1. Start of month — add new members, record everyone's advance in Deposits.
  2. Every day — fill the Meal chart (use fill all and fix the few who skipped).
  3. After each bazar — add it in Bazar & bills; tick paid from own pocket if a member paid.
  4. When a bill comes — add cook, gas, Wi-Fi as a shared bill.
  5. Month end — open Monthly report, export the .txt and share it in the mess group.

How the money is calculated

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

Example

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.

Project structure

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

Architecture

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]
Loading

The UI only talks to MessService, MessService applies the rules and does the maths, and FileDatabase reads and writes the files.

OOP concepts used

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

Data files

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.

Tests

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.MessServiceTest

FAQ

javac 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.

Roadmap

  • 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

Contributing

Ideas and pull requests are welcome — see CONTRIBUTING.md and the changelog.

License

Released under the MIT License.

Author

Md Feroz Ahmed — CSE, Pundra University of Science & Technology · GitHub

About

Java Swing desktop app for student messes: daily meal chart, bazar & shared bills, deposits and automatic month-end settlement. OOP project built with NetBeans.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages