Skip to content

๐Ÿฝ๏ธ This repository ๐Œ๐ž๐ญ๐š ๐๐š๐œ๐ค-๐„๐ง๐ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ž๐ซ ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž in ๐‡๐ž๐ฒ๐š ๐“๐ž๐œ๐ก ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ contains the implementation of a Food Ordering System built using Python and object-oriented programming principles. It features robust user, meal, and bill management, along with authentication using hashed passwords.

Notifications You must be signed in to change notification settings

shahlaa1212/Food_Ordering_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python GitHub CSV Handling OOP Authentication

๐Ÿ” Food Ordering System Implementation

Project Overview

You are tasked with implementing a food ordering system using object-oriented programming principles. The system will manage users, meals, and bills, and include authentication functionality. The project is structured into several key components, and your objective is to develop and integrate these components according to the provided file structure.

File Structure and Descriptions

  1. services Folder

    • bill_service.py: Contains the BillService class responsible for managing bill-related operations. Implement methods for listing all bills, adding a new bill, removing an existing bill, and updating a bill.
    • user_service.py: Contains the UserService class responsible for managing user-related operations. Implement methods for listing all users, adding a new user, removing an existing user, and updating user information.
    • meal_service.py: Contains the MealService class responsible for managing meal-related operations. Implement methods for listing all meals, adding a new meal, removing an existing meal, and updating meal information.
    • auth_service.py: Contains the AuthService class responsible for handling authentication operations such as signing in, signing out, and hashing passwords.
  2. database Folder

    • bills.txt: A text file containing bill data in CSV format. Each record has a UUID as its ID.
    • users.txt: A text file containing user data in CSV format. Each record has a UUID as its ID.
    • meals.txt: A text file containing meal data in CSV format. Each record has a UUID as its ID.
  3. utilities Folder

    • base_service.py: Contains the BaseService abstract class, which provides a common interface for all services. This class will define abstract methods that must be implemented by concrete service classes.
    • utils.py: Contains utility functions such as verify_password, hash_password, and generate_id.
    • data_utils.py: Contains functions for data management, including save_data and load_data, which handle reading from and writing to the CSV files in the database folder.
  4. models Folder

    • bill.py: Contains the Bill class with attributes for bill information. This class will define the structure of a bill object.
    • user.py: Contains the User class with attributes for user information. This class will define the structure of a user object.
    • meal.py: Contains the Meal class with attributes for meal information. This class will define the structure of a meal object.
  5. main.py: The entry point of the application. This file will handle user interactions, display choices based on user roles, and invoke methods from the service classes to perform operations.

Folder Structure:

food_ordering_system/
โ”‚
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ bill.py
โ”‚   โ”œโ”€โ”€ user.py
โ”‚   โ””โ”€โ”€ meal.py
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ bill_service.py
โ”‚   โ”œโ”€โ”€ user_service.py
โ”‚   โ”œโ”€โ”€ meal_service.py
โ”‚   โ””โ”€โ”€ auth_service.py
โ”œโ”€โ”€ utilities/
โ”‚   โ”œโ”€โ”€ base_service.py
โ”‚   โ”œโ”€โ”€ utils.py
โ”‚   โ””โ”€โ”€ data_utils.py
โ””โ”€โ”€ database/
    โ”œโ”€โ”€ bills.json
    โ”œโ”€โ”€ users.json
    โ””โ”€โ”€ meals.json

Task Requirements

  1. Implement Service Methods:

    • List All: Implement a method to list all records (bills, users, meals) in each corresponding service class.
    • Add: Implement a method to add a new record to each corresponding service class.
    • Remove: Implement a method to remove an existing record from each corresponding service class.
    • Update: Implement a method to update an existing record in each corresponding service class.
  2. Implement Data Utilities:

    • load_data: Implement the function to read data from text files in the database folder and return a list of dictionaries.
    • save_data: Implement the function to write data to text files in the database folder from a list of dictionaries.
  3. Implement Authentication Methods:

    • signin: Implement the method for signing in a user, including password validation and session management.
    • signup: Implement the method for signing up a new user, including password hashing and default role assignment.
    • signout: Implement the method for signing out a user and handling session invalidation.
    • Note: You can use the implementation from the previous task as a reference for these methods.

Hints

  • Data Files: You can use different file formats for data storage such as CSV or JSON. Choose the format that best fits your implementation and is easiest to handle with the load_data and save_data functions.
  • Handling Data: Feel free to edit and adjust the code as necessary to meet the requirements. Ensure that your implementations for data reading and writing are robust and handle errors gracefully.
  • UUIDs: Ensure that each record in your data files has a unique UUID as its ID. You can use the Python uuid module to generate these IDs.

Deadline

  • One week from today: All tasks should be completed by August 30, 2024 12:00 AM.

Bonus

  • Create a testing folder.
  • Implement unit tests for each service class to ensure that all methods work correctly.
  • Include tests for edge cases and invalid inputs.

Submission

  • Please submit your completed project by sending the entire project folder to the assistant. Ensure that all files are included and that the project runs without errors. You can submit your task through the designated submission platform or method as instructed.

Feel free to reach out if you have any questions or need further clarifications. Good luck!

About

๐Ÿฝ๏ธ This repository ๐Œ๐ž๐ญ๐š ๐๐š๐œ๐ค-๐„๐ง๐ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ž๐ซ ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž in ๐‡๐ž๐ฒ๐š ๐“๐ž๐œ๐ก ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ contains the implementation of a Food Ordering System built using Python and object-oriented programming principles. It features robust user, meal, and bill management, along with authentication using hashed passwords.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages