Skip to content

thorungb/Cozy-Bakery

Repository files navigation

Cozy-Bakery

A bakery is an establishment that produces and sells flour-based food baked in an oven such as bread, cookies, cakes, donuts, pastries, and pies. Some retail bakeries are also categorized as cafés, serving coffee and tea to customers who wish to consume the baked goods on the premises. Confectionery items are also made in most bakeries throughout the world. credit: Google

🍰 Overview and features

This program is used for managing systems within the bakery. The main program will ask you if you are an admin or a customer.

🥨 Admin Part

You will become an admin when your username and password match the information contained in the database. If you are Admin, You can

  • Check the stock : for seeing all details of each menu including the menu name, quantity, price and status.
  • Update some detail of the menu : for changing some detail of each menu except the menu name and will change the status automatically when the quantity is 0.
  • See sales report : for seeing the date and time, menu name, quantity, total price and payment method that this menu was sold.

🥨 Customer Part

If you are Customer, You can

  • Search menu : for searching menus from keywords
  • See all menu : for showing all menus in this bakery to customer
  • See the menu recommend : for showing only the recommended menu to customer
  • See your cart : for showing the menu and quantity that is added to the cart
  • Add menu to your cart : for adding the menu into the cart as a cart’s list
  • Remove menu from your cart : for removing the menu from the cart
  • Clear your cart : for clearing all items from the cart
  • Pay the bill : for showing the customer a bill and letting the customer choose a payment method.

🍰 Required libraries and tools

There are 3 Python modules are also used in this program.

  • json : which is used for data menu.
  • csv : which is used for data admin and data sales summary.
  • datetime : which is used for data sales summary to record the time.

Using Python version 3.10.8

🍰 Program design

Here is UML class diagram of the program.

Untitled Diagram drawio

There are 5 classes in this project.

  • MenuDB : this class is used to read a json file and initialize the details of each menu which consist of name, price, quantity, recommend, and status.
  • Menu : this class is for adding a new menu or deleting an existing one.
  • Admin : this class is for the admin and admin can access and change the details of the menu, and can see the sales report
  • Customer : this class is for customers and customer can choose to see all the products in the bakery, including the ability to buy or cancel the order.
  • Bakery : this class includes all the previous classes. It is used for running the program, inputting and printing out to the user.

🍰 Code structure

This program consists of 5 python files, 2 csv files and 1 json file.

Python Files

  • menuDB.py which contains the MenuDB class
  • menu.py which contains the Menu class
  • admin.py which contains the Admin class
  • customer.py which contains the Customer class
  • bakery.py which contains the Bakery class

CSV Files

  • data_admin.csv which contains all the admins' usernames and passwords
  • data_sales_summary.csv which contains the details of product sales

JSON File

  • data_menu.json which contains all the menu names and their details.

Thanks for your attention

About

Computer Programming 1/2022 project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages