# joseavr/apptracker architecture

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

- Interactive diagram: https://gitdiagram.com/joseavr/apptracker
- Repository: https://github.com/joseavr/apptracker

## Overview

##### Project type and purpose
- This is a full-stack web application (“AppTracker”) that automates checking the status of internship applications and notifies users via SMS.
- Built on Node.js/Express.js with an EJS‐templated front end, MongoDB persistence, Puppeteer for web scraping, and Twilio for SMS.

##### File structure
- Top-level web server: app.js, package.json, nodemon.json
- MVC pattern:
– Models in database/ (Event.js, Table.js, User.js, db.js)
– Views in views/ (EJS templates + partials)
– Controllers (routeControllers/) and routes (routes/)
- Middlewares in middlewares/ (formValidation, loginValidation)
- Static assets in public/ (css, js, images)
- Deployment config: .gitignore, guide.md

##### README for additional insights
- Indicates use of Puppeteer to scrape application status pages
- Uses Twilio API for SMS alerts
- MongoDB as primary datastore, ExpressJS server, Bootstrap & vanilla JS on front end

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend"
        Browser["User Browser (HTML/CSS/JS)"]:::client
        Static["Static Assets"]:::client
        Templates["EJS Templates"]:::client
    end

    subgraph "Backend"
        Server["Express Server"]:::backend

        subgraph "Routes"
            AuthRoute["auth.js"]:::routes
            HomeRoute["home.js"]:::routes
            UserRoute["user.js"]:::routes
        end

        subgraph "Controllers"
            AuthCtrl["authController.js"]:::controllers
            UserCtrl["userController.js"]:::controllers
        end

        subgraph "Middlewares"
            FormVal["formValidation.js"]:::middleware
            LoginVal["loginValidation.js"]:::middleware
        end

        subgraph "Scheduled Jobs & Services"
            Puppeteer["Puppeteer Service"]:::external
        end
    end

    subgraph "Database"
        DBConn["db.js"]:::db
        UserModel["User.js"]:::db
        EventModel["Event.js"]:::db
        TableModel["Table.js"]:::db
    end

    subgraph "External Services"
        Twilio["Twilio SMS API"]:::external
    end

    subgraph "Config & Deployment"
        Readme["README.md"]:::config
        Guide["guide.md"]:::config
        Nodemon["nodemon.json"]:::config
        Package["package.json"]:::config
        Gitignore[".gitignore"]:::config
    end

    Browser -->|HTTP Request| Server
    Server --> AuthRoute
    Server --> HomeRoute
    Server --> UserRoute

    AuthRoute -->|validate| FormVal
    AuthRoute -->|validate| LoginVal
    AuthRoute -->|invoke| AuthCtrl

    HomeRoute -->|invoke| AuthCtrl
    UserRoute -->|invoke| UserCtrl

    AuthCtrl -->|CRUD| DBConn
    AuthCtrl -->|read/write| UserModel
    AuthCtrl -->|read/write| EventModel
    AuthCtrl -->|read/write| TableModel

    UserCtrl -->|CRUD| DBConn
    UserCtrl -->|read/write| UserModel
    UserCtrl -->|read/write| EventModel
    UserCtrl -->|read/write| TableModel

    UserCtrl -->|trigger scrape| Puppeteer
    Puppeteer -->|result| UserCtrl

    AuthCtrl -->|send SMS| Twilio
    UserCtrl -->|send SMS| Twilio

    classDef client fill:#fdd835,stroke:#333,stroke-width:1px
    classDef backend fill:#42a5f5,stroke:#333,stroke-width:1px
    classDef routes fill:#64b5f6,stroke:#333,stroke-width:1px
    classDef controllers fill:#1976d2,stroke:#333,stroke-width:1px
    classDef middleware fill:#ffb74d,stroke:#333,stroke-width:1px
    classDef external fill:#66bb6a,stroke:#333,stroke-width:1px
    classDef db fill:#ffee58,stroke:#333,stroke-width:1px
    classDef config fill:#9e9e9e,stroke:#333,stroke-width:1px

    click Static "https://github.com/joseavr/apptracker/tree/main/public/"
    click Templates "https://github.com/joseavr/apptracker/tree/main/views/"
    click Server "https://github.com/joseavr/apptracker/blob/main/app.js"
    click AuthRoute "https://github.com/joseavr/apptracker/blob/main/routes/auth.js"
    click HomeRoute "https://github.com/joseavr/apptracker/blob/main/routes/home.js"
    click UserRoute "https://github.com/joseavr/apptracker/blob/main/routes/user.js"
    click AuthCtrl "https://github.com/joseavr/apptracker/blob/main/routeControllers/authController.js"
    click UserCtrl "https://github.com/joseavr/apptracker/blob/main/routeControllers/userController.js"
    click FormVal "https://github.com/joseavr/apptracker/blob/main/middlewares/formValidation.js"
    click LoginVal "https://github.com/joseavr/apptracker/blob/main/middlewares/loginValidation.js"
    click DBConn "https://github.com/joseavr/apptracker/blob/main/database/db.js"
    click UserModel "https://github.com/joseavr/apptracker/blob/main/database/User.js"
    click EventModel "https://github.com/joseavr/apptracker/blob/main/database/Event.js"
    click TableModel "https://github.com/joseavr/apptracker/blob/main/database/Table.js"
    click Readme "https://github.com/joseavr/apptracker/blob/main/README.md"
    click Guide "https://github.com/joseavr/apptracker/blob/main/guide.md"
    click Nodemon "https://github.com/joseavr/apptracker/blob/main/nodemon.json"
    click Package "https://github.com/joseavr/apptracker/blob/main/package.json"
    click Gitignore "https://github.com/joseavr/apptracker/blob/main/.gitignore"
```
