# swetha-arul/trip-planner architecture

> Architecture diagram of the GitHub repository swetha-arul/trip-planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swetha-arul/trip-planner
- Repository: https://github.com/swetha-arul/trip-planner

## Overview

1. **Overall shape**
   Trip-Planner is a small web application split into a mostly static frontend and a lightweight PHP backend. The frontend is organized into separate HTML/CSS/JS feature areas rather than a single SPA, and the backend only appears to handle authentication-related requests.

2. **Public landing / marketing layer**
   `Mainpage/MainPage.html` and `Mainpage/MainPage.css` form the main entry page. This is likely the top-level presentation surface that introduces the product and links users into the functional parts of the app, such as login, signup, or map planning.

3. **Trip-planning and map subsystem**
   The `map/` folder contains the core travel workflow:
   - `map.html` as the map UI shell
   - `map.css` for layout and styling
   - `map.js` for behavior, routing, geolocation, and places search  
   This is the main interactive subsystem and is the place where route planning, live location tracking, and points-of-interest lookup happen.

4. **External mapping services boundary**
   The README and `config.sample.js` show that the frontend expects a Google Maps API key loaded from a local `config.js` file. That means the map subsystem talks directly from browser JavaScript to Google Maps-related APIs, rather than through the PHP backend. This is an important architectural boundary: map rendering and routing are client-side, API-key-backed integrations.

5. **Authentication subsystem**
   The `signuplogin/` folder contains the login and signup pages:
   - `login.html`
   - `signup.html`
   - `sigup_login.css`
   - `validation.js`  
   This indicates a separate auth UI area with shared styling and client-side input validation before requests are sent to the server.

6. **Backend authentication endpoints**
   The `Backend/` folder contains `login.php` and `signup.php`. These likely receive form submissions from the auth pages and perform server-side credential handling. From the repository structure, this backend is narrow in scope: it does not appear to power the mapping features, only account creation and sign-in.

7. **Client-side behavior and feature modules**
   The `darkmode/` folder is a separate UI behavior module:
   - `darkmode.js`
   - `darkmode.css`
   - `darkmodemap.js`  
   This suggests dark mode is implemented as a reusable visual/behavior layer that affects both general pages and the map experience. The separate `darkmodemap.js` implies the map page needs its own theme handling logic.

8. **Shared data and asset layer**
   The `pics/` folder contains at least one image asset (`abt.avif`), presumably used by the landing page or informational content. There is no evidence of a centralized asset pipeline; assets are referenced directly from the file system.

9. **Primary user flows**
   There are two main flows:
   - **Anonymous user flow:** landing page → signup/login → backend PHP auth endpoints
   - **Trip-planning flow:** authenticated or unauthenticated user enters the map experience → browser-side JS uses Google Maps APIs for routing, live position, and nearby places  
   The auth flow and map flow are largely separate concerns with minimal visible coupling.

10. **Technology and runtime boundaries**
   This is a browser-first application built with HTML/CSS/JavaScript, plus PHP for server-side form handling. The operational runtime is therefore split between:
   - client browser for UI, maps, validation, theme toggling
   - PHP-capable web server for login/signup handling
   - Google Maps services for geospatial data and directions

11. **Configuration model**
   `config.sample.js` indicates environment-specific configuration is intended to stay out of source control. The repository expects a real `config.js` at the root for the Google API key. That makes configuration a client-side concern, not a backend secret store, which is important when drawing the architecture.

12. **What is not present**
   There is no sign of a database schema, persistent session layer, build system, or framework such as React/Vue/Laravel. The architecture appears intentionally lightweight and page-oriented, with direct script inclusion and simple server endpoints rather than a larger application framework.

13. **Diagram takeaway**
   If you are drawing the architecture, model it as:
   - a static frontend composed of separate page modules,
   - a small PHP authentication backend,
   - and external Google Maps/Places services called directly from the browser.  
   The key boundaries are between page-level UI modules, auth forms to PHP endpoints, and the map UI to third-party mapping APIs.

