diff --git a/src/lib/ae_archives/README.md b/src/lib/ae_archives/README.md new file mode 100644 index 00000000..d52ce2a1 --- /dev/null +++ b/src/lib/ae_archives/README.md @@ -0,0 +1,28 @@ +# Aether (AE) Archives Module + +The Archives module is a system for storing and retrieving archived data. It is composed of two main data structures: `Archive` and `Archive_Content`. + +## Data Structures + +### Archive + +An `Archive` is a container for a collection of `Archive_Content` items. It has a name, description, and other metadata. + +### Archive Content + +An `Archive_Content` item represents a single piece of content within an `Archive`. This can be text, a file, a URL, or other data. + +## Functionality + +This module provides the following functionality: + +- **CRUD Operations:** Create, Read, Update, and Delete operations for both `Archive` and `Archive_Content` objects. +- **Local Caching:** Uses Dexie.js to cache data in the browser's IndexedDB for offline access and faster load times. +- **API Interaction:** All data operations are synced with the backend API. + +## Files + +- `ae_archives__archive.ts`: Contains functions for managing `Archive` objects. +- `ae_archives__archive_content.ts`: Contains functions for managing `Archive_Content` objects. +- `ae_archives_functions.ts`: Exports all the functions from the module for easy use in other parts of the application. +- `db_archives.ts`: Defines the IndexedDB schema for the archives module using Dexie.js. diff --git a/src/lib/ae_posts/README.md b/src/lib/ae_posts/README.md new file mode 100644 index 00000000..24b49866 --- /dev/null +++ b/src/lib/ae_posts/README.md @@ -0,0 +1,28 @@ +# Aether (AE) Posts Module + +The Posts module provides functionality for creating and managing posts and their associated comments. This is suitable for features like a blog, forum, or bulletin board. + +## Data Structures + +### Post + +A `Post` object represents a single entry, such as a blog post or a forum thread. It contains a title, content, and metadata about the author and topic. + +### Post Comment + +A `Post_Comment` object represents a comment made on a `Post`. + +## Functionality + +This module provides the following functionality: + +- **CRUD Operations:** Create, Read, Update, and Delete operations for both `Post` and `Post_Comment` objects. +- **Local Caching:** Uses Dexie.js to cache data in the browser's IndexedDB for offline access and faster load times. +- **API Interaction:** All data operations are synced with the backend API. + +## Files + +- `ae_posts__post.ts`: Contains functions for managing `Post` objects. +- `ae_posts__post_comment.ts`: Contains functions for managing `Post_Comment` objects. +- `ae_posts_functions.ts`: Exports all the functions from the module for easy use in other parts of the application. +- `db_posts.ts`: Defines the IndexedDB schema for the posts module using Dexie.js. diff --git a/src/lib/ae_sponsorships/README.md b/src/lib/ae_sponsorships/README.md new file mode 100644 index 00000000..79a4ae41 --- /dev/null +++ b/src/lib/ae_sponsorships/README.md @@ -0,0 +1,27 @@ +# Aether (AE) Sponsorships Module + +The Sponsorships module is designed to manage event or project sponsorships. It includes data structures and functions for handling sponsorship configurations and individual sponsorship records. + +## Data Structures + +### Sponsorship Configuration (`Sponsorship_Cfg`) + +This data structure defines the available sponsorship levels, options, and schedules for a particular event or account. It acts as a template for creating individual sponsorships. + +### Sponsorship + +This represents an actual sponsorship agreement with an organization or individual. It includes details about the sponsor, the selected level, payment amount, and other relevant information. + +## Functionality + +This module provides the following functionality: + +- **Data Loading:** Functions to load sponsorship configurations and sponsorship records from the backend API. +- **Data Export:** A function to download an export of sponsorship data in CSV or Excel format. +- **Local Caching:** Uses Dexie.js to cache data in the browser's IndexedDB for offline access and faster load times. +- **API Interaction:** All data operations are synced with the backend API. + +## Files + +- `ae_sponsorships_functions.ts`: Contains functions for loading and processing sponsorship data. +- `db_sponsorships.ts`: Defines the IndexedDB schema for the sponsorships module using Dexie.js. diff --git a/src/lib/electron/README.md b/src/lib/electron/README.md new file mode 100644 index 00000000..f734d908 --- /dev/null +++ b/src/lib/electron/README.md @@ -0,0 +1,48 @@ +# Electron Integration (Events - Launcher) + +This document describes the Electron integration for the Aether Svelte application, which provides native capabilities for the Events module, specifically for the **Event Launcher** functionality. + +## Overview + +The Event Launcher is not a standalone module but rather a set of native functions and UI elements integrated into the Events module. It is designed to be used in a hybrid event scenario where a local application (the Electron app) is used to control presentations and other event-related content on a local machine. + +## Architecture + +The Electron integration is composed of three main parts: + +1. **Electron Main Process (`electron.js`):** The main process of the Electron application. It is responsible for creating the browser window and handling communication with the renderer process. +2. **Native Functions (`src/lib/electron/electron_native.js`):** A set of functions that are executed in the Electron main process and have access to the operating system's native APIs. These functions provide the core functionality for the Event Launcher, such as opening files, running commands, and managing processes. +3. **Relay/Bridge (`src/lib/electron/electron_relay.js`):** A bridge that exposes the native functions to the Svelte application running in the renderer process. This allows the Svelte components to call the native functions. + +## Key Functionality + +The native functions in `electron_native.js` provide the following key functionalities for the Event Launcher: + +- **File Caching:** + - `check_hash_file_cache()`: Checks if a file with a specific hash exists in the local cache. + - `download_hash_file_to_cache()`: Downloads a file from the API and stores it in the local cache. +- **File Operations:** + - `open_hash_file_to_temp()`: Copies a file from the cache to a temporary directory and opens it. + - `open_local_file()`: Opens a local file. +- **Process Management:** + - `kill_processes()`: Kills processes by name or ID. This is used to close presentation applications after a presentation is finished. +- **Command Execution:** + - `run_osascript()`: Runs an AppleScript command (macOS only). + - `run_cmd()`: Runs a shell command. +- **Device Information:** + - `get_device_info()`: Gets information about the device, which can be used for logging and debugging. + +## UI Integration + +The Event Launcher functionality is integrated into the Events module's UI as follows: + +- **Launcher Links:** In the list of event sessions, there are "launcher" links that, when clicked, trigger the native launcher functionality. +- **Configuration:** The visibility and behavior of the launcher links are controlled by the `mod_pres_mgmt_json` configuration in the `Event` object. This allows for fine-grained control over the launcher functionality on a per-event basis. + +## How it Works + +1. The Svelte application, running in the Electron renderer process, displays a list of event sessions. +2. For each session, a "launcher" link is displayed if the configuration allows it. +3. When the user clicks on a launcher link, a function in `electron_relay.js` is called. +4. The relay function then calls the corresponding native function in `electron_native.js` via the Electron context bridge. +5. The native function performs the requested action, such as downloading a file, opening a presentation, or running a command. diff --git a/src/routes/core/README.md b/src/routes/core/README.md new file mode 100644 index 00000000..d77ba21c --- /dev/null +++ b/src/routes/core/README.md @@ -0,0 +1,36 @@ +# Core Module + +This directory (`src/routes/core`) contains Svelte pages and components for managing the core data objects of the Aether (AE) system. While the primary data logic, API interactions, and database definitions are located in `src/lib/ae_core`, this directory provides the user-facing interfaces for interacting with that data. + +## Core Data Modules + +The Aether system is built on a foundation of several core modules. The UI components for these modules are, or will be, located here. + +### Accounts + +- **Description:** Manages client accounts (not to be confused with user accounts). An account is the top-level organizational unit. +- **Logic:** `src/lib/ae_core/core__account.ts` + +### Hosted Files + +- **Description:** Handles file uploads, storage, and retrieval. Provides components for file upload buttons and video players. +- **Logic:** `src/lib/ae_core/core__hosted_files.ts` +- **Route:** `/hosted_files` + +### People + +- **Description:** Manages information about individuals. A "person" can be a user, a contact, an event presenter, etc. This is the central object for representing people in the system. +- **Logic:** `src/lib/ae_core/core__person.ts` +- **UI Components:** + - `ae_comp__person_obj_tbl.svelte`: A table for displaying a list of people. + - `person_view.svelte`: A component for displaying the details of a single person. + +### Sites & Site Domains + +- **Description:** Manages different sites or instances of the application and their associated domain names. This allows for multi-tenant configurations. +- **Logic:** `src/lib/ae_core/core__site.ts` and `core__site_domain.ts` + +### Users + +- **Description:** Manages user accounts, including authentication, permissions, and user-specific settings. +- **Logic:** `src/lib/ae_core/core__user.ts` diff --git a/src/routes/events/README.md b/src/routes/events/README.md new file mode 100644 index 00000000..640ab2c7 --- /dev/null +++ b/src/routes/events/README.md @@ -0,0 +1,32 @@ +# Events - Presentation Management Module + +This module provides the user interface for managing the core components of an event, with a focus on sessions, presentations, and associated files. It allows event organizers to structure the event program, manage presentation details, and handle related content. + +This directory (`src/routes/events`) contains the Svelte components and pages that constitute the user interface for this feature. + +## Features + +- **Event Program Structure:** The UI allows for viewing and managing the hierarchy of an event, including its sessions and the presentations within those sessions. +- **Session Management:** View lists of sessions for an event, wrapped in various UI components for different display needs (`li`, `tbl`). +- **Presentation Management:** View lists of presentations associated with sessions. +- **File Management:** A key feature is the ability to manage event-related files. This includes uploading new files and viewing lists of existing files associated with the event. + +## UI Components & Pages + +- `+page.svelte`: The main landing page that displays a list of all events. +- `[event_id]/+page.svelte`: The main page for a single event, which serves as the hub for managing its details. +- `ae_comp__event_session_obj_li.svelte` / `..._tbl.svelte`: Components that render lists of event sessions in different formats. +- `ae_comp__event_presentation_obj_li.svelte`: A component that renders a list of presentations for a session. +- `ae_comp__event_file_obj_tbl.svelte`: A component for displaying a table of files related to the event. +- `ae_comp__event_files_upload.svelte`: A component providing the UI for uploading files. +- `ae_comp__events_menu_nav.svelte` / `..._opts.svelte`: Navigation and option menus specific to the events module. + +## Core Logic & Data Models + +The underlying data models, API interactions, and database logic for this module are located in `src/lib/ae_events/`. The key data models include: + +- **`Event`**: The top-level object for an event. +- **`EventSession`**: Represents a session within an event. +- **`EventPresentation`**: Represents a presentation within a session. +- **`EventPresenter`**: Represents a speaker for a presentation. +- **`EventFile`**: Represents a file associated with any part of the event. diff --git a/src/routes/events_badges/README.md b/src/routes/events_badges/README.md new file mode 100644 index 00000000..6f24eb32 --- /dev/null +++ b/src/routes/events_badges/README.md @@ -0,0 +1,39 @@ +# Events - Badges Module + +This document describes the **Events - Badges** module, which is a sub-module of the Events module. It provides functionality for finding, reviewing, and printing badges for event attendees. + +## Overview + +The Badges module is designed to streamline the badge printing process at events. It allows event staff to quickly find an attendee's badge, review the information, and print it on demand. + +## Data Models + +The Badges module is based on two main data models: + +- **`EventBadge`**: Represents a badge for an event attendee. It contains all the information that will be printed on the badge, such as the attendee's name, professional title, affiliations, and badge type. It also includes override fields that allow for last-minute corrections. +- **`EventBadgeTemplate`**: Represents a template for a badge. It defines the layout, style, and content of the badge, including logos, headers, footers, and ticket information. + +## Features + +- **Search:** The module provides a powerful search functionality that allows users to find badges by name, email, or affiliations. +- **QR Code Scanning:** It includes a QR code scanner that can be used to find a badge by scanning the QR code on an attendee's registration confirmation. +- **Badge Review:** Before printing, the module displays a preview of the badge, allowing the event staff to review the information and make any necessary corrections. +- **Printing:** The module provides a simple interface for printing badges. +- **Client-Side Caching:** The module uses Dexie.js for client-side caching in IndexedDB, which improves performance and enables offline access. + +## UI Components + +The Badges module is composed of the following UI components: + +- **`+page.svelte` (in `src/routes/events_badges`):** The main entry point for the Badges module. It provides a restricted access page with some general information. +- **`review/+page.svelte`:** The main UI for finding and reviewing badges. It includes the search bar, QR code scanner, and the list of search results. +- **`/event/badge/view_badge` (route not in this directory):** A page that displays a preview of the badge and provides the printing functionality. + +## How it Works + +1. The event staff navigates to the `events_badges/review` page. +2. They can either search for an attendee by name, email, or affiliations, or they can use the QR code scanner to find the attendee's badge. +3. The module displays a list of badges that match the search criteria. +4. The staff clicks on a badge to view the details. +5. The user is redirected to the `/event/badge/view_badge` page, which displays a preview of the badge. +6. The staff can then print the badge. diff --git a/src/routes/events_leads/README.md b/src/routes/events_leads/README.md new file mode 100644 index 00000000..2be80848 --- /dev/null +++ b/src/routes/events_leads/README.md @@ -0,0 +1,48 @@ +# Events - Leads Module + +This document describes the **Events - Leads** module, which is a sub-module of the Events module. It provides a lead retrieval solution for exhibitors at an event. + +## Overview + +The Leads module allows exhibitors to capture, manage, and export leads from event attendees. It is designed to be used on a variety of devices, including desktops, tablets, and smartphones. + +## Data Models + +The Leads module is based on two main data models: + +- **`EventExhibit`**: Represents an exhibitor at an event. It contains information about the exhibitor, such as their name, description, and booth number. It also includes configuration options for the lead retrieval service, such as custom questions and the number of licenses. +- **`EventExhibitTracking`**: Represents a lead captured by an exhibitor. It links an exhibitor (`event_exhibit_id`) with an attendee's badge (`event_badge_id`) and includes fields for notes and responses to custom questions. + +## Features + +- **Authentication:** The module supports two types of authentication for exhibitor staff: + - **Shared Passcode:** A shared passcode can be used by all staff members of an exhibitor. + - **License-based:** Individual licenses can be assigned to staff members, each with their own email and passcode. +- **Lead Capture:** Leads can be captured by: + - **Scanning QR Codes:** The module includes a QR code scanner that can be used to scan the QR code on an attendee's badge. + - **Manual Entry:** The attendee's badge ID can be entered manually. +- **Lead Management:** The module provides a comprehensive interface for managing leads, including: + - Viewing a list of all captured leads. + - Viewing the details of a single lead. + - Adding notes to a lead. + - Answering custom questions for a lead. +- **Lead Export:** Leads can be exported to a CSV or Excel file for further processing. +- **License Management:** Exhibitors can manage their licenses, including adding, editing, and removing licenses. +- **Client-Side Caching:** The module uses Dexie.js for client-side caching in IndexedDB, which improves performance and enables offline access. + +## UI Components + +The Leads module is composed of the following UI components: + +- **`exhibit/[slug]/+page.svelte`:** The main entry point for an exhibitor. It provides a tabbed interface for accessing the different features of the module. +- **`exhibit/[slug]/leads_add_scan.svelte`:** A component for adding a new lead by scanning a badge or entering the badge ID manually. +- **`exhibit/[slug]/leads_list.svelte`:** A component for viewing and managing the list of captured leads. +- **`exhibit/[slug]/leads_manage.svelte`:** A component for managing the exhibitor's settings and exporting leads. +- **`exhibit/[slug]/leads_view_lead.svelte`:** A component for viewing the details of a single lead. + +## How it Works + +1. The exhibitor navigates to the `events_leads/exhibit/[slug]` page, where `[slug]` is their exhibitor ID. +2. They authenticate using either the shared staff passcode or their individual license. +3. They can then use the different tabs to capture new leads, manage their existing leads, and configure their settings. +4. All data is fetched from the API and cached in IndexedDB for offline access and faster loading times. diff --git a/src/routes/idaa/README.md b/src/routes/idaa/README.md new file mode 100644 index 00000000..2c7ec109 --- /dev/null +++ b/src/routes/idaa/README.md @@ -0,0 +1,41 @@ +# IDAA Integration Module + +This module integrates features from the Aether (AE) application into the IDAA (International Doctors in Alcoholics Anonymous) website, which is powered by a system called Novi. The integration is achieved by embedding Aether pages within iframes inside the Novi site. + +This directory (`src/routes/idaa`) contains the Svelte routes that correspond to the pages on the main IDAA site. + +## Architecture + +The integration uses a multi-step iframe-based approach: + +1. **Novi Page:** A page on the IDAA website contains a snippet of code that loads a static HTML file from this Aether project's `static/` directory into an iframe. +2. **Static HTML Bridge:** The static file (e.g., `static/idaa_novi_iframe_archives.html`) acts as a bridge. It contains JavaScript that: + a. Executes within the context of the Novi site, allowing it to access Novi-specific data like the current user's unique ID (`<%=Novi.User.CustomerUniqueId%>`). + b. Uses the Novi user ID to make a call to the Novi API to get more user details (like email and full name). + c. Uses the retrieved user details to construct a URL for the actual Aether application page. + d. Loads the Aether page into a nested iframe on the static page. +3. **Aether Application:** The final Aether page (e.g., `/idaa/archives`) receives the user information via URL parameters and displays the relevant content. + +This architecture allows the Aether application to securely authenticate and identify the Novi user without a complex SSO integration. + +## Sub-modules + +The IDAA integration includes the following features, each corresponding to a route in this directory and a static HTML bridge file. + +### IDAA - Archives + +- **Route:** `/idaa/archives` +- **Bridge File:** `static/idaa_novi_iframe_archives.html` +- **Functionality:** Provides access to the Aether Archives module, allowing IDAA members to view and search archived content. + +### IDAA - Bulletin Board (BB) + +- **Route:** `/idaa/bb` +- **Bridge File:** `static/idaa_novi_iframe_bulletin_board.html` +- **Functionality:** Provides a bulletin board or forum feature, powered by the Aether Posts module. + +### IDAA - Recovery Meetings + +- **Route:** `/idaa/recovery_meetings` +- **Bridge File:** `static/idaa_novi_iframe_recovery_meetings.html` +- **Functionality:** Displays a list of recovery meetings. This may also integrate with a Jitsi meeting interface (`idaa_novi_iframe_jitsi_meeting.html`). diff --git a/src/routes/journals/README.md b/src/routes/journals/README.md new file mode 100644 index 00000000..971bcd04 --- /dev/null +++ b/src/routes/journals/README.md @@ -0,0 +1,26 @@ +# Journals Module + +The Journals module provides a user-facing application for creating and managing personal journals. It can be used for various purposes such as a personal diary, a blog, a notebook, or any other form of chronological or topical record-keeping. + +This directory (`src/routes/journals`) contains the Svelte components and pages that constitute the user interface for the Journals feature. + +## Features + +- **Journal & Entry Management:** The UI allows for full CRUD (Create, Read, Update, Delete) functionality for both journals and their entries. +- **Rich Content Editing:** Journal entries can be written using Markdown for rich text formatting. +- **Encryption:** The UI provides an interface for setting and using passcodes to encrypt and decrypt journal entries. +- **Offline Support:** The application uses a local IndexedDB cache (via Dexie.js) for all data, allowing for offline access and faster interactions. Data is synchronized with the backend API. + +## UI Components & Pages + +- `+page.svelte`: The main landing page that displays a list of all journals for the current user. +- `[journal_id]/+page.svelte`: The page for viewing a single journal and its list of entries. +- `ae_comp__journal_obj_li.svelte`: A component that renders the list of journals. +- `ae_comp__journal_obj_id_view.svelte`: A component for viewing the details of a selected journal. +- `ae_comp__journal_entry_obj_li.svelte`: A component that renders the list of entries for a journal. +- `ae_comp__journal_entry_obj_id_view.svelte`: A component for viewing the content of a single journal entry. +- `ae_comp__journal_obj_id_edit.svelte`: A modal component for creating and editing journals. + +## Core Logic + +The underlying data models, API interactions, and database logic for this module are located in `src/lib/ae_journals/`.