mohit / food delivery system
Food Delivery System
A layered Java ordering app.

You place an order and then wait. Is it pending? Confirmed? Is the kitchen on it, or is it on its way? Behind every delivery app, a set of rules decides what happens to an order at each stage, and most people never see them.
I built this to learn how the pieces of a real ordering system fit together: JDBC, threads, file I/O and a layered design.
Customers and restaurants register and log in through separate flows. A customer places an order, and a background thread carries it through the delivery stages while the database updates at each step. Restaurant owners can generate a sales report whenever they want one.
Think of it as the back end of a delivery app, with a console where the screens would be.
What you can do
- Register as a customer or a restaurant, with validation and a check for duplicate emails.
- Manage restaurants and their menus.
- Place an order and watch it move from pending to confirmed, preparing and delivered.
- Generate a timestamped sales report as a text file, with every order and the total revenue.
- Start from nothing. The database and all six tables are created on first run.
How it's organised
The code splits into layers: a console interface, a service layer for business logic, models for the domain entities, a utility layer for database access and reports, and a thread layer for order processing. Each layer has one job, so you can change one without touching the others.
What it protects
Orders are saved inside a transaction, so a failed order rolls back and a half-saved order never reaches the database. Queries use prepared statements. Database credentials live in a local .env file that stays out of version control.
It runs in the console, and the delivery stages are simulated. There are no payments and no real drivers.
Built with Java 17, MySQL, JDBC and Maven, using inheritance, abstraction and encapsulation throughout.