Coder Social home page Coder Social logo

abdelrhmanreda17 / orders-and-notifications-management Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 248 KB

This repository contains the source code for an order and notifications management system implemented in Java. The system is designed to efficiently handle orders, users, products, and notifications, providing a comprehensive solution for managing an e-commerce platform.

License: MIT License

Java 100.00%
notification-api order-api order-management product-api spring-boot spring-mvc user-api

orders-and-notifications-management's Introduction

Orders and Notifications Management

This repository contains the backend logic for managing orders and notifications. The system is developed using Spring Boot and implements various design patterns for flexibility, extensibility, and efficient order processing.

Features

  • Order Management:

    • Supports simple and compound orders.
    • Validates product availability, user funds, and order consistency.
    • Processes order placement, cancellation, and shipment.
  • Notification Management:

    • Generates notifications for different order states.
    • Associates notifications with user accounts.

Patterns

  • Command Pattern:
    • The system adopts the Command pattern to enhance flexibility and extensibility in order processing. This allows for easy addition of new functionalities without modifying existing code.
  • Composite Pattern:
    • The system adopts the Composite pattern. This allows us to handle compound orders. These orders can encapsulate multiple individual orders and are managed cohesively.
  • Strategy Pattern:
    • Utilized in various packages for different strategies, enhancing the modularity of the code.
  • Factory Pattern:
    • Employed in multiple packages, the Factory pattern provides a flexible way to create objects based on different conditions, promoting a clean and maintainable codebase.

API Structure

The project is organized into several APIs, each with its own set of responsibilities:

  • Orders API: This API manages all operations related to orders.

    • Model: Contains data models related to orders, including IOrder, SimpleOrder, CompoundOrder, OrderState, and ShoppingCartItem.
    • Controller: Contains the OrderController class which handles HTTP requests related to orders.
    • Service: Contains the OrderService class which contains the business logic for managing orders.
    • Repository: Contains the OrderRepository class which interacts with the database.
  • Products API: This API manages all operations related to products.

    • Model: Contains the Product class which represents a product in the system.
    • Controller: Contains the ProductController class which handles HTTP requests related to products.
    • Service: Contains the ProductService class which contains the business logic for managing products.
    • Repository: Contains the ProductRepository class which interacts with the database.
  • Users API: This API manages all operations related to users.

    • Model: Contains classes like User, UserCredentials, and IPayment which represent the users and their payment methods in the system.
    • Controller: Contains the UserController class which handles HTTP requests related to users.
    • Service: Contains the UserService class which contains the business logic for managing users.
    • Repository: Contains the UserRepository class which interacts with the database.
  • Notifications API: This API manages all operations related to notifications.

    • Model: Contains classes like Notification and NotificationFactory which represent the notifications in the system.
    • Controller: Contains the NotificationsController class which handles HTTP requests related to notifications.
    • Service: Contains the NotificationsService class which contains the business logic for managing notifications.
    • Repository: Contains the NotificationsRepository class which interacts with the database.

Each of these APIs works together to provide a comprehensive solution for managing orders, products, users, and notifications in the system.

Project Structure

The project is organized into several packages, each with its own set of responsibilities:

  • Application: This is the main package that contains the application's entry point.

    • Application.java: This is the main class that starts the Spring Boot application.
  • Application.Managers: This package contains various managers that handle different functionalities of the application.

    • ApplicationManager.java: This class manages the main operations of the application.
    • OrderManager: This package contains classes that manage order operations.
      • OrderManager.java: This is an abstract class that defines the operations related to orders.
      • SimpleOrderManager.java: This class extends OrderManager and implements the operations for simple orders.
      • CompoundOrderManager.java: This class extends OrderManager and implements the operations for compound orders.
    • ProductManager: This package contains the ProductManager.java class that manages product operations.
    • UserManager: This package contains the UserManager.java class that manages user operations.
    • NotificationManager: This package contains the NotificationManager.java class that manages notifications.
  • Application.Utilities: This package contains several utility classes and packages that provide various functionalities used across the application.

    • Database: This package contains classes related to database operations.
      • DataRepository.java: This class provides basic CRUD operations.
      • DatabaseFactory.java: This class is used for creating and managing repositories.
    • Deserializers: This package contains classes for deserializing JSON data.
      • IOrderDeserializer.java: This is an abstract class that defines the operations for deserializing order data.
      • OrderDeserializer.java: This class extends IOrderDeserializer and implements the operations for deserializing order data.
      • SimpleOrderDeserializer.java: This class extends IOrderDeserializer and implements the operations for deserializing simple order data.
      • CompoundOrderDeserializer.java: This class extends IOrderDeserializer and implements the operations for deserializing compound order data.
    • Serializers: This package contains the ShoppingCartItemSerializer.java class which is used for serializing shopping cart item data.
    • Template: This package contains classes for creating templates.
      • ITemplate.java: This interface defines the structure of a template.
      • TemplateFactory.java: This class is used for creating templates.
      • EmailTemplate: This package contains specific implementations of templates for emails.
        • EmailTemplate.java: This is an abstract class that defines the operations for email templates.
        • EmailTemplateFactory.java: This class is used for creating email templates.
        • Languages: This package contains classes for different language templates.
          • EmailTemplateEN.java: This class extends EmailTemplate and implements the operations for English email templates.
          • EmailTemplateAR.java: This class extends EmailTemplate and implements the operations for Arabic email templates.
      • PhoneTemplate: This package contains specific implementations of templates for phone messages.
        • PhoneTemplate.java: This is an abstract class that defines the operations for phone templates.
        • PhoneTemplateFactory.java: This class is used for creating phone templates.
        • Languages: This package contains classes for different language templates.
          • PhoneTemplateEN.java: This class extends PhoneTemplate and implements the operations for English phone templates.
          • PhoneTemplateAR.java: This class extends PhoneTemplate and implements the operations for Arabic phone templates.

How to Run

  1. Clone the repository to your local machine using git clone https://github.com/AbdelrhmanReda17/Orders-and-Notifications-Management/.
  2. Navigate to the project directory using cd Orders-and-Notifications-Managementm.
  3. Run the application by executing the Application class.

License

This project is licensed under the MIT License.

orders-and-notifications-management's People

Contributors

abdelrhmanreda17 avatar yassintarekhelmy avatar kariem7777 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.