# Application Architecture

The various Django apps created are:

- ``order``, to manage everything around the orders
- ``accounts``, to manage account creation. For logging in, logging out, and changing passwords, we use Django’s
  built-in auth application.
- ``mail``, for sending emails.

As of today, the class diagram is as follows:

```mermaid
classDiagram
    GroupedOrder "item_set" <-- Item
    GroupedOrder "order_set" <-- Order
    Order "ordered_items" <-- OrderedItem
    Item "orders" <-- OrderedItem
    OrderAuthor "author" <-- Order
    CustomUser "grouped_orders" <-- GroupedOrder

    class GroupedOrder{
      name
      deadline : DateTime
      delivery_date : Date
      place
      description
      orga : CustomUser
      total_price
    }
    class Item{
      name
      grouped_order : GroupedOrder
      ordered_nb
      total_price
      max_limit
    }
    class Order{
        grouped_order : GroupedOrder
        author : OrderAuthor
        price
        created_date
        note
    }
    class OrderedItem{
        order : Order
        nb
        item : Item
    }
    class OrderAuthor {
        first_name
        last_name
        phone
        email
    }
    class CustomUser{
        first_name
        last_name
        email
    }
```