Main entry points: [`Mainpage/MainPage.html`](https://github.com/swetha-arul/trip-planner/blob/main/Mainpage/MainPage.html) (Main page), [`map/map.js`](https://github.com/swetha-arul/trip-planner/blob/main/map/map.js) (Map logic), [`signuplogin/login.html`](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/login.html) (Login page), [`signuplogin/signup.html`](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/signup.html) (Signup page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_mainpage_html["Main page<br/>html entry<br/>[MainPage.html]"]
  node_mainpage_css["Main styles<br/>page css<br/>[MainPage.css]"]
  node_map_html["Map page<br/>html shell<br/>[map.html]"]
  node_map_css["Map styles<br/>page css<br/>[map.css]"]
  node_map_js["Map logic<br/>client app<br/>[map.js]"]
  node_auth_login_html["Login page<br/>auth page<br/>[login.html]"]
  node_auth_signup_html["Signup page<br/>auth page<br/>[signup.html]"]
  node_auth_css["Auth styles<br/>shared css<br/>[sigup_login.css]"]
  node_validation_js["Validation<br/>[validation.js]"]
  node_darkmode_js["Theme toggle<br/>ui behavior<br/>[darkmode.js]"]
  node_darkmode_css["Theme styles<br/>ui css<br/>[darkmode.css]"]
  node_darkmode_map_js["Map theme<br/>[darkmodemap.js]"]
  node_config_sample["Config sample<br/>client config<br/>[config.sample.js]"]
  node_asset_abt["About image<br/>static asset<br/>[abt.avif]"]
end

subgraph group_backend["Backend"]
  node_backend_login_php["Login API<br/>php endpoint<br/>[login.php]"]
  node_backend_signup_php["Signup API<br/>php endpoint<br/>[signup.php]"]
end

subgraph group_external["External services"]
  node_google_maps(("Google Maps<br/>external api"))
end

node_mainpage_html -->|"styles"| node_mainpage_css
node_mainpage_html -->|"nav"| node_auth_login_html
node_mainpage_html -->|"nav"| node_auth_signup_html
node_mainpage_html -->|"nav"| node_map_html
node_mainpage_html -->|"theme"| node_darkmode_js
node_mainpage_html -->|"theme styles"| node_darkmode_css
node_mainpage_html -->|"media"| node_asset_abt
node_map_html -->|"styles"| node_map_css
node_map_html -->|"behavior"| node_map_js
node_map_js -->|"config"| node_config_sample
node_map_js -->|"api calls"| node_google_maps
node_map_js -->|"theme"| node_darkmode_map_js
node_darkmode_map_js -->|"styles"| node_darkmode_css
node_auth_login_html -->|"styles"| node_auth_css
node_auth_signup_html -->|"styles"| node_auth_css
node_auth_login_html -->|"validate"| node_validation_js
node_auth_signup_html -->|"validate"| node_validation_js
node_auth_login_html -->|"submit"| node_backend_login_php
node_auth_signup_html -->|"submit"| node_backend_signup_php

click node_mainpage_html "https://github.com/swetha-arul/trip-planner/blob/main/Mainpage/MainPage.html"
click node_mainpage_css "https://github.com/swetha-arul/trip-planner/blob/main/Mainpage/MainPage.css"
click node_map_html "https://github.com/swetha-arul/trip-planner/blob/main/map/map.html"
click node_map_css "https://github.com/swetha-arul/trip-planner/blob/main/map/map.css"
click node_map_js "https://github.com/swetha-arul/trip-planner/blob/main/map/map.js"
click node_auth_login_html "https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/login.html"
click node_auth_signup_html "https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/signup.html"
click node_auth_css "https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/sigup_login.css"
click node_validation_js "https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/validation.js"
click node_darkmode_js "https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmode.js"
click node_darkmode_css "https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmode.css"
click node_darkmode_map_js "https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmodemap.js"
click node_config_sample "https://github.com/swetha-arul/trip-planner/blob/main/config.sample.js"
click node_asset_abt "https://github.com/swetha-arul/trip-planner/blob/main/pics/abt.avif"
click node_backend_login_php "https://github.com/swetha-arul/trip-planner/blob/main/Backend/login.php"
click node_backend_signup_php "https://github.com/swetha-arul/trip-planner/blob/main/Backend/signup.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mainpage_html,node_mainpage_css,node_map_html,node_map_css,node_map_js,node_auth_login_html,node_auth_signup_html,node_auth_css,node_validation_js,node_darkmode_js,node_darkmode_css,node_darkmode_map_js,node_config_sample,node_asset_abt toneBlue
class node_backend_login_php,node_backend_signup_php toneAmber
class node_google_maps toneMint
```

## Components

### Frontend

Browser-side pages, styling, and client logic

- [Main page](https://github.com/swetha-arul/trip-planner/blob/main/Mainpage/MainPage.html): html entry · Top-level landing page for the application · `Mainpage/MainPage.html`
- [Main styles](https://github.com/swetha-arul/trip-planner/blob/main/Mainpage/MainPage.css): page css · Styles for the public landing page · `Mainpage/MainPage.css`
- [Map page](https://github.com/swetha-arul/trip-planner/blob/main/map/map.html): html shell · UI shell for trip planning and map interaction · `map/map.html`
- [Map styles](https://github.com/swetha-arul/trip-planner/blob/main/map/map.css): page css · Layout and styling for the map experience · `map/map.css`
- [Map logic](https://github.com/swetha-arul/trip-planner/blob/main/map/map.js): client app · Routing, geolocation, and places-search behavior · `map/map.js`
- [Login page](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/login.html): auth page · Sign-in form and client-side entry point · `signuplogin/login.html`
- [Signup page](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/signup.html): auth page · Account creation form and client-side entry point · `signuplogin/signup.html`
- [Auth styles](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/sigup_login.css): shared css · Shared styling for login and signup pages · `signuplogin/sigup_login.css`
- [Validation](https://github.com/swetha-arul/trip-planner/blob/main/signuplogin/validation.js): client validation · Browser-side form validation for authentication flows · `signuplogin/validation.js`
- [Theme toggle](https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmode.js): ui behavior · Dark mode behavior for general pages · `darkmode/darkmode.js`
- [Theme styles](https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmode.css): ui css · Dark mode styling rules for the application · `darkmode/darkmode.css`
- [Map theme](https://github.com/swetha-arul/trip-planner/blob/main/darkmode/darkmodemap.js): map theme · Dark mode behavior adapted for the map experience · `darkmode/darkmodemap.js`
- [Config sample](https://github.com/swetha-arul/trip-planner/blob/main/config.sample.js): client config · Template for the browser-side Google Maps API key configuration · `config.sample.js`
- [About image](https://github.com/swetha-arul/trip-planner/blob/main/pics/abt.avif): static asset · Reusable image asset used by the site · `pics/abt.avif`

### Backend

PHP endpoints for authentication

- [Login API](https://github.com/swetha-arul/trip-planner/blob/main/Backend/login.php): php endpoint · Server-side authentication handler for login · `Backend/login.php`
- [Signup API](https://github.com/swetha-arul/trip-planner/blob/main/Backend/signup.php): php endpoint · Server-side authentication handler for account creation · `Backend/signup.php`

### External services

Third-party mapping APIs used directly from the browser

- **Google Maps**: external api · Third-party mapping, routing, and places services

## Connections

- Main page → Main styles: styles · Landing page uses its stylesheet
- Main page → Login page: nav · Landing page links into sign-in
- Main page → Signup page: nav · Landing page links into account creation
- Main page → Map page: nav · Landing page links into the planning experience
- Main page → Theme toggle: theme · Theme behavior can apply to the landing page
- Main page → Theme styles: theme styles · Landing page can use dark mode styling
- Main page → About image: media · Landing page may display shared imagery
- Map page → Map styles: styles · Map page uses its stylesheet
- Map page → Map logic: behavior · Map page is driven by client-side logic
- Map logic → Config sample: config · Map code expects a local browser config with API key
- Map logic → Google Maps: api calls · Map logic talks directly to Google Maps services
- Map logic → Map theme: theme · Map experience has dedicated dark mode handling
- Map theme → Theme styles: styles · Map theme logic works with shared theme styles
- Login page → Auth styles: styles · Login page uses shared auth styling
- Signup page → Auth styles: styles · Signup page uses shared auth styling
- Login page → Validation: validate · Login form uses client-side validation
- Signup page → Validation: validate · Signup form uses client-side validation
- Login page → Login API: submit · Login form posts to server-side auth endpoint
- Signup page → Signup API: submit · Signup form posts to server-side auth endpoint
