# mahakpatel/online-salon-management architecture

> Architecture diagram of the GitHub repository mahakpatel/online-salon-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahakpatel/online-salon-management
- Repository: https://github.com/mahakpatel/online-salon-management

## Overview

##### Project type and purpose
- This is a monolithic, full-stack Django web application called “Online Salon Management System.”
- It consists of several Django “apps” (home, staff, appointment, services, etc.), a SQLite database, static assets (CSS/JS/fonts/images), server-side templates, and a Paytm payment integration.

##### File structure
- Top-level Django project: m_salon/m_salon (settings.py, urls.py, wsgi.py) and manage.py.
- Seven feature apps under m_salon/: home, Staff, appoinment, services, contact, gallery, about, dashboard, plus payment utilities.
- A single-file default database (db.sqlite3).
- Static assets in m_salon/static, including CSS, JS, fonts, images, vendor code.
- Templates under m_salon/templates for server-rendered HTML.
- URL routing files (urls.py) and view modules in each app.
- Migrations for every app, indicating persistent data models.

##### README
- Confirms Django  installation and use of a virtual environment.
- Mentions merchant ID/Key needed for payments.

##### Main components & interactions
a. Presentation layer
- Client browser (HTML/CSS/JS)
- Static assets served via Django’s staticfiles (or via NGINX in production)
- Templates rendered by Django views
b. Application layer (Django)
- URL dispatcher (m_salon/urls.py)
- Feature apps: home, Staff, appointment, services, contact, gallery, about, dashboard
- Payment module (Checksum.py) integrating with Paytm API
c. Data layer
- SQLite database with data models in each app
- Django ORM for CRUD operations
d. External services
- Paytm payment gateway

Interactions:
1. Client HTTP request → (NGINX/WSGI) → Django URL router
2. Routed to app’s view → business logic → ORM → SQLite
3. ORM returns data → view renders template → HTTP response
4. For payments: view calls Checksum module → Paytm API → callback handled by Django view → update DB → render status page

##### Architectural patterns & design principles
- MVC (Model-View-Template)
- Single monolithic codebase but modularized into feature apps
- Separation of concerns: each Django app owns its models, views, URLs, templates
- Static vs dynamic content separation
- External integration via a dedicated payment component

##### Diagramming conventions
- Presentation (blue)
- Application logic (green)
- Data storage (orange)
- External services (red)
- Rectangles for components

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    User["User Browser"]:::presentation
    WebServer["Web Server<br/>(NGINX/Gunicorn or Django dev server)"]:::presentation

    User -->|HTTP Request| WebServer

    %% Application Layer
    subgraph "Django Application" 
        direction TB
        UrlDispatcher["URL Dispatcher"]:::application
        subgraph "Feature Apps"
            direction TB
            HomeApp["Home App"]:::application
            StaffApp["Staff App"]:::application
            AppointmentApp["Appointment App"]:::application
            ServicesApp["Services App"]:::application
            ContactApp["Contact App"]:::application
            GalleryApp["Gallery App"]:::application
            AboutApp["About App"]:::application
            DashboardApp["Dashboard App"]:::application
        end
        PaymentModule["Payment Module"]:::application
    end

    WebServer --> UrlDispatcher
    UrlDispatcher -->|routes to| HomeApp
    UrlDispatcher -->|routes to| StaffApp
    UrlDispatcher -->|routes to| AppointmentApp
    UrlDispatcher -->|routes to| ServicesApp
    UrlDispatcher -->|routes to| ContactApp
    UrlDispatcher -->|routes to| GalleryApp
    UrlDispatcher -->|routes to| AboutApp
    UrlDispatcher -->|routes to| DashboardApp
    UrlDispatcher -->|routes to| PaymentModule

    %% Data Layer
    DB["SQLite Database"]:::data

    HomeApp -->|ORM Query| DB
    StaffApp -->|ORM Query| DB
    AppointmentApp -->|ORM Query| DB
    ServicesApp -->|ORM Query| DB
    ContactApp -->|ORM Query| DB
    GalleryApp -->|ORM Query| DB
    AboutApp -->|ORM Query| DB
    DashboardApp -->|ORM Query| DB
    PaymentModule -->|DB Update| DB

    DB -->|Data| HomeApp
    DB -->|Data| StaffApp
    DB -->|Data| AppointmentApp
    DB -->|Data| ServicesApp
    DB -->|Data| ContactApp
    DB -->|Data| GalleryApp
    DB -->|Data| AboutApp
    DB -->|Data| DashboardApp
    DB -->|Data| PaymentModule

    %% Templates & Static Assets
    Templates["Templates<br/>(Server-rendered HTML)"]:::presentation
    StaticAssets["Static Assets<br/>(CSS/JS/Fonts/Images)"]:::presentation

    HomeApp -->|renders| Templates
    StaffApp -->|renders| Templates
    AppointmentApp -->|renders| Templates
    ServicesApp -->|renders| Templates
    ContactApp -->|renders| Templates
    GalleryApp -->|renders| Templates
    AboutApp -->|renders| Templates
    DashboardApp -->|renders| Templates
    PaymentModule -->|renders| Templates

    Templates -->|HTTP Response| WebServer
    WebServer -->|Serves Static| User
    WebServer -->|Serves HTML| User

    %% External Service
    PaytmAPI["Paytm Payment Gateway"]:::external

    PaymentModule -->|Checksum Request| PaytmAPI
    PaytmAPI -->|Callback| PaymentModule

    %% Click Events
    click UrlDispatcher "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/m_salon/urls.py"
    click HomeApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/home/"
    click StaffApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/Staff/"
    click AppointmentApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/appoinment/"
    click ServicesApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/services/"
    click ContactApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/contact/"
    click GalleryApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/gallery/"
    click AboutApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/about/"
    click DashboardApp "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/dashboard/"
    click PaymentModule "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/payment/Checksum.py"
    click DB "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/db.sqlite3"
    click StaticAssets "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/static/"
    click Templates "https://github.com/mahakpatel/online-salon-management/tree/master/m_salon/templates/"
    click Settings "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/m_salon/settings.py"
    click WSGIEntry "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/m_salon/wsgi.py"
    click Manage "https://github.com/mahakpatel/online-salon-management/blob/master/m_salon/manage.py"

    %% Styles
    classDef presentation fill:#add8e6,stroke:#333,stroke-width:1px
    classDef application fill:#90ee90,stroke:#333,stroke-width:1px
    classDef data fill:#ffcc80,stroke:#333,stroke-width:1px
    classDef external fill:#ff9999,stroke:#333,stroke-width:1px
```
