# raaviian/pharmacyapp architecture

> Architecture diagram of the GitHub repository raaviian/pharmacyapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raaviian/pharmacyapp
- Repository: https://github.com/raaviian/pharmacyapp

## Overview

##### Project type and purpose
- From the file tree and README, this is a Node.js full-stack web application named “pharmacyApp.”
- It follows an MVC pattern: Express.js server (app.js), Handlebars view templates (views/), and Mongoose-style models (models/).
- Core features implied by filenames: user registration, login, password reset, and a “welcome” page.

##### File structure
- Top-level files:
- app.js – the main Express.js application entry point
- db.js – database connection and configuration
- package.json / package-lock.json – dependency definitions
- Directories:
- models/ – userModel.js defines the User schema and data-access methods
- views/ – Handlebars templates for each user flow (login, register, forgot/reset password, welcome)
- views/layouts/ – main.handlebars defines the page layout wrapper
- No explicit “controllers/” folder: routing and controller logic likely mixed in app.js.
- No tests or separate API folder, so the server and view rendering are tightly coupled.

##### README for additional insights
- README.md only contains the project title (# pharmacyApp).
- No further architecture or dependency notes, so we rely on file names and conventions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser((Browser)):::client

    subgraph Server
        Router["Routing / Controllers"]:::server
        Template["Handlebars Templating Engine"]:::server
        Model["Data Access / Models"]:::server
        subgraph "Views (Handlebars Templates)"
            direction TB
            Vlogin["login.handlebars"]:::view
            Vregister["register.handlebars"]:::view
            Vforgot["forgot-password.handlebars"]:::view
            Vreset["reset-password.handlebars"]:::view
            Vwelcome["welcome.handlebars"]:::view
            Vlayout["layouts/main.handlebars"]:::view
        end
    end

    DB[(Database)]:::db
    EmailService((Email Service)):::external
    Manifest["package.json"]:::config

    Browser -->|"HTTP requests (GET/POST)"| Router
    Router -->|"renders views"| Template
    Template --> Vlogin
    Template --> Vregister
    Template --> Vforgot
    Template --> Vreset
    Template --> Vwelcome
    Template --> Vlayout
    Template -->|"HTML responses"| Browser
    Router -->|"calls model methods"| Model
    Model -->|"CRUD via db.js"| DB
    Router -->|"send reset email"| EmailService

    click Router "https://github.com/raaviian/pharmacyapp/blob/main/app.js"
    click DB "https://github.com/raaviian/pharmacyapp/blob/main/db.js"
    click Model "https://github.com/raaviian/pharmacyapp/blob/main/models/userModel.js"
    click Vlogin "https://github.com/raaviian/pharmacyapp/blob/main/views/login.handlebars"
    click Vregister "https://github.com/raaviian/pharmacyapp/blob/main/views/register.handlebars"
    click Vforgot "https://github.com/raaviian/pharmacyapp/blob/main/views/forgot-password.handlebars"
    click Vreset "https://github.com/raaviian/pharmacyapp/blob/main/views/reset-password.handlebars"
    click Vwelcome "https://github.com/raaviian/pharmacyapp/blob/main/views/welcome.handlebars"
    click Vlayout "https://github.com/raaviian/pharmacyapp/blob/main/views/layouts/main.handlebars"
    click Manifest "https://github.com/raaviian/pharmacyapp/blob/main/package.json"

    classDef client fill:#dddddd,stroke:#333,stroke-width:1px
    classDef server fill:#aaddff,stroke:#333,stroke-width:1px
    classDef db fill:#aaffaa,stroke:#333,stroke-width:1px
    classDef external fill:#ffddaa,stroke:#333,stroke-width:1px
    classDef view fill:#ddccff,stroke:#333,stroke-width:1px
    classDef config fill:#ffeb99,stroke:#333,stroke-width:1px
```
