A full fledged command line interface based restaurant billing system which persists the generated bills in a local MongoDB database
- This program be used in restaurants to calculate the bill of every table. Since I have used ArrayLists, the number of tables can be 10, 10000 or even more.
- Every table is an object of class Table stored in an ArrayList of objects. The menu items can be initialized by running RestaurantMenuSetup.java (which can be changed as per the restaurants needs) and the billing application can be run from the root directory.
- The generated bills are stored in a local MongoDB database (in the bills collection of restaurantDB database) to maintain a record of all past bills.
- Menu items are also stored in the MongoDB database and can be modified by either modifying the database directly or by modifying and rerunning RestaurantMenuSetup.java
-
Ensure that you have Java 18, Maven and MongoDB installed in your system. (If you are using an IDE like IntelliJ then a local installation of Maven is not required)
-
Clone the repository using
git clone https://github.com/pabloescoder/restaurant-billing-system.git
-
Navigate to the root folder of the project
cd restaurant-billing-system
-
Build the project using Maven (Note: If you are using an IDE like IntelliJ, you can skip this step)
mvn install
-
Start the local MongoDB server at port 27017
-
Navigate to src/main/java and run RestaurantMenuSetup.java to initialize the menu and save it to the local DB. You can also modify this file to add or remove menu items as per your requirement and re run the file to re-initialize the menu.
-
Navigate to src/main/java and run RestaurantBillingSystem.java to start the billing system. All generated bills are stored in the restaurantDB database in the bills collection of the local MongoDB database.
- Dynamic ArrayLists
- Classes & Objects
- Static Methods
- Exception Handling
- ArrayList of Objects
- MongoDB and Java connection
- String Formatting & more